A modern, full-stack task management application with JWT authentication, built with React (frontend) and Node.js/Express with PostgreSQL (backend). Features a beautiful, responsive UI with real-time notifications and professional animations.
- π JWT Authentication: Secure user registration and login with bcrypt password hashing
- π Dashboard: Visual overview with interactive charts (pie chart, bar chart) and task statistics
- β My Tasks: Full CRUD operations with priority levels, due dates, and status tracking
- π Calendar: View tasks organized by due dates
- π Notifications: Real-time toast notifications for all user actions
- π Reports: Analytics and productivity insights with visual charts
- βοΈ Settings: Manage profile, password, and preferences
- β Help: FAQ and support information
- π¨ Modern Design: Clean, professional interface with green color palette
- π± Fully Responsive: Optimized for mobile, tablet, desktop, and large screens
- β¨ Smooth Animations: Page transitions, hover effects, and micro-interactions
- π Toast Notifications: Beautiful, auto-dismissing notifications for actions
- β¨οΈ Keyboard Friendly: Intuitive keyboard shortcuts
- π Dark Mode Ready: Architecture supports theme switching
- Create, edit, and delete tasks instantly
- Mark tasks as complete/pending with one click
- Set priority levels (High, Medium, Low)
- Add due dates with calendar picker
- Rich task descriptions
- Quick add task functionality
- Task filtering by status
- React 19 - UI framework
- React Router DOM - Client-side routing
- Lucide React - Beautiful icon library
- Fetch API - HTTP requests
- Vite - Build tool and dev server
- Node.js - Runtime environment
- Express - Web framework
- PostgreSQL - Primary database
- pg - PostgreSQL client
- JWT (jsonwebtoken) - Authentication tokens
- bcryptjs - Password hashing
- Node.js 18+ installed
- PostgreSQL installed and running (or use a cloud provider like Neon, Supabase, or Render)
- pnpm (recommended) or npm
-
Create the database:
createdb TaskManagerDB
Or using psql:
CREATE DATABASE "TaskManagerDB";
-
Run the schema script:
# Navigate to server directory cd server # Run the schema psql -U your_username -d TaskManagerDB -f schema.sql
-
Update database credentials:
Edit
server/.envwith your PostgreSQL credentials:DATABASE_URL=postgresql://username:password@localhost:5432/TaskManagerDB # Or use individual settings: DB_HOST=postgresql://username:password@localhost:5432/TaskManagerDB DB_DATABASE=TaskManagerDB DB_USER=username DB_PASSWORD=your_password DB_PORT=5432
-
Clone the repository:
git clone <repository-url> cd Task-manager
-
Install frontend dependencies:
pnpm install
-
Install backend dependencies:
cd server pnpm install cd ..
-
Ensure PostgreSQL is running on your machine
-
Start the backend server:
cd server pnpm startThe API will run on
http://localhost:5000(or your configured PORT) -
Start the frontend (in a new terminal):
pnpm run dev
The app will run on
http://localhost:5173 -
Open your browser and navigate to
http://localhost:5173
- Sign Up: Create a new account at
/signup - Login: Sign in at
/login - Dashboard: View your task overview with interactive charts
- My Tasks: Create, edit, delete, and organize tasks
- Calendar: View tasks by due date
- Reports: View productivity analytics and insights
- Settings: Update your profile and preferences
- Help: Find answers to common questions
- Click the checkbox to mark tasks complete/incomplete
- Use the edit button (βοΈ) to modify tasks
- Click the delete button (ποΈ) with confirmation dialog
- Toast notifications confirm all actions
- Responsive design works on all screen sizes
- Push code to GitHub
- Connect repository to Vercel
- Set environment variables
- Deploy automatically on push
- Create new Web Service
- Connect GitHub repository
- Set build command:
cd server && pnpm install - Set start command:
cd server && pnpm start - Add PostgreSQL database
- Configure environment variables
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login user |
| GET | /api/auth/profile |
Get user profile (protected) |
| PUT | /api/auth/profile |
Update user profile (protected) |
| PUT | /api/auth/change-password |
Change password (protected) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tasks |
Get all tasks (protected) |
| GET | /api/tasks/:id |
Get single task (protected) |
| POST | /api/tasks |
Create new task (protected) |
| PUT | /api/tasks/:id |
Update task (protected) |
| DELETE | /api/tasks/:id |
Delete task (protected) |
| GET | /api/tasks/stats/summary |
Get task statistics (protected) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/notifications |
Get all notifications (protected) |
| PUT | /api/notifications/:id/read |
Mark notification as read (protected) |
| PUT | /api/notifications/read-all |
Mark all as read (protected) |
| DELETE | /api/notifications/:id |
Delete notification (protected) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/reports/dashboard |
Get dashboard statistics (protected) |
| GET | /api/reports/activity |
Get activity history (protected) |
| GET | /api/reports/calendar |
Get calendar data (protected) |
Task-manager/
βββ src/ # Frontend React code
β βββ components/ # Reusable components
β β βββ sidebar/ # Sidebar navigation
β β βββ ProtectedRoute.jsx # Auth route protection
β βββ context/ # React Context
β β βββ AuthContext.jsx # Authentication state
β β βββ ToastContext.jsx # Toast notifications
β βββ pages/ # Page components
β β βββ Dashboard/ # Main dashboard with charts
β β βββ Login/ # Login page
β β βββ SignUp/ # Registration page
β β βββ Notifications/ # Notifications center
β β βββ MyTasks/ # Task management
β β βββ Calendar/ # Calendar view
β β βββ Reports/ # Analytics & reports
β β βββ Help/ # Help & support
β β βββ Settings/ # User settings
β βββ services/ # API services
β β βββ api.js # API client
β βββ App.jsx # Main app component
βββ server/ # Backend Node.js code
β βββ routes/ # API routes
β β βββ auth.js # Authentication routes
β β βββ tasks.js # Task CRUD routes
β β βββ notifications.js # Notification routes
β β βββ reports.js # Report/analytics routes
β βββ middleware/ # Express middleware
β β βββ auth.js # JWT verification
β βββ db.js # Database connection
β βββ index.js # Server entry point
β βββ schema.sql # Database schema
β βββ .env # Environment variables
βββ package.json # Frontend dependencies
users
id(SERIAL PRIMARY KEY)name(VARCHAR(255))email(VARCHAR(255), UNIQUE)password(VARCHAR(255))created_at(TIMESTAMP)updated_at(TIMESTAMP)
tasks
id(SERIAL PRIMARY KEY)user_id(INTEGER, FK β users)title(VARCHAR(500))description(TEXT)status(VARCHAR(50), default: 'pending')priority(VARCHAR(50), default: 'medium')due_date(TIMESTAMP)completed_at(TIMESTAMP)created_at(TIMESTAMP)updated_at(TIMESTAMP)
notifications
id(SERIAL PRIMARY KEY)user_id(INTEGER, FK β users)title(VARCHAR(255))message(TEXT)type(VARCHAR(50))read(BOOLEAN)created_at(TIMESTAMP)
task_history
id(SERIAL PRIMARY KEY)task_id(INTEGER, FK β tasks)user_id(INTEGER, FK β users)action(VARCHAR(100))old_value(JSONB)new_value(JSONB)created_at(TIMESTAMP)
- β Passwords hashed with bcryptjs (10 rounds)
- β JWT tokens with configurable expiration (default: 7 days)
- β Protected routes require valid JWT
- β CORS configured for specific origins
- β Parameterized queries prevent SQL injection
- β Input validation on all endpoints
- β HTTPS in production
PORT=5000
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_EXPIRES_IN=7d
NODE_ENV=production
# PostgreSQL Configuration
DATABASE_URL=postgresql://user:password@host:5432/database
# Or individual settings:
DB_HOST=postgresql://user:password@host:5432/database
DB_DATABASE=TaskManagerDB
DB_USER=username
DB_PASSWORD=password
DB_PORT=5432VITE_API_URL=https://your-backend-url.com/api-
Ensure PostgreSQL is running:
# Windows net start postgresql # macOS brew services start postgresql # Linux sudo systemctl start postgresql
-
Check connection string:
- Verify username, password, and database name
- Ensure port 5432 is open
-
Create database if it doesn't exist:
createdb TaskManagerDB
-
Check PostgreSQL logs:
# Location varies by installation /var/log/postgresql/postgresql-*.log
- Check backend is running: Visit
http://localhost:5000/api/health - Verify CORS settings in server/index.js
- Check environment variables are set correctly
- Ensure frontend API URL matches backend URL
| Screen Size | Breakpoint | Layout |
|---|---|---|
| Small Mobile | β€480px | Single column, compact UI |
| Mobile | β€768px | Single column, mobile menu |
| Tablet | 769-1024px | 2-column grids |
| Desktop | 1025-1440px | Standard layout |
| Large Desktop | β₯1440px | Expanded padding |
- Success: Green, checkmark icon
- Error: Red, alert icon
- Info: Blue, info icon
- Warning: Orange, warning icon
- Auto-dismiss after 3 seconds
- Manual close button
- Slide-in animation
- Mobile responsive
- Priority Pie Chart: Visual distribution of task priorities
- Status Bar Chart: Tasks by completion status
- Quick Stats: Due today, overdue, projects count
- Real-time updates
- Smooth animations
- Inline editing
- Confirmation dialogs
- Instant feedback
- Priority color coding
- Due date tracking
- Status toggling
MIT License - feel free to use this project for learning or production.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For issues and questions:
- Open an issue on GitHub
- Check the Help section in the app
- Review the troubleshooting guide above
Built with β€οΈ using React, Node.js, and PostgreSQL