A comprehensive, production-ready task management application built with the MERN Stack (MongoDB, Express.js, React, Node.js). Features real-time task tracking, beautiful Scrum board with drag-and-drop, advanced analytics, email notifications, and productivity streak tracking.
Perfect for learning full-stack development and deploying production-grade applications.
| Component | URL |
|---|---|
| Frontend | https://smart-task-manager-sl4a.vercel.app |
| Backend API | https://smart-task-manager-production.up.railway.app |
- ✅ Google OAuth 2.0 - Passwordless authentication with Google
- ✅ Auto-username generation - Username automatically derived from email (e.g., rb@gmail.com → rb)
- ✅ Instant registration - New users auto-registered on first OAuth login
- ✅ User registration with validation
- ✅ Secure login with JWT tokens
- ✅ Cookie-based session management
- ✅ Protected routes and API endpoints
- ✅ Secure logout with token cleanup
- ✅ Create, edit, and delete tasks
- ✅ View detailed task information
- ✅ Set task priorities (Low, Medium, High)
- ✅ Add due dates with date picker
- ✅ Task descriptions and notes
- ✅ Search and filter tasks by status/priority
- ✅ To Do - New tasks
- ✅ In Progress - Active work
- ✅ Blocked - Waiting on dependencies
- ✅ Review - Ready for approval
- ✅ Done - Completed tasks
- ✅ Drag-and-drop task management
- ✅ Real-time status updates
- ✅ Visual task cards with priority colors
- ✅ Task count per column
- ✅ Responsive grid layout
- ✅ Task completion statistics
- ✅ Status distribution pie chart
- ✅ Completion timing analysis (Early/On-time/Late)
- ✅ Weekly completion trends
- ✅ Monthly performance charts
- ✅ Interactive Recharts visualizations
- ✅ Current and longest streak tracking
- ✅ Daily task completion tracking
- ✅ Current streak counter
- ✅ Longest streak history
- ✅ Automatic streak calculations
- ✅ Visual streak indicators
- ✅ SendGrid integration for reliable email delivery
- ✅ Daily task reminders (configurable time with timezone support)
- ✅ Overdue task alerts
- ✅ Due today notifications
- ✅ Beautiful HTML email templates
- ✅ Automatic scheduling with node-cron
- ✅ Full dark mode support with smooth transitions
- ✅ Improved button designs with gradients
- ✅ Better contrast and visibility in dark mode
- ✅ Responsive design for all screen sizes
- ✅ Modern component styling with Tailwind CSS
- ✅ Accessible color schemes
| Technology | Purpose |
|---|---|
| React 18+ | UI library |
| Vite | Fast build tool |
| React Router DOM | Client-side routing |
| React Hook Form | Form management |
| Tailwind CSS | Styling & dark mode |
| Recharts | Charts & graphs |
| Axios | HTTP client |
| Radix UI | Component primitives |
| Lucide Icons | Icons library |
| Technology | Purpose |
|---|---|
| Node.js | JavaScript runtime |
| Express.js | Web framework |
| MongoDB | NoSQL database |
| Mongoose | ODM for MongoDB |
| Redis | In-memory caching & rate limiting |
| JWT | Token authentication |
| Oauth | Authentication |
| SendGrid | Email service |
| node-cron | Task scheduling |
| dotenv | Environment management |
| Cookie-parser | Cookie handling |
| express-rate-limit | Rate limiting middleware |
| rate-limiter-flexible | DDoS protection |
| ioredis | Redis client |
| Service | Component |
|---|---|
| Vercel | Frontend hosting |
| Railway | Backend hosting |
| MongoDB Atlas | Cloud database |
| SendGrid | Email API |
| Google Auth | Authentication |
Smart-Task-Manager/
│
├── client/ # React Frontend (Vite)
│ ├── src/
│ │ ├── components/
│ │ │ ├── auth/ # Login/Register
│ │ │ ├── tasks/ # Task components
│ │ │ ├── common-button/ # Button component
│ │ │ ├── common-dialog/ # Modal dialogs
│ │ │ ├── common-form/ # Form wrapper
│ │ │ ├── header/ # Navigation
│ │ │ ├── ui/ # UI primitives
│ │ │ └── helper/ # Utilities
│ │ ├── pages/
│ │ │ ├── auth/ # Auth pages
│ │ │ ├── task/ # Task list
│ │ │ ├── task-details/ # Task details
│ │ │ ├── scrum-board/ # Kanban board
│ │ │ └── stats/ # Analytics
│ │ ├── context/ # React Context
│ │ ├── services/ # API calls
│ │ ├── config/ # Config
│ │ └── App.jsx
│ └── package.json
│
├── server/ # Node/Express Backend
│ ├── models/
│ │ ├── Task.js
│ │ └── user.js
│ ├── routes/
│ │ ├── user-routes.js
│ │ ├── task-routes.js
│ │ └── notification-routes.js
│ ├── controllers/
│ │ ├── user-controller.js
│ │ ├── task-controller.js
│ │ └── notification-controller.js
│ ├── services/
│ │ └── notification-scheduler.js
│ ├── utils/
│ │ ├── email.js
│ │ └── database.js
│ ├── middlewares/
│ │ └── auth-middleware.js
│ ├── index.js
│ └── package.json
│
└── README.md
- Node.js (v16+)
- npm or yarn
- MongoDB account (Atlas)
- Redis (local or cloud)
- SendGrid API key
- Google OAuth Credentials
git clone https://github.com/rb-369/Smart-Task-Manager-
cd Smart-Task-Manager-cd server
npm installCreate .env file:
PORT=5000
MONGO_URL=your_mongodb_atlas_connection_string
REDIS_URL=redis://localhost:6379 # For local development
# Or use cloud Redis: redis://:password@host:port
SENDGRID_API_KEY=your_sendgrid_api_key
SENDER_EMAIL=your_sender_email@example.com
TZ=Asia/Kolkata
NODE_ENV=developmentNote: Redis is required for caching and rate limiting. For local development, install Redis via:
- macOS:
brew install redis - Windows: Download from Redis Windows
- Linux:
sudo apt-get install redis-server - Cloud: Use Redis Cloud (free tier available)
Start backend:
npm run devBackend runs at: http://localhost:5000
cd ../client
npm install
npm run devFrontend runs at: http://localhost:5173
- Go to Google Cloud Console
- Create a new project
- Enable Google OAuth 2.0 API
- Create OAuth 2.0 credentials:
- Application type: Web application
- Authorized origins:
http://localhost:5173,https://your-vercel-domain.com - Authorized redirects:
http://localhost:5173,https://your-vercel-domain.com
- Copy Client ID and Client Secret
server/.env:
GOOGLE_CLIENT_ID=your_client_id_here
GOOGLE_CLIENT_SECRET=your_client_secret_hereclient/.env:
VITE_GOOGLE_CLIENT_ID=your_client_id_here
VITE_API_BASE_URL=http://localhost:5000- ✅ One-click Google sign-in
- ✅ Automatic user account creation
- ✅ Username auto-generated from email
- ✅ Secure token verification with Google API
- ✅ httpOnly cookie storage
- ✅ COOP headers for popup security
- Create account at SendGrid
- Generate API key from Settings → API Keys
- Copy to
.env:SENDGRID_API_KEY=SG.xxxxxxxxxxxxx SENDER_EMAIL=notifications@yourdomain.com
- Daily Reminders: Sent at 9:00 AM (configurable)
- Overdue Tasks: Lists all overdue items
- Due Today: Shows tasks due today
- HTML Templates: Professional formatting
- Timezone Support: Set
TZenvironment variable
Test notifications immediately:
POST /api/notification/trigger-reminders- Email/Password - Traditional registration and login
- Google OAuth 2.0 - One-click sign-in with Google
1. User clicks "Sign in with Google"
↓
2. Google popup opens
↓
3. User signs in with Google account
↓
4. Google returns ID token
↓
5. Frontend sends token to backend
↓
6. Backend verifies with Google API
↓
7. Check if user exists:
- YES: Login (return existing user)
- NO: Auto-register with auto-generated username
↓
8. Generate JWT token & set secure cookie
↓
9. Redirect to /tasks/list
- Dashboard (requires login)
- Task management (requires login)
- Analytics (requires login)
- Profile settings (requires login)
- ✅ Server-side token verification (never trust client)
- ✅ httpOnly cookies (XSS protection)
- ✅ CORS validation
- ✅ COOP headers for OAuth popup security
- ✅ Secure password hashing with bcryptjs
- ✅ JWT expiration (3 days)
- ✅ Task Caching - User tasks cached with Redis for fast retrieval
- Cache key:
task:{userId}:{page}:{limit} - TTL: 400 seconds (6.7 minutes)
- Automatic invalidation on create/update/delete
- Cache key:
- ✅ Single Task Caching - Individual task details cached
- Cache key:
task:{taskId} - TTL: 400 seconds
- Cache key:
- ✅ Automatic Cache Invalidation - All related caches cleared on mutations
- ✅ Cache Fallback - Corrupted cache automatically detected and rebuilt
- ✅ Global Rate Limiter - 10 requests/second per IP
- Protects against general abuse
- Uses Redis for distributed rate limiting
- ✅ Sensitive Endpoint Rate Limiter - 50 requests per 15 minutes
- Applied to authentication endpoints
- Window: 15 minutes
- Prevents brute-force attacks
- ✅ IP-Based Tracking - All requests tracked by client IP
- ✅ Graceful Rate Limit Responses - Returns 429 status with clear messages
// Global rate limiting (10 req/s)
RateLimiterRedis: 10 points per 1 second
// Sensitive endpoints (50 req/15 min)
rateLimit: windowMs = 15 * 60 * 1000, max = 50
// Cache configuration
setex(cacheKey, 400, JSON.stringify(data))
// 400 second TTL for all cached dataPOST /api/user/register # User registration (email/password)
POST /api/user/login # User login (email/password)
POST /api/user/google-oauth # Google OAuth sign-in/register
POST /api/user/auth # Check authentication
POST /api/user/logout # User logout
POST /api/tasks/add # Create new task
GET /api/tasks/get/:userId # Get all user tasks
GET /api/tasks/get-details/:id # Get single task
PUT /api/tasks/update # Update task
DELETE /api/tasks/del/:taskId # Delete task
POST /api/notification/send-test # Send test email
POST /api/notification/trigger-reminders # Trigger daily reminders
- ✅ System-wide dark theme
- ✅ Smooth transitions
- ✅ Improved contrast
- ✅ Persistent preference
- ✅ Mobile-first approach
- ✅ All screen sizes
- ✅ Touch-friendly
- ✅ Optimized performance
- ✅ Gradient buttons
- ✅ Color-coded tasks
- ✅ Smooth animations
- ✅ Custom scrollbars
- ✅ Accessible colors
- Create task with due date = today or earlier
- Mark task as incomplete
- Call:
POST /api/notification/trigger-reminders - Check email inbox
- Go to Scrum Board
- Drag tasks between columns
- Verify real-time status updates
- Complete multiple tasks
- View Stats page
- Check streaks and charts
-
Connect to Railway:
- Go to Railway
- Create new project from GitHub
- Select your Smart-Task-Manager repository
- Create new service → Node.js
-
Add Environment Variables in Railway Dashboard:
- Click your project → Variables
- Add all required variables:
PORT=5000 MONGO_URL=your_mongodb_atlas_connection_string SENDGRID_API_KEY=your_sendgrid_api_key SENDER_EMAIL=your_sender_email@example.com GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret JWT_SECRET=your_super_secret_jwt_key_here TZ=Asia/Kolkata NODE_ENV=production
-
Deploy:
- Railway auto-deploys on push to main branch
- Check deployment logs if errors occur
-
Connect to Vercel:
- Go to Vercel
- Import project from GitHub
- Select
clientfolder as root directory
-
Add Environment Variables in Vercel Dashboard:
- Go to Settings → Environment Variables
- Add these variables:
VITE_GOOGLE_CLIENT_ID=your_google_client_id VITE_API_BASE_URL=https://smart-task-manager-production.up.railway.app
-
Deploy:
- Vercel auto-deploys on push to main branch
- View deployment at your Vercel domain
| Variable | Backend | Frontend | Purpose |
|---|---|---|---|
MONGO_URL |
✅ | ❌ | MongoDB connection (REQUIRED) |
SENDGRID_API_KEY |
✅ | ❌ | Email service (REQUIRED) |
SENDER_EMAIL |
✅ | ❌ | Email sender (REQUIRED) |
GOOGLE_CLIENT_ID |
✅ | ✅ | OAuth sign-in (REQUIRED) |
GOOGLE_CLIENT_SECRET |
✅ | ❌ | OAuth secret - NEVER expose! |
JWT_SECRET |
✅ | ❌ | Token signing (REQUIRED) |
VITE_API_BASE_URL |
❌ | ✅ | Backend API URL (default: localhost) |
PORT |
✅ | ❌ | Server port (default: 5000) |
NODE_ENV |
✅ | ❌ | Environment mode |
TZ |
✅ | ❌ | Timezone for emails |
YES, the app will NOT work without proper environment variables! Here's what will break:
- ❌ No OAuth login → Google sign-in will fail
- ❌ No Email notifications → Reminder emails won't send
- ❌ No Database connection → Tasks won't be saved
- ❌ No API calls → Frontend can't reach backend
Verifying Deployment:
- Check Vercel & Railway dashboards for errors
- Test OAuth button on frontend
- Test creating a task
- Check email notifications work
- Monitor console for any errors
This project covers essential full-stack concepts:
- ✅ MERN Stack - Complete implementation
- ✅ Authentication - JWT + Cookie-based + OAuth 2.0
- ✅ Google OAuth 2.0 - Passwordless authentication
- ✅ Auto-registration - User account creation from OAuth
- ✅ State Management - React Context API
- ✅ REST APIs - Design & implementation
- ✅ Database Design - MongoDB schemas
- ✅ Email Service - SendGrid integration
- ✅ Task Scheduling - Cron jobs
- ✅ Cloud Deployment - Vercel & Railway
- ✅ Environment Variables - Secure credential management
- ✅ UI/UX Design - Tailwind CSS
- ✅ Real-time Updates - Instant status changes
- ✅ Data Visualization - Charts with Recharts
- ✅ Error Handling - Comprehensive management
- ✅ Security - OAuth, JWT, CORS, validation
- ✅ Performance - Optimization techniques
Contributions welcome! To contribute:
- Fork repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
MIT License - Open source project
Rudra Babar (rb-369)
- Diploma in Computer Engineering
- Full-stack developer
- Passionate about building scalable applications
If you found this project helpful, please consider giving it a ⭐ on GitHub!
For issues, bugs, or feature requests, please open an issue on GitHub.
- Real-time collaboration
- Task comments & mentions
- Team management with roles
- Task templates
- Mobile app (React Native)
- WebSocket for live updates
- Offline mode with sync
- Advanced filtering
- Task dependencies
- Time tracking
Happy Task Managing! 🚀