14. Makefile Setup
This project consists of multiple languages, so each one has its own set of commands. I often mix them up. To address this, I decided to add a Makefile for each language. Using Makefiles helps keep command execution consistent across languages.
1. Makefile in the Backend
-
This
Makefileis for Python withuv.# basic target .PHONY: run freeze test # Start FastAPI server run: uv run src/main.py # Update requirements.txt freeze: uv pip freeze > requirements.txt test: PYTHONPATH=./src uv run -m pytest
2. Makefile in the Frontend
-
This
Makefileis for React withnpm..PHONY: run install build install: npm ci build: npm run build run: npm run dev
3. Usage Examples
3.1 Backend (Python + uv)
-
Start the API server:
cd backend make run -
Update requirements.txt from the current environment.
cd backend make freeze
3.2 Frontend (React + npm)
-
Start the dev server:
cd frontend make run