A full-stack task management web application. The backend follows a 3-layer architecture (controllers, services, repositories) and the frontend is organized with the Bulletproof React feature-driven approach. The client, the API and PostgreSQL run in separate Docker containers, and every push to main is built, published to GitHub Container Registry and deployed to a VPS by a GitHub Actions pipeline.
- Authentication: registration, login and session persistence with JWT.
- Task management: create, view and delete tasks, and change their status (To Do / Completed).
- Protected routes:
ProtectedRouteandPublicRouteseparate guest pages from pages for signed-in users. - Centralized error handling: an error-handling middleware on the server and Axios interceptors on the client show consistent error messages to the user.
| Layer | Technologies |
|---|---|
| Frontend | React 18 (Vite), Zustand, React Router v6, Axios, CSS Modules |
| Backend | Node.js, Express.js, Prisma ORM |
| Database | PostgreSQL 15 |
| Security | JWT, bcrypt, Helmet, CORS |
| Validation | Joi / Zod middlewares |
| DevOps | Docker, Docker Compose, GitHub Actions, GitHub Container Registry (GHCR) |
Backend — 3-layer architecture with dependency injection
- Controllers handle HTTP requests and responses.
- Services contain the business logic.
- Repositories are the only layer that talks to the database (through Prisma).
Frontend — Bulletproof React (feature-driven structure)
- Code is grouped by feature rather than by file type.
- Zustand holds the global auth state.
- React Router layouts and outlets, together with
ProtectedRoute/PublicRoute, control access to pages. - A configured Axios instance with interceptors handles API calls and errors.
todo-list/
├── client/ # React (Vite) frontend
├── server/ # Node.js + Express backend
├── .github/workflows/ # CI/CD pipeline
├── docker-compose.yml # development setup (images are built locally)
└── docker-compose.prod.yml # production setup (images are pulled from GHCR)
Requirements: Docker with Docker Compose.
1. Clone the repository
git clone https://github.com/zrumyk/todo-list.git
cd todo-list2. Create a .env file in the project root
Both the database and the backend containers read their settings from this file:
# PostgreSQL container
POSTGRES_USER=todo_user
POSTGRES_PASSWORD=change_me
POSTGRES_DB=todo_db
# Backend (the database host is the Compose service name)
DATABASE_URL="postgresql://todo_user:change_me@postgres-db:5432/todo_db?schema=public"
JWT_SECRET="your_super_secret_jwt_key_here"3. Build and start the containers
docker compose up --build4. Sync the database schema (first run, in a second terminal)
docker compose exec backend npx prisma db push| Service | URL |
|---|---|
| Client | http://localhost:5173 |
| API | http://localhost:3000 |
| PostgreSQL | localhost:5432 |
Stop everything with:
docker compose downRequirements: Node.js and a running PostgreSQL instance.
1. Backend
cd server
npm installCreate a .env file in server/:
DATABASE_URL="postgresql://<user>:<password>@localhost:5432/todo_db?schema=public"
JWT_SECRET="your_super_secret_jwt_key_here"Sync the database schema and start the server:
npx prisma db push
npx prisma generate
npm run dev
# Server runs on http://localhost:30002. Frontend (in a new terminal)
cd client
npm install
npm run dev
# App runs on http://localhost:5173The pipeline is defined in .github/workflows/ci-cd.yml and runs on every push and pull request to main and dev. It consists of three jobs that run one after another:
- Test — installs the backend and frontend dependencies on Node.js 20, generates the Prisma client, runs ESLint for both the backend and the frontend, and runs the backend test script when one is defined.
- Build and push — builds the backend and frontend Docker images and publishes them to GitHub Container Registry (
ghcr.io/zrumyk/todo-list-backendandghcr.io/zrumyk/todo-list-frontend, taglatest). Runs only if the tests pass. - Deploy — connects to the VPS over SSH, pulls
docker-compose.prod.ymlfrom the repository, pulls the new images, restarts the containers withdocker compose up -d, syncs the database schema withprisma db pushand removes unused images.
On the server the pipeline keeps the compose file in ~/todo-app and expects a .env file next to it (same variables as in the development setup). The production client is served on port 80.
All credentials used by the pipeline (server access, registry token, frontend build variables) are stored as GitHub repository secrets and are never committed to the repository.