The frontend of Symptomizer
-
v15.6.0 on macOS Big Sur is confirmed to work.
-
git clone git@github.com:symptomizer/frontend.git
-
cd frontend
-
npm i
-
npm run test
This will ensure the project is in a good state. It performs linting and formatting, it builds the artifacts, and it runs the tests.
This project is primarily a Create React App. It uses TypeScript to aid the developer experience.
If you only need to run the React app, you can just run npm run start
. This auto hot-reloads so is great for developing the UI.
The code can be found in ./src
. It uses React Router for navigation and Apollo Client for data transport. The UI itself is predominately built with Tailwind UI.
This project is enhanced as a FAB, 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.
To run the full FAB build (which is as close to production as you can get), npm run build:fab && npx fab serve
Pretty minimal at this point, but CRA comes with Jest built-in and there's one example in ./src/App.test.tsx
.
ESLint comes pre-installed with CRA, and Prettier is setup with lint-staged
and husky
so it be run automatically when you git commit
(along with the Jest tests).
Linc is setup to handle the CI/CD pipeline to build and deploy the FAB on Cloudflare Workers. 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/, but we'll obviously get setup with a custom domain at some point).