This repository contains:
- API (Django + PostgreSQL) in
api/(Dockerized) - Frontend (React + Vite) in
ui/(run natively)
- Docker & Docker Compose (for backend)
- Node.js 20+ & npm 9+ (for frontend)
- Build and start containers:
docker-compose up --build- API runs on:
http://localhost:8000 - Postgres (inside container) runs on:
db:5432 - Postgres mapped to host:
localhost:9220(to avoid conflicts with local Postgres)
- If you need to run migrations manually:
docker-compose run api python manage.py migrate- Stop containers:
docker-compose down- Go to the frontend folder:
cd ui- Install dependencies:
npm install- Start development server:
npm run dev- Frontend runs on:
http://localhost:5173
Note: Docker is not required for the frontend. Running natively is faster and avoids native module build issues.
- Backend: use
.envinsideapi/or set environment variables via Docker. Example:
POSTGRES_DB=mydb
POSTGRES_USER=myuser
POSTGRES_PASSWORD=mypassword
POSTGRES_HOST=db
POSTGRES_PORT=5432
- Frontend:
.envfiles inui/(e.g.,VITE_API_URL=http://localhost:8000)
-
Frontend: run locally with Node.js
-
Backend: run inside Docker to ensure consistent Postgres setup
-
Ports:
- Django API:
8000 - Postgres host port:
9220 - React Vite:
5173
- Django API:
-
To reset the database:
docker-compose down -v
docker-compose up --build