A simple full stack web application to create, archive, and filter notes.
Developed as a technical exercise following the provided specifications.
- Frontend: React + Vite (Node.js 20.x, npm 10.x)
- Backend: NestJS + Prisma (Node.js 20.x)
- Database: PostgreSQL 16
- ORM: Prisma
- Containerization: Docker 24+, Docker Compose
.
├── backend/ # NestJS app (controllers, services, repositories)
│ ├── prisma/ # schema.prisma and migrations
│ └── Dockerfile
├── frontend/ # React + Vite SPA
│ └── Dockerfile
├── docker-compose.yml
├── run.sh # one-command runner
└── README.md
chmod +x run.sh
./run.shThe script will:
- Create a default
.envfile if missing. - Start PostgreSQL and wait until it is healthy.
- Apply Prisma migrations automatically.
- Start the backend API and the frontend SPA.
- Open the app in your browser at http://localhost:8080.
- Stream logs (press Ctrl+C to stop, which also shuts down the stack).
Defaults are created by run.sh:
POSTGRES_USER=notes_user
POSTGRES_PASSWORD=notes_pass
POSTGRES_DB=notes_db
API_PORT=4000
WEB_PORT=8080
- Backend connects to:
postgresql://notes_user:notes_pass@db:5432/notes_db?schema=public - Frontend is built with:
VITE_API_BASE=http://localhost:4000/api
- DB:
pg_isready - API:
GET /health→200 { "status": "ok" } - Frontend: responds on port 80 inside container (mapped to 8080)
- Create, edit, and delete notes.
- Archive and unarchive notes.
- List active notes.
- List archived notes.
- Add/remove categories (tags) to notes.
- Filter notes by category.
Base URL: http://localhost:4000/api
Phase 1:
POST /notes→ create a noteGET /notes→ list notes (?archived=true|falseoptional)PATCH /notes/:id→ update a noteDELETE /notes/:id→ delete a notePATCH /notes/:id/archive→ archivePATCH /notes/:id/unarchive→ unarchive
Phase 2:
POST /categories→ create categoryGET /categories→ list categoriesPOST /notes/:id/categories/:categoryId→ add category to noteDELETE /notes/:id/categories/:categoryId→ remove category from noteGET /notes?categoryIds=1,2→ filter notes by categories
- Prisma manages the schema and migrations.
- Migrations are automatically applied at container startup (
prisma migrate deploy). - For local development (without Docker):
cd backend npm install npx prisma generate npx prisma migrate dev npm run start:dev
- SPA separated in
frontend/ - Backend REST API in
backend/with layered architecture - Persistence with relational DB and ORM (Postgres + Prisma)
- One-command runner (
./run.sh) - README with runtimes and versions
- Phase 1: notes CRUD + archive/unarchive
- Phase 2: categories and filtering
- Optional login documented
- Optional live deployment