This template workspace gives the project structure to setup a flask web application, using SQLAlchemy, Flask-Migrate, Flask-Marshmallow and Pytest.
Alembic migrations are stored in the migrations
folder by default.
This project was inspired and follows the same structure as another Flask example made by the youtuber Eduardo Mendes. My goal is to expand with more advanced configurations, including Docker and CI/CD.
This project features an flask app, defined as a package in the __init__.py file, the function create_app
act as application factory and is automatically detected when flask run
is executed (see the Flask tutorial for more details).
All database tables are expressed as classes in the models.py file, the function to setup the database is also defined in this file.
serializer.py contains the schemas to serialize every model.
hello_world.py defines a blueprint, which contains its own set of routes that can be registered to the app.
Lastly. the html that is rendered on the starting route is included in the templates folder
export DATABASE_URI="your_database_uri_here"
setx DATABASE_URI="your_database_uri_here"
pip install -r dev_requirements.txt
flask run --debug
- Containerize the application
- Set up dependabot
- Create actions workflow for migrations
- Configure logging
- Style the hello page