docs: Clarify reproduction steps again

master
John Montagu, the 4th Earl of Sandvich 2024-12-11 22:34:05 -08:00
parent 3d93b7f355
commit fb050214b9
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
2 changed files with 40 additions and 29 deletions

View File

@ -1,6 +1,6 @@
# availabili.tf # availabili.tf
Scheduling for TF2 Schedule and availability system for Team Fortress 2 teams.
## Tech Stack ## Tech Stack
@ -13,11 +13,47 @@ Scheduling for TF2
OpenAPI documentation OpenAPI documentation
- [Flask-Migrate](https://flask-migrate.readthedocs.io/en/latest/) - [Flask-Migrate](https://flask-migrate.readthedocs.io/en/latest/)
(Alembic) for database migrations (Alembic) for database migrations
- [Celery](https://docs.celeryproject.org/en/stable/) for async tasks - [Celery](https://docs.celeryproject.org/en/stable/) for async and
scheduled tasks
- [Redis](https://redis.io/) for Celery broker - [Redis](https://redis.io/) for Celery broker
- **Database:** [PostgreSQL 17.1](https://www.postgresql.org/docs/17/index.html) - **Database:** [PostgreSQL 17.1](https://www.postgresql.org/docs/17/index.html)
(production) / SQLite (development) (production) / SQLite (development)
## Setup (production, Postgres)
Build the frontend app, assuming Node.js is installed:
```sh
cd availabili.tf
npm install
npm run build
cd ..
```
Build the rest of the containers:
```sh
docker compose -f docker-compose.prod.yml build
docker compose -f docker-compose.prod.yml up db backend
```
Perform initial database migration. This is for automatically setting up the
database schema for the first time:
```sh
docker exec -it backend bash
flask db upgrade
exit
```
Bring up the rest of the containers:
```sh
docker compose -f docker-compose.prod.yml up
```
The app will run at port 8000 and the database will be available at port 5432.
## Setup (development, SQLite3) ## Setup (development, SQLite3)
Build the frontend app: Build the frontend app:
@ -36,31 +72,7 @@ docker compose up
DATABASE_URI=sqlite:///db.sqlite3 flask db upgrade DATABASE_URI=sqlite:///db.sqlite3 flask db upgrade
``` ```
App will run at port 8000. The app will run at port 8000.
## Setup (production, Postgres)
Build the frontend app:
```sh
cd availabili.tf
npm install
npm run build
```
Build the rest of the containers:
```sh
docker compose -f docker-compose.prod.yml build
docker compose -f docker-compose.prod.yml up
```
Perform initial database migration:
```sh
docker exec -it backend bash
flask db upgrade
```
## OpenAPI ## OpenAPI
@ -68,7 +80,7 @@ The backend will automatically serve its OpenAPI-compliant spec at
`/apidoc/openapi.json` which can also be viewed at `/apidoc/redoc` or `/apidoc/openapi.json` which can also be viewed at `/apidoc/redoc` or
`/apidoc/swagger` or `/apidoc/scalar`. `/apidoc/swagger` or `/apidoc/scalar`.
To generate the frontend client: To regenerate the frontend client during development:
```sh ```sh
npm run openapi-generate npm run openapi-generate

View File

@ -14,7 +14,6 @@ services:
POSTGRES_DB: availabilitf POSTGRES_DB: availabilitf
volumes: volumes:
- db-data:/var/lib/postgres/data - db-data:/var/lib/postgres/data
- /var/log/postgres/logs:/var/lib/postgres/logs
restart: unless-stopped restart: unless-stopped
command: ["postgres", "-c", "logging_collector=on", "-c", "log_directory=/var/lib/postgresql/logs", "-c", "log_filename=postgresql.log", "-c", "log_statement=all"] command: ["postgres", "-c", "logging_collector=on", "-c", "log_directory=/var/lib/postgresql/logs", "-c", "log_filename=postgresql.log", "-c", "log_statement=all"]