chore: update README

This commit is contained in:
Sam 2022-09-08 14:10:45 +02:00
parent 9e98b61472
commit 7590c2ef9c
1 changed files with 9 additions and 9 deletions

View File

@ -7,22 +7,22 @@ A work-in-progress site to share your pronouns and preferred terms.
- API server is written in Go with the [chi](https://github.com/go-chi/chi) router
- Persistent data is stored in PostgreSQL
- Temporary data is stored in Redis
- The frontend is written in TypeScript with React, using [Vite](https://vitejs.dev/)
- The frontend is written in TypeScript with React, using [Next](https://nextjs.org/) for server-side rendering
## Development
When working on the frontend, run the API and then use `yarn dev` for hot reloading.
Note that Vite does _not_ proxy the preview pages (`/@user` and `/@user/member`),
and as such, the Go server must be used directly to test it. However, as the preview pages are
rendered by the Go server, and doesn't share code with the frontend (except for CSS), I consider this an acceptable compromise.
When working on the frontend, run the API and then use `yarn dev` in `frontend/` for hot reloading.
## Building
Run `make all`. This will build the frontend, then embed that in the backend.
Run `make backend` to build the API server, then run `yarn build` in `frontend/`.
The resulting `pronouns` binary is a statically linked executable containing everything needed to run the website.
Note that it should still be run behind a reverse proxy for TLS.
## Running
Both the backend and frontend are expected to run behind a reverse proxy such as [Caddy](https://caddyserver.com/).
The frontend should serve every possible path _except_ anything starting with `/api/`, which should be routed to the backend instead.
**Make sure to rewrite requests going to the API server to remove the starting `/api/`.**
## License