Skip to content

πŸš€ A modern, responsive full-stack todo application with deadline management, dark mode, and session-based authentication. Built with React, Node.js, Express, PostgreSQL, and Tailwind CSS.

Notifications You must be signed in to change notification settings

umerzafar4598/Full-Stack-Todo-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Full-Stack Todo Application

Todo App Banner

License: ISC Node.js React PostgreSQL PRs Welcome

A modern, responsive full-stack todo application with deadline management, dark mode, and session-based authentication.

Demo β€’ Features β€’ Installation β€’ Tech Stack β€’ Documentation


πŸ“Έ Screenshots

Dark Mode

Login Page
Dashboard - Dark Mode

✨ Features

🎨 Frontend Features

  • βœ… Modern UI/UX - Clean, intuitive interface built with Tailwind CSS
  • βœ… Dark/Light Theme - Toggle between themes with persistent storage
  • βœ… Fully Responsive - Optimized for mobile, tablet, and desktop
  • βœ… Real-time Updates - Instant UI feedback with optimistic updates
  • βœ… Advanced Search - Search todos by title or description
  • βœ… Smart Filtering - Filter by status (All, Pending, Completed, Overdue)
  • βœ… Beautiful Animations - Smooth transitions and loading states
  • βœ… Toast Notifications - React Hot Toast for user feedback
  • βœ… SweetAlert2 Dialogs - Beautiful confirmation dialogs

πŸ“… Deadline Management

  • πŸ”΄ Overdue - Red badge for past-deadline tasks
  • 🟠 Urgent - Orange badge for tasks due within 24 hours
  • 🟑 Soon - Yellow badge for tasks due within 7 days
  • πŸ”΅ Upcoming - Blue badge for tasks due later
  • 🟒 Completed - Green badge with strike-through text
  • βšͺ No Deadline - Gray badge for tasks without deadlines

πŸ” Backend Features

  • βœ… Session-based Authentication - Secure login with Passport.js
  • βœ… Password Hashing - bcrypt with salt rounds
  • βœ… RESTful API - Clean, organized endpoints
  • βœ… PostgreSQL Database - Robust data persistence
  • βœ… SQL Injection Protection - Parameterized queries
  • βœ… User Isolation - Users can only access their own todos
  • βœ… CORS Enabled - Secure cross-origin requests
  • βœ… Session Persistence - 7-day session expiry

πŸ“Š Statistics Dashboard

  • πŸ“ˆ Total Tasks - Count of all todos
  • βœ… Completed - Number of finished tasks
  • ⏳ Pending - Number of incomplete tasks
  • ⚠️ Overdue - Number of past-deadline tasks

πŸ› οΈ Tech Stack

Frontend

React Vite TailwindCSS React Router Axios

Backend

Node.js Express.js PostgreSQL Passport.js

Additional Libraries

  • lucide-react - Beautiful icons
  • react-hot-toast - Toast notifications
  • sweetalert2 - Beautiful alerts
  • bcrypt - Password hashing
  • connect-pg-simple - PostgreSQL session store
  • aos - Animations on Scroll
  • animate.css - Animation on appearances

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v16 or higher) - Download
  • PostgreSQL (v12 or higher) - Download
  • npm or yarn - Comes with Node.js
  • Git - Download

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/umerzafar4598/Full-Stack-Todo-App.git
cd todo-app

2. Database Setup

# Create PostgreSQL database
createdb todo_db

# Run the schema
cd backend
psql -d db_schema -f todo_schema.sql

3. Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Create environment file
cp .env

Backend .env Configuration:

PORT=5000
DATABASE_URL=postgresql://YOUR_USERNAME:YOUR_PASSWORD@localhost:5432/todo_db
SESSION_SECRET=change-this-to-a-random-secret-key-in-production
NODE_ENV=development

4. Frontend Setup

# Navigate to frontend directory (from project root)
cd frontend

# Install dependencies
npm install

# Create environment file (optional)
cp .env

Frontend .env Configuration:

VITE_API_URL=http://localhost:5000/api

5. Run the Application

Terminal 1 - Backend:

cd backend
npm run dev

βœ… Backend running on http://localhost:5000

Terminal 2 - Frontend:

cd frontend
npm run dev

βœ… Frontend running on http://localhost:5173

6. Access the Application

Open your browser and navigate to:

http://localhost:5173

Documentaions

πŸ”Œ API Endpoints

Authentication Endpoints

Method Endpoint Description Auth Required
POST /api/auth/register Register new user ❌
POST /api/auth/login Login user ❌
POST /api/auth/logout Logout user βœ…
GET /api/auth/me Get current user βœ…
GET /api/auth/status Check auth status ❌

Todo Endpoints

Method Endpoint Description Auth Required
GET /api/todos Get all todos βœ…
GET /api/todos/:id Get single todo βœ…
POST /api/todos Create new todo βœ…
PUT /api/todos/:id Update todo βœ…
PATCH /api/todos/:id/toggle Toggle completion βœ…
DELETE /api/todos/:id Delete todo βœ…
GET /api/todos/stats/overview Get statistics βœ…

🎯 Usage Guide

Creating a Todo

  1. Click the "Add Todo" button
  2. Enter a title (required)
  3. Add a description (optional)
  4. Set a deadline (optional)
  5. Click "Create"

Editing a Todo

  1. Click the edit icon (✏️) on any todo
  2. Modify the fields
  3. Click "Update"

Deleting a Todo

  1. Click the delete icon (πŸ—‘οΈ) on any todo
  2. Confirm deletion in the SweetAlert2 dialog
  3. Todo is permanently removed

Marking as Complete

  1. Click the checkbox on any todo
  2. Todo is marked as complete/incomplete

Searching Todos

  1. Type in the search box
  2. Results filter in real-time

Filtering Todos

  1. Use the dropdown menu
  2. Select: All, Pending, Completed, or Overdue

Theme Toggle

  1. Click the sun/moon icon in the header
  2. Theme switches and saves automatically

πŸ”’ Security Features

  • βœ… Password Hashing - bcrypt with 10 salt rounds
  • βœ… Session Security - HTTP-only cookies, secure flags
  • βœ… SQL Injection Protection - Parameterized queries with whitelisted fields
  • βœ… XSS Protection - React's built-in sanitization
  • βœ… CORS Protection - Configured allowed origins
  • βœ… User Isolation - Users can only access their data
  • βœ… Input Validation - Client and server-side validation

πŸ§ͺ Testing the Application

Manual Testing Checklist

Authentication:

  • Register a new account
  • Login with credentials
  • Access protected routes
  • Logout successfully

Todo Operations:

  • Create a todo
  • Create a todo with deadline
  • Edit a todo
  • Mark todo as complete
  • Delete a todo
  • Search todos
  • Filter todos

UI/UX:

  • Toggle theme (dark/light)
  • Test on mobile device
  • Test all responsive breakpoints
  • Check all animations

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ› Known Issues


πŸ“ License

This project is licensed under the ISC License.


πŸ‘€ Author

Author Information


πŸ™ Acknowledgments


Made with ❀️ and β˜•

⭐ Star this repo if you find it helpful!

About

πŸš€ A modern, responsive full-stack todo application with deadline management, dark mode, and session-based authentication. Built with React, Node.js, Express, PostgreSQL, and Tailwind CSS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published