|
1 |
| -# Getting Started with Create React App |
| 1 | +# Symptomizer |
2 | 2 |
|
3 |
| -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
| 3 | +> The frontend of Symptomizer |
4 | 4 |
|
5 |
| -## Available Scripts |
| 5 | +## Prerequisites |
6 | 6 |
|
7 |
| -In the project directory, you can run: |
| 7 | +- [Node.js](https://nodejs.org/en/) |
8 | 8 |
|
9 |
| -### `npm start` |
| 9 | + v15.6.0 is confirmed to work. |
10 | 10 |
|
11 |
| -Runs the app in the development mode.\ |
12 |
| -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
| 11 | +## Getting Started |
13 | 12 |
|
14 |
| -The page will reload if you make edits.\ |
15 |
| -You will also see any lint errors in the console. |
| 13 | +1. `git clone [email protected]:symptomizer/frontend.git` |
| 14 | +1. `cd frontend` |
| 15 | +1. `npm i` |
| 16 | +1. `npm run build` |
16 | 17 |
|
17 |
| -### `npm test` |
| 18 | +## Project Structure |
18 | 19 |
|
19 |
| -Launches the test runner in the interactive watch mode.\ |
20 |
| -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
| 20 | +This project is primarily a [Create React App](https://create-react-app.dev/). It uses [TypeScript](https://www.typescriptlang.org/) to aid the developer experience. |
21 | 21 |
|
22 |
| -### `npm run build` |
| 22 | +### React App |
23 | 23 |
|
24 |
| -Builds the app for production to the `build` folder.\ |
25 |
| -It correctly bundles React in production mode and optimizes the build for the best performance. |
| 24 | +If you only need to run the React app, you can just run `npm run start`. It auto hot-reloads so is great for developing the UI. |
26 | 25 |
|
27 |
| -The build is minified and the filenames include the hashes.\ |
28 |
| -Your app is ready to be deployed! |
| 26 | +## FAB |
29 | 27 |
|
30 |
| -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
| 28 | +This project is enhanced as a [FAB](https://fab.dev/), which allows us to sprinkle in some server-side functionality. These plugins can be found in the `./api` folder. Right now, there's just a mock GraphQL server, but in the future, we could use this for user authorization etc. |
31 | 29 |
|
32 |
| -### `npm run eject` |
| 30 | +## Testing |
33 | 31 |
|
34 |
| -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
| 32 | +Pretty minimal at this point, but CRA comes with Jest testing built-in, so there's one example in `./src/App.test.tsx`. |
35 | 33 |
|
36 |
| -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. |
| 34 | +### Static Testing & Linting |
37 | 35 |
|
38 |
| -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. |
| 36 | +[ESLint](https://eslint.org/) comes pre-setup with CRA, and [Prettier](https://prettier.io/) is setup with [`lint-staged`](https://github.com/okonet/lint-staged) and [`husky`](https://github.com/typicode/husky) so it be run automatically when you `git commit`. |
39 | 37 |
|
40 |
| -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. |
| 38 | +## Deployment |
41 | 39 |
|
42 |
| -## Learn More |
43 |
| - |
44 |
| -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
45 |
| - |
46 |
| -To learn React, check out the [React documentation](https://reactjs.org/). |
| 40 | +[Linc](https://linc.sh/) is setup to handle the CI/CD pipeline to build and deploy the FAB on [Cloudflare Workers](https://workers.cloudflare.com/). Preview builds happen for every commit, and anything merged into the default branch is deployed to production (currently that's [https://symptomizer.gregbrimble.workers.dev/](https://symptomizer.gregbrimble.workers.dev/), but we'll obviously get setup with a custom domain at some point). |
0 commit comments