This is a fully containerized full-stack Notes Application built using:
- FastAPI (Backend)
- React + Vite (Frontend)
- PostgreSQL (Database)
- Alembic (Migrations)
- Docker + Docker Compose (Environment Orchestration)
- Traefik (Reverse Proxy / Routing)
Live Deployment: https://notes-app.rajsekharde.com
- User authentication (with JWT tokens + Cookies)
- Create / Read / Update / Delete notes
- Persistent PostgreSQL storage
- Reverse proxy & HTTPS using Traefik
- Dockerized frontend, backend, database
- Orchestration using Docker Compose
- Automatic Alembic migrations
- Deployed using AWS EC2 + CloudFlare DNS
Make sure Docker Desktop is running.
Create a .env file in root project folder. Add the following variables:
POSTGRES_USER=username
POSTGRES_PASSWORD=password
POSTGRES_DB=notes_db
SECRET_KEY=any_random_string
ACCESS_TOKEN_EXPIRE_MINS=10
REFRESH_TOKEN_EXPIRE_DAYS=7
ADMIN_PASSWORD=12345 # Use it to login using Admin Email- [email protected]
DATABASE_URL=postgresql+psycopg2://username:password@db:5432/notes_db
FRONTEND_URL=http://localhost
BACKEND_PORT=8000Then run in root folder terminal:
docker compose -f docker-compose.yml -f traefik.dev.yml up --build -dFrontend: http://localhost:8080
Backend API: http://localhost:8080/api
Healthcheck: http://localhost:8080/api/health
Shut down the App & containers using:
docker compose downLaunch an EC2 instance with Ubuntu 22.04
Add a new DNS record to your domain:
Type: A
Content: <Public IPv4 address of ec2 Instance>Clone repository
Change .yml scripts to include your sub-domain name and email.
SSH into the instance
Install docker, docker-compose, git
Make a new directory:
mkdir Notes-App
cd Notes-AppClone Git repo to EC2 instance:
git clone https://github.com/rajsekharde/Notes-App.git
cd Notes-AppCreate .env file:
nano .envCreate the same environment variables mentioned in the beginning. Then:
Ctrl + O
Enter
Ctrl + XBuild docker containers:
docker compose -f docker-compose.yml -f traefik.prod.yml up --build -dOpen your URL in a browser
Check status of containers & backend logs:
docker ps
docker logs -f notes_backendTo stop the containers:
docker compose down/frontend → React app (served by Nginx)
/backend → FastAPI app
docker-compose.yml
traefik.dev.yml
traefik.prod.yml
.env
FastAPI
React (Vite)
PostgreSQL
SQLModel
Alembic
Traefik
Docker
AWS
CI/CD with GitHub Actions
MIT