Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jitrodriguez/notes-app-fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

20 Commits

Repository files navigation

Notes App β€” Full Stack Implementation

A simple full stack web application to create, archive, and filter notes.
Developed as a technical exercise following the provided specifications.


πŸš€ Tech Stack

  • 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

πŸ“‚ Repository Structure

.
β”œβ”€β”€ 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

▢️ Running the Application

One Command

chmod +x run.sh
./run.sh

The script will:

  • Create a default .env file 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).

βš™οΈ Environment Variables

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

βœ… Healthchecks

  • DB: pg_isready
  • API: GET /health β†’ 200 { "status": "ok" }
  • Frontend: responds on port 80 inside container (mapped to 8080)

πŸ“– Features

Phase 1

  • Create, edit, and delete notes.
  • Archive and unarchive notes.
  • List active notes.
  • List archived notes.

Phase 2

  • Add/remove categories (tags) to notes.
  • Filter notes by category.

πŸ”Œ API Endpoints

Base URL: http://localhost:4000/api

Phase 1:

  • POST /notes β†’ create a note
  • GET /notes β†’ list notes (?archived=true|false optional)
  • PATCH /notes/:id β†’ update a note
  • DELETE /notes/:id β†’ delete a note
  • PATCH /notes/:id/archive β†’ archive
  • PATCH /notes/:id/unarchive β†’ unarchive

Phase 2:

  • POST /categories β†’ create category
  • GET /categories β†’ list categories
  • POST /notes/:id/categories/:categoryId β†’ add category to note
  • DELETE /notes/:id/categories/:categoryId β†’ remove category from note
  • GET /notes?categoryIds=1,2 β†’ filter notes by categories

πŸ—„οΈ Database & ORM

  • 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

βœ… Challenge Checklist

  • 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

About

A simple notes app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /