2.5 KiB
2.5 KiB
availabili.tf
Schedule and availability system for Team Fortress 2 teams.
Tech Stack
- Frontend: Vue 3 + TypeScript
- State Management: Pinia
- Backend: Flask + Python
- ORM: SQLAlchemy
- Validation: Pydantic
- spectree for OpenAPI documentation
- Flask-Migrate (Alembic) for database migrations
- Celery for async and scheduled tasks
- Redis for Celery broker
- Database: PostgreSQL 17.1 (production) / SQLite (development)
File Structure
availabili.tf/ root
├── availabili.tf/ frontend (Vue.js)
├── backend-flask/ backend/software layer (Python)
├── nginx/ reverse proxy
├── docker-compose.prod.yml production environment
├── docker-compose.yml development environment
└── README.md this file
Setup (production, Postgres)
Build the frontend app, assuming Node.js is installed:
cd availabili.tf
npm install
npm run build
cd ..
Build the rest of the containers:
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:
docker exec -it backend-production bash
flask db upgrade
exit
Bring up the rest of the containers:
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)
Build the frontend app:
cd availabili.tf
npm install
npm run build
Build the rest of the containers and perform initial database migration:
docker compose build
docker compose up
DATABASE_URI=sqlite:///db.sqlite3 flask db upgrade
The app will run at port 8000.
OpenAPI
The backend will automatically serve its OpenAPI-compliant spec at
/apidoc/openapi.json
which can also be viewed at /apidoc/redoc
or
/apidoc/swagger
or /apidoc/scalar
.
To regenerate the frontend client during development:
npm run openapi-generate