Work In Progress
To provide a Dockerized starting point for a new React+Flask project with a Postgres database.
The following frontend setup will be used via Vite tooling:
- TypeScript
- React
The following backend setup will be used:
- Flask, Flask SQLAlchemy, Flask Migrate
- mypy
- Pytest, Pytest-cov
- Black, isort
- Clone the repo.
- Make sure Docker Desktop is running.
- Run
make init
from the project root directory. This will do the following:- Ask you for a new project name and then add that name to various files.
- Set up a
.env
file for some environment variables. - Create all of the Docker images and containers
- Start the containers:
- Frontend - Vite server at
http://localhost:5173/
- Backend - Flask server at
http://localhost:5002/
- Database - Postgres server at
http://localhost:5432/
- Frontend - Vite server at
- Create
development
andtest
databases.
- Delete the existing
.git
project repo. - Run
git init
.
After that, you can start working on your app code.
Check out the project's Makefile to what tasks are available. For example,
make backed_shell
will give you access to the backend Docker shell.make backend_test
will start a file watcher for your backend files and runpytest
when a test file (or corresponding source file) has changed.- Note: For VSCode, your VSCode window should be attached to the backend container for file changes to be detected.