Back to Examples

Task Management App Tutorial

Create a collaborative task management system with real-time updates using Cursor's AI assistance.

Project Overview

What We'll Build

  • Real-time collaboration features
  • Project tracking and deadlines
  • Notification system
  • Task status management

Tech Stack

  • Frontend: React with TypeScript
  • Backend: Node.js with Express
  • Database: MongoDB with Mongoose
  • Real-time: Socket.io
  • Authentication: JWT with Passport
  • Styling: Tailwind CSS
1

Project Setup

Let's start by creating the project structure and setting up the development environment.

Initialize the Project

BASH
# Create project directory
mkdir task-management-app
cd task-management-app

# Initialize package.json
npm init -y

# Install dependencies
npm install react react-dom next typescript @types/react @types/node
npm install tailwindcss postcss autoprefixer
npm install mongoose socket.io socket.io-client
npm install jsonwebtoken passport passport-jwt
npm install bcryptjs

AI Prompt for Project Structure

TEXT
Create a Next.js project structure for a task management application with:

- User authentication and authorization
- Real-time task updates using Socket.io
- Project and task management
- Team collaboration features
- Notification system
- Responsive design with Tailwind CSS

Please create the folder structure and initial configuration files.
2

Database Schema Design

Design the database schema using Mongoose with AI assistance for a task management system.

AI Prompt for Database Schema

TEXT
Create Mongoose schemas for a task management application with:

1. User (id, email, password, firstName, lastName, avatar, createdAt, updatedAt)
2. Project (id, name, description, ownerId, members, status, createdAt, updatedAt)
3. Task (id, title, description, projectId, assigneeId, status, priority, dueDate, createdAt, updatedAt)
4. Comment (id, taskId, userId, content, createdAt, updatedAt)
5. Notification (id, userId, type, message, read, createdAt, updatedAt)

Include proper relationships, validation, and middleware.
3

Real-time Features

Implement real-time collaboration using Socket.io for live updates and notifications.

AI Prompt for Socket.io Setup

TEXT
Create a Socket.io server for a task management application with:

1. User connection and disconnection handling
2. Real-time task updates (create, update, delete)
3. Project collaboration (user joins/leaves project)
4. Live notifications for task assignments
5. Real-time comments on tasks
6. Typing indicators for collaborative editing

Include proper error handling and room management.
4

Frontend Components

Build React components for the task management interface with real-time updates.

AI Prompt for React Components

TEXT
Create React components for a task management application:

1. TaskBoard - Main dashboard with project and task lists
2. TaskCard - Individual task display with status updates
3. ProjectSidebar - Project navigation and team members
4. TaskModal - Create/edit task form
5. NotificationCenter - Real-time notifications
6. UserProfile - User settings and preferences

Use TypeScript, Tailwind CSS, and include real-time updates with Socket.io.
5

Authentication System

Implement secure user authentication with JWT tokens and protected routes.

AI Prompt for Authentication

TEXT
Create a complete authentication system for the task management app:

1. User registration with email validation
2. User login with JWT tokens
3. Password hashing with bcrypt
4. Protected API routes
5. Middleware for route protection
6. Password reset functionality
7. Email verification

Use Next.js API routes, MongoDB, and include proper error handling.
6

Deployment

Deploy your task management application to production with Vercel and MongoDB Atlas.

Deployment Checklist

Set up MongoDB Atlas database
Configure environment variables
Deploy frontend to Vercel
Deploy backend to Railway
Configure Socket.io for production

Task Management App Complete! ✅

You've built a complete task management application with real-time collaboration! This project demonstrates advanced AI-assisted development techniques.