2023-05-21 01:50:44 +01:00
|
|
|
# TODO Backend
|
|
|
|
|
|
|
|
Built using fastapi.
|
|
|
|
|
2023-05-31 16:37:56 +01:00
|
|
|
## Deployment
|
|
|
|
|
|
|
|
### Database Migrations
|
2023-05-21 01:50:44 +01:00
|
|
|
|
|
|
|
You must run database migrations after first deploying the database, by running
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo docker exec -w /app/todo/database -it todo-backend alembic upgrade head
|
|
|
|
```
|
|
|
|
|
|
|
|
once you have launched the `todo-backend`-container.
|
2023-05-31 16:37:56 +01:00
|
|
|
|
|
|
|
## Development
|
|
|
|
|
|
|
|
### Populate the database
|
|
|
|
|
|
|
|
You can populate the database with fake users and todo-items by running
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo docker exec -it todo-backend ash -c 'python -c "import todo.utils.fakery as fk; fk.populate_database()"'
|
|
|
|
```
|
|
|
|
|
|
|
|
once you have applied all database migrations.
|