# SEQUENTIA Backend
## Getting started
First make sure that you have Python 3 installed. Then:
```
# Clone repository
git clone git@github.com:AsLogd/sequentia.git
cd sequentia
# Create virtual env (only the first time)
python3 -m venv venv
# Activate virtualenv (every time you want to run the project)
. venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Initialize DB
flask db upgrade
# Run
flask run
```
## Database
For development, this project uses SQLite, which stores the data in a file. In this case, the database is stored in `/app.db`.
To create mock data run:
```
flask database-fill
```
To empty the database:
```
flask database-empty
```
You can also run the interactive shell with some utilities:
```
flask shell
> User.query.all()
> Obituary.query.all()
> Shell.sql("SELECT * from user")
...
```
Check `sequentia.py` for more details.
## Migrating
If changing the models:
```
flask db migrate -m "Change description message"
```
After creating a migration or after update/pull:
```
flask db upgrade
```