A barebones repo that can make it easier to develop and deploy a full-stack app using React and FastAPI.
- FastAPI: Fast, simple, and has a modern design.
- Vite React
react-swc-ts
: Greatly simplifies the development process. Outstanding HMR support. - MongoDB: Not just reliable and fast, but offer the ability to easily create distributed databases.
- Docker: Fundamental tool in modern development.
- React Buddy: I just love this Webstorm plugin! Will make it optional later.
-
Update all node packages:
pushd web && & echo y > npx npm-check-updates -u && npm i && popd
-
Copy .env file from example:
cp Deploy/.env.example Deploy/.env
-
Build dev images:
docker compose -f Deploy/dev_compose.yml build
-
Start your app in dev mode
docker compose -f Deploy/dev_compose.yml up
-
When you are ready to ship, update and save all packages:
pushd web && & echo y > npx npm-check-updates -u && npm i --save && popd
-
Start it for production:
docker compose -f Deploy/main_compose.yml build && docker compose -f Deploy/main_compose.yml up
- Make sure set API folder as source in Pycharm project
- Enviromental variables: Deploy/.env
- Logs: /logs
Deploy/.env
Variable | Description | Default |
---|---|---|
API_PORT | Port number INT |
8008 |
DEBUG_MODE | Debyg mode for development. More logs, autoreload from disk. String : 'True'/'False |
True |
COMPOSE_PROJECT_NAME | Name of compose group in docker listing. Строка |
ltl_fullstack |
DOCKER | Launch method. Set on "Docker" for launch in container. Setting DEBUG_MODE on False. String : 'True'/'False |
'True' |
Full API tests:
docker compose -f Deploy/main_compose.yml run --rm ltl_api /bin/sh tests/all_tests_comm.sh
- Clearer API modes and variables.
- Simplified QA.
- API unittests libraries to separate step in dockerfile.
- Container for backend and frontend QA tests .
- One command project start.
- More options for project creation.