Thanks to visit codestin.com
Credit goes to github.com

Skip to content

rajsekharde/Notes-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Full Stack Notes App (FastAPI + React + PostgreSQL + Docker + Traefik)

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

Architecture Diagram:

Login Page:

Notes Page:

Admin Dashbaord:


Features

  • 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

Running the App (Local)

1. Install Docker & Docker Compose

Make sure Docker Desktop is running.

2. Start the whole stack

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=8000

Then run in root folder terminal:

docker compose -f docker-compose.yml -f traefik.dev.yml up --build -d

3. Access the App

Frontend: http://localhost:8080

Backend API: http://localhost:8080/api

Healthcheck: http://localhost:8080/api/health

Shut down the App & containers using:

docker compose down

Deploying to AWS EC2 Instance:

Launch 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-App

Clone Git repo to EC2 instance:

git clone https://github.com/rajsekharde/Notes-App.git
cd Notes-App

Create .env file:

nano .env

Create the same environment variables mentioned in the beginning. Then:

Ctrl + O
Enter
Ctrl + X

Build docker containers:

docker compose -f docker-compose.yml -f traefik.prod.yml up --build -d

Open your URL in a browser

Check status of containers & backend logs:

docker ps
docker logs -f notes_backend

To stop the containers:

docker compose down

Project Structure

/frontend → React app (served by Nginx)

/backend → FastAPI app

docker-compose.yml

traefik.dev.yml

traefik.prod.yml

.env


Technologies

FastAPI

React (Vite)

PostgreSQL

SQLModel

Alembic

Traefik

Docker

AWS


Future Plans

CI/CD with GitHub Actions


License

MIT


About

A full stack CRUD app built with React, FastAPI, PostgreSQL

Resources

Stars

Watchers

Forks

Packages

No packages published