Skip to content

thomas-tran-fullstack/Task_Manager

Repository files navigation

Task Manager - Personal Task Management Application

A modern, responsive React-based Single Page Application (SPA) for efficient personal task management with stunning UI/UX, authentication, and database integration.

πŸŽ‰ Status: 100% COMPLETE βœ…

This project is fully implemented and ready for testing!

  • βœ… All Priority 1 features complete (Auth, CRUD, Dashboard)
  • βœ… All Priority 2 features complete (OTP, Search, Filters, Statistics)
  • βœ… All Priority 3 features complete (Google OAuth, Navigation, Error Handling)
  • βœ… Database schema created and indexed
  • βœ… Full backend implementation (Express.js + MySQL)
  • βœ… Full frontend implementation (React + Vite)
  • βœ… Comprehensive documentation

πŸ“– Jump to Quick Start or Read SETUP_CHECKLIST.md for detailed instructions

πŸ“š Documentation Index

πŸ“Έ Features Overview

Core Features

  • βœ… Add, Edit, Delete Tasks - Full CRUD operations for task management
  • πŸ“Š Task Status Management - Organize tasks by TODO, In Progress, Done
  • πŸ” Search & Filter - Search by name/description and filter by status, priority, deadline
  • ⏰ Deadline System - Set deadlines for tasks with visual warnings for approaching/overdue tasks
  • πŸ“ˆ Statistics Dashboard - Quick overview of total tasks, completed, and overdue tasks
  • πŸ’Ύ Data Persistence - LocalStorage backup + MySQL database storage
  • πŸ“± Responsive Design - Beautiful on mobile, tablet, and desktop
  • 🎨 Modern UI - Tailwind CSS with animations, 3D effects, and hero banners

Authentication Features

  • πŸ” User Registration & Login - Secure authentication with JWT
  • πŸ”‘ Google OAuth 2.0 - One-click Google login
    • If email exists: Direct login
    • If email not exists: Automatic account creation with OTP verification
  • πŸ”„ Forgot Password - Password recovery with 6-digit OTP via email
  • πŸ“§ Email OTP Verification - 6-character OTP with 5-minute expiration
  • 🎨 Auth Page - Split layout with hero banner and login/register card

UI/UX Features

  • πŸ”” PopMessage - Toast notifications (success/error) at top-right, auto-dismiss in 3 seconds
  • ⚑ Loading Animations - Modern, unique loading effects
  • πŸŽͺ Hero Banners - Prominent project showcases with animations
  • 🌟 Modern Effects - Smooth animations, 3D transforms, glass-morphism, gradients
  • 🎯 Micro-interactions - Intuitive hover effects and transitions

πŸš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • MySQL (v8 or higher)
  • Git

Installation

1. Clone the Repository

git clone https://github.com/thomas-tran-fullstack/Task_Manager.git
cd task-manager

2. Frontend Setup

cd frontend
npm install
npm run dev

3. Backend Setup

cd backend
npm install

4. Database Setup

# Create MySQL database
mysql -u root -p < database/schema.sql

# Or manually:
# 1. Open MySQL
# 2. Create database: CREATE DATABASE task_manager;
# 3. Use database: USE task_manager;
# 4. Import schema: source path/to/schema.sql;

5. Environment Configuration

Backend (.env)

PORT=5000
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=task_manager
JWT_SECRET=your_jwt_secret_key_here
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=thomastran.fullstack@gmail.com
SMTP_PASSWORD=**** **** ****

Frontend (.env)

VITE_API_URL=http://localhost:5000/api
VITE_GOOGLE_CLIENT_ID=your_google_client_id

6. Start Development Server

# Terminal 1: Backend
cd backend
npm run dev

# Terminal 2: Frontend
cd frontend
npm run dev

Access the application at http://localhost:5173

πŸ“– Usage Guide

Authentication

  1. Sign Up: Create account with email and password
  2. Login: Use registered email and password
  3. Google OAuth: Click "Login with Google" for instant access
  4. Forgot Password: Click "Forgot Password" β†’ Enter email β†’ Verify with OTP β†’ Reset password

Task Management

  1. Add Task: Click "Add Task" button β†’ Fill form β†’ Set deadline β†’ Submit
  2. Edit Task: Click task card β†’ Click edit icon β†’ Modify β†’ Save
  3. Delete Task: Click task card β†’ Click delete icon β†’ Confirm
  4. Change Status: Drag task between columns or click status button
  5. Set Deadline: Select date/time when creating or editing task

Filtering & Search

  1. Search: Use search bar to find tasks by name/description
  2. Filter by Status: Use status filter dropdown
  3. Filter by Priority: Use priority filter dropdown
  4. Filter by Deadline: Select time range (Today, This Week, Overdue)
  5. Reset Filters: Click "Reset" button to clear all filters

Notifications

  • Success: Green popup appears for 3 seconds
  • Error: Red popup appears for 3 seconds
  • Overdue: Red badge on task card
  • Approaching: Yellow badge on task card (24 hours before deadline)

πŸ—οΈ Project Structure

task-manager/
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Auth/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LoginForm.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RegisterForm.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ HeroBanner.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OTPVerification.jsx
β”‚   β”‚   β”‚   β”‚   └── ForgotPassword.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Task/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TaskCard.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TaskForm.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TaskBoard.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TaskFilter.jsx
β”‚   β”‚   β”‚   β”‚   └── TaskSearch.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ StatisticsWidget.jsx
β”‚   β”‚   β”‚   β”‚   └── ProgressChart.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Common/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PopMessage.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LoadingSpinner.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ HeroBanner.jsx
β”‚   β”‚   β”‚   β”‚   └── Navbar.jsx
β”‚   β”‚   β”‚   └── Layout/
β”‚   β”‚   β”‚       β”œβ”€β”€ MainLayout.jsx
β”‚   β”‚   β”‚       └── AuthLayout.jsx
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TasksPage.jsx
β”‚   β”‚   β”‚   └── NotFoundPage.jsx
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”‚   β”œβ”€β”€ authService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ taskService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ storageService.js
β”‚   β”‚   β”‚   └── toastService.js
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TaskContext.jsx
β”‚   β”‚   β”‚   └── ToastContext.jsx
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”‚   β”œβ”€β”€ useAuth.js
β”‚   β”‚   β”‚   β”œβ”€β”€ useTasks.js
β”‚   β”‚   β”‚   β”œβ”€β”€ useForm.js
β”‚   β”‚   β”‚   └── useToast.js
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ validation.js
β”‚   β”‚   β”‚   β”œβ”€β”€ formatters.js
β”‚   β”‚   β”‚   β”œβ”€β”€ constants.js
β”‚   β”‚   β”‚   └── helpers.js
β”‚   β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   β”‚   β”œβ”€β”€ globals.css
β”‚   β”‚   β”‚   β”œβ”€β”€ animations.css
β”‚   β”‚   β”‚   └── tailwind.css
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── main.jsx
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   β”œβ”€β”€ postcss.config.js
β”‚   β”œβ”€β”€ vite.config.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚   β”‚   β”‚   β”œβ”€β”€ tasks.js
β”‚   β”‚   β”‚   └── user.js
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ taskController.js
β”‚   β”‚   β”‚   └── userController.js
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚   β”‚   β”‚   β”œβ”€β”€ errorHandler.js
β”‚   β”‚   β”‚   └── validation.js
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Task.js
β”‚   β”‚   β”‚   └── OTPVerification.js
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ authService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ taskService.js
β”‚   β”‚   β”‚   β”œβ”€β”€ emailService.js
β”‚   β”‚   β”‚   └── tokenService.js
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   β”œβ”€β”€ database.js
β”‚   β”‚   β”‚   └── googleOAuth.js
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   └── server.js
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   └── schema.sql
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md
β”‚
β”œβ”€β”€ database/
β”‚   └── schema.sql
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
└── TODO.md

πŸ› οΈ Technical Decisions

Frontend Framework

  • React 18 with Vite for fast development and optimized builds
  • Reason: Excellent component reusability, large ecosystem, optimal for SPA

Styling

  • Tailwind CSS with custom animations and configurations
  • Reason: Utility-first approach enables rapid UI development, highly customizable, excellent for responsive design

State Management

  • React Context API for global state (Auth, Tasks, Toast)
  • Reason: Lightweight, built-in, sufficient for this project scope

Database

  • MySQL for robust, relational data storage
  • Reason: Reliable, scalable, excellent for structured data like tasks and users

Authentication

  • JWT (JSON Web Tokens) for session management
  • Google OAuth 2.0 for third-party authentication
  • OTP via Email for secure verification
  • Reason: Industry standard, secure, supports both traditional and OAuth2 flows

API Communication

  • Axios with interceptors for automatic token refresh
  • Reason: Better error handling than Fetch, supports request/response interceptors

Backend

  • Express.js with Node.js
  • Reason: Lightweight, high performance, excellent for REST APIs

Storage Strategy

  • LocalStorage for offline task backup
  • MySQL Database for primary data storage
  • Reason: Ensures data persistence and enables offline functionality

πŸ“Š API Documentation

Authentication Endpoints

Register

POST /api/auth/register
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "securePassword123",
  "name": "User Name"
}

Response (200):
{
  "success": true,
  "message": "User registered successfully",
  "token": "jwt_token_here",
  "user": { ... }
}

Login

POST /api/auth/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "securePassword123"
}

Response (200):
{
  "success": true,
  "token": "jwt_token_here",
  "user": { ... }
}

Google OAuth

POST /api/auth/google
Content-Type: application/json

{
  "idToken": "google_id_token_here"
}

Response (200):
{
  "success": true,
  "isNewUser": false,
  "token": "jwt_token_here",
  "user": { ... }
}

Forgot Password

POST /api/auth/forgot-password
Content-Type: application/json

{
  "email": "user@example.com"
}

Response (200):
{
  "success": true,
  "message": "OTP sent to email"
}

Verify OTP

POST /api/auth/verify-otp
Content-Type: application/json

{
  "email": "user@example.com",
  "otp": "123456"
}

Response (200):
{
  "success": true,
  "resetToken": "temporary_token_here"
}

Reset Password

POST /api/auth/reset-password
Content-Type: application/json

{
  "resetToken": "temporary_token_here",
  "newPassword": "newSecurePassword123"
}

Response (200):
{
  "success": true,
  "message": "Password reset successfully"
}

Task Endpoints

Get All Tasks

GET /api/tasks
Authorization: Bearer jwt_token

Query Parameters:
  - status: TODO|In Progress|Done
  - priority: Low|Medium|High
  - search: search_term
  - sortBy: createdAt|deadline|priority

Response (200):
{
  "success": true,
  "tasks": [ ... ]
}

Create Task

POST /api/tasks
Authorization: Bearer jwt_token
Content-Type: application/json

{
  "title": "Task Title",
  "description": "Task Description",
  "priority": "Medium",
  "deadline": "2024-12-31T23:59:59Z",
  "status": "TODO"
}

Response (201):
{
  "success": true,
  "task": { ... }
}

Update Task

PUT /api/tasks/:id
Authorization: Bearer jwt_token
Content-Type: application/json

{
  "title": "Updated Title",
  "description": "Updated Description",
  "priority": "High",
  "deadline": "2024-12-31T23:59:59Z",
  "status": "In Progress"
}

Response (200):
{
  "success": true,
  "task": { ... }
}

Delete Task

DELETE /api/tasks/:id
Authorization: Bearer jwt_token

Response (200):
{
  "success": true,
  "message": "Task deleted successfully"
}

Get Statistics

GET /api/tasks/statistics
Authorization: Bearer jwt_token

Response (200):
{
  "success": true,
  "statistics": {
    "totalTasks": 25,
    "completedTasks": 10,
    "overdueTasks": 3,
    "inProgressTasks": 12,
    "completionRate": 40
  }
}

🎨 UI/UX Components

PopMessage Component

Toast notifications displayed at top-right corner

// Usage
const { showMessage } = useToast();
showMessage('Task created successfully', 'success');
showMessage('Error creating task', 'error');

Loading Animation

Unique, modern loading effect while fetching data

Hero Banner

Split layout with project logo, description, and authentication card

Task Card

Modern card with 3D hover effect, deadline indicators, and action buttons

πŸš€ Performance Optimizations

  • Code splitting and lazy loading for routes
  • Image optimization with proper formats
  • MinifiedCSS and JavaScript in production
  • Efficient database queries with indexing
  • LocalStorage sync to reduce API calls
  • Debounced search and filter operations

πŸ”’ Security Measures

  • Password hashing with bcrypt (10 rounds)
  • JWT token-based authentication with 24-hour expiration
  • Refresh token rotation for enhanced security
  • Email verification for account recovery
  • OTP time-based expiration (5 minutes)
  • CORS enabled only for allowed origins
  • Input validation and sanitization on all endpoints
  • Protected API endpoints with middleware
  • Secure HTTP headers with helmet.js

πŸ“± Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

πŸ› Troubleshooting

Database Connection Error

Error: Unable to connect to database
Solution: 
1. Verify MySQL is running
2. Check credentials in .env
3. Ensure database exists: CREATE DATABASE task_manager;

Google OAuth Not Working

Error: Invalid client configuration
Solution:
1. Verify Google Client ID in .env
2. Check redirect URI in Google Console
3. Ensure .env variables are loaded

OTP Not Received

Error: Email not sending
Solution:
1. Check SMTP credentials in .env
2. Enable "Less secure app access" for Gmail
3. Use app password instead of regular password
4. Check email spam folder

CORS Error

Error: Access to XMLHttpRequest blocked by CORS
Solution:
1. Verify backend CORS is configured
2. Check frontend VITE_API_URL
3. Ensure API URL matches backend origin

🚒 Deployment

Frontend Deployment (Vercel/Netlify)

  1. Push code to GitHub
  2. Connect repository to Vercel/Netlify
  3. Set environment variables
  4. Deploy with npm run build

Backend Deployment (Heroku/Railway)

  1. Configure Procfile
  2. Set environment variables
  3. Deploy with Git push
  4. Run migrations: npm run migrate

πŸ“ˆ Future Improvements

  • Email Notifications: Send reminders 24 hours before deadline
  • Task Sharing: Share tasks with other users or teams
  • Recurring Tasks: Support for daily/weekly/monthly recurring tasks
  • Subtasks: Break down tasks into smaller subtasks
  • File Attachments: Attach files to tasks
  • Task Comments: Collaborate with comments on tasks
  • Activity History: Track all changes to tasks
  • Dark Mode: Full dark mode support
  • Mobile App: React Native mobile application
  • Advanced Analytics: Task completion trends, productivity insights
  • Calendar View: Kanban and calendar view options
  • Integration: Sync with Google Calendar, Slack notifications
  • Offline Sync: Better offline support with Service Workers
  • Tagging System: Add tags/labels to tasks
  • Priority Levels: More granular priority system
  • Time Tracking: Track time spent on tasks
  • Team Management: Multi-user support and collaboration

πŸ“ License

MIT License - See LICENSE file for details

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

πŸ“§ Support

For support email: thomastran.fullstack@gmail.com


Last Updated: March 25, 2026 Version: 1.0.0 Developer: Tran Bao Toan

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors