This starter project provides a setup that includes:
- Python 3.8
- Flask 1.1
- MySQL
- SQLAlchemy ORM
- Docker & docker-compose
Prerequisites: Python 3
For local development, it's advisable to use venv to set up a local Python environment.
- Install venv:
py -m pip install --user virtualenv
- Create a local env:
py -m venv env
- Follow the venv guide to activate the local env for your OS
- Install dependencies locally via:
pip install -r requirements.txt
. - Configure your IDE to point to the locally installed Python version, located at:
./env/Scripts/python
. - Create a copy of
.env.example
and name it.env
. Populate this with sensitive values that the app will require during runtime. - Run the server:
sh ./scripts/serve.sh
- Access the server at :
http://localhost:5000
Note: if the py
command isn't recognised, you may need to substitute it with python
or
python3
depending on your setup.
Prerequisites: Docker & docker-compose (included in the latest versions of Docker)
- Create a copy of
.env.example
and name it.env
. Populate this with sensitive values that the app will require during runtime. - Bring up the app and MySQL instance together using:
sh ./scripts/docker-up.sh
- Wait for both the API and MySQL containers to completely start up (logs should stop being emitted in the terminal)
- Access the server at
http://localhost:5000