server.js
Entry point: initializes Express app, middleware, and starts the HTTP server
config/db.js
PostgreSQL connection pool setup using pg library with Neon connection string
config/jwt.js
JWT secret config and helper functions for signing and verifying tokens
middleware/auth.js
Express middleware to validate JWT from Authorization header and attach user to req
middleware/errorHandler.js
Global error handling middleware that returns consistent JSON error responses
routes/auth.js
Auth routes: POST /auth/register and POST /auth/login
routes/projects.js
CRUD routes for projects: GET, POST, PUT, DELETE /projects and /projects/:id
routes/tasks.js
CRUD routes for tasks nested under projects: /projects/:projectId/tasks and /tasks/:id
controllers/authController.js
Handles user registration with bcrypt password hashing and login with JWT issuance
controllers/projectsController.js
Business logic for creating, reading, updating, and deleting projects scoped to authenticated user
controllers/tasksController.js
Business logic for managing tasks including due date handling and completion toggling
models/userModel.js
SQL queries for user creation and lookup by email
models/projectModel.js
SQL queries for project CRUD operations filtered by owner user_id
models/taskModel.js
SQL queries for task CRUD operations including filtering by project and completion status
db/migrations/001_create_users.sql
SQL migration to create the users table with id, email, password_hash, created_at
db/migrations/002_create_projects.sql
SQL migration to create the projects table with id, user_id FK, name, description, created_at
db/migrations/003_create_tasks.sql
SQL migration to create the tasks table with id, project_id FK, title, due_date, is_complete, created_at
db/seed.js
Optional seed script to insert sample users, projects, and tasks for development testing
.env.example
Template for required environment variables: DATABASE_URL, JWT_SECRET, PORT
package.json
Project dependencies and npm scripts for start, dev (nodemon), and migrate
README.md
API documentation listing all endpoints, request/response shapes, and setup instructions