A complete task management application with user authentication, built with React + TypeScript on the frontend and Node.js + Express + PostgreSQL on the backend.
- ✅ User Authentication (Register and Login)
- ✅ Create Tasks with title, description and due date
- ✅ List Tasks for the authenticated user
- ✅ Mark Tasks as Complete/Incomplete
- ✅ Delete Tasks
- ✅ Responsive Interface with Tailwind CSS
todo-app/
├── client/ # Frontend React + TypeScript
├── server/ # Backend Node.js + Express
├── package.json # Root package.json with unified scripts
└── README.md
- Node.js (version 16 or higher)
- PostgreSQL
- npm or yarn
# Install all dependencies (root, client, and server)
npm run install:allCreate a PostgreSQL database and run the following SQL:
CREATE DATABASE todo_app;
-- Users table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Tasks table
CREATE TABLE tasks (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
title VARCHAR(255) NOT NULL,
description TEXT,
completed BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
due_date DATE
);Create a .env file in the server/ folder:
DATABASE_URL=postgresql://username:password@localhost:5432/todo_app
JWT_SECRET=your_jwt_secret_key_here
PORT=5000# Run both frontend and backend in development mode
npm run dev- Frontend:
http://localhost:5173(Vite dev server) - Backend:
http://localhost:5000(Nodemon with hot reload)
# Build both frontend and backend for production
npm run build- Compiles TypeScript to JavaScript
- Creates optimized production bundles
- Outputs to
client/dist/andserver/dist/
# Run the final production version
npm run start- Frontend:
http://localhost:4173(Vite preview server) - Backend:
http://localhost:5000(Node.js production server)
npm run dev:client- Run only frontend in developmentnpm run dev:server- Run only backend in developmentnpm run build:client- Build only frontendnpm run build:server- Build only backendnpm run start:client- Run only frontend in productionnpm run start:server- Run only backend in production
- Register: Create a new account with email and password
- Login: Sign in with your credentials
- Create Tasks: Use the form to add new tasks
- Manage Tasks:
- Click "Complete" to mark as done
- Click "Undo" to unmark
- Click "Delete" to remove
- Logout: Click the red button to sign out
- React 19
- TypeScript
- Vite
- Tailwind CSS
- React Router
- Node.js
- Express.js
- TypeScript
- PostgreSQL
- JWT for authentication
- bcrypt for password hashing
POST /auth/register- User registrationPOST /auth/login- User login
GET /tasks- List user's tasksPOST /tasks- Create new taskPUT /tasks/:id- Update taskDELETE /tasks/:id- Delete task
- Passwords are hashed with bcrypt
- JWT authentication to protect routes
- Data validation on backend
- Task ownership verification (each user only sees their own tasks)
- Filters by status (complete/pending)
- Sort by date
- Categories/tags for tasks
- Notifications for overdue tasks
- Interface to edit existing tasks