chore: update README
This commit is contained in:
parent
9e98b61472
commit
7590c2ef9c
1 changed files with 9 additions and 9 deletions
18
README.md
18
README.md
|
@ -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
|
- API server is written in Go with the [chi](https://github.com/go-chi/chi) router
|
||||||
- Persistent data is stored in PostgreSQL
|
- Persistent data is stored in PostgreSQL
|
||||||
- Temporary data is stored in Redis
|
- 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
|
## Development
|
||||||
|
|
||||||
When working on the frontend, run the API and then use `yarn dev` for hot reloading.
|
When working on the frontend, run the API and then use `yarn dev` in `frontend/` 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.
|
|
||||||
|
|
||||||
## Building
|
## 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.
|
## Running
|
||||||
Note that it should still be run behind a reverse proxy for TLS.
|
|
||||||
|
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
|
## License
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue