- Node-based frontend
- Typescript
- ReactJS
- NextJS
- NextAuth (soon)
- Material-UI
- Python-based backend
- Flask
- Flask-CORS
- Flask-SQLAlchemy
- Flask-JWT-Extended
- Tox (Python 3.9, 3.10, and 3.11)
- Separate requirements.txt (production) and requirements_dev.txt (development/testing) dependencies
First create a .flaskenv
file to setup the environment variables
FLASK_APP="application:create_app()"
SECRET_KEY="SECRET"
JWT_SECRET_KEY="SECRET"
# These are available as default parameters for the 'flask run' command
FLASK_RUN_HOST="0.0.0.0"
FLASK_RUN_PORT=1122
FLASK_RUN_RELOAD=False
FLASK_RUN_DEBUGGER=False
# Breakpoints not hit when run from embeddable Python
# https://github.com/microsoft/debugpy/issues/890
PYDEVD_DISABLE_FILE_VALIDATION=1
To populate the database with test data run the following command in the backend directory after installation
flask --debug remake
Start the frontend by launching node
in a terminal in the frontend directory
npm run dev
Start the backend by launching flask
in a terminal in the backend directory
flask --debug run
Debug the application with the following launch.json
{
"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceFolder}/frontend",
"command": "npm run dev",
"name": "node",
"request": "launch",
"type": "node-terminal"
},
{
"cwd": "${workspaceFolder}/backend",
"name": "flask",
"type": "python",
"request": "launch",
"module": "flask",
"args": ["--debug", "run"],
"jinja": true,
"justMyCode": false,
"consoleTitle": "flask"
}
]
}
The frontend listens on port 80 because of the --port 80
argument on the dev script in package.json
{
"scripts": {
"dev": "next dev --port 80"
}
}
The backend listens on port 1122 because of the FLASK_RUN_PORT
environment variable in .flaskenv
FLASK_RUN_PORT=1122
This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.
See LICENSE for more information.