A full-stack task management application built with Node.js, Express, MongoDB, and vanilla JavaScript. This app allows users to create, edit, delete, and manage tasks with features like authentication, search, filtering, and priority management.
- User Authentication: Signup and login with JWT authentication
- Task Management: Create, read, update, and delete tasks
- Task Status: Mark tasks as pending or completed
- Priority Levels: Set task priority (High, Medium, Low)
- Due Dates: Set due dates for tasks
- Search: Search tasks by title or description
- Filtering: Filter tasks by status and priority
- Responsive Design: Works on desktop, tablet, and mobile devices
- Modern UI: Clean and intuitive user interface
- Node.js
- Express.js
- MongoDB with Mongoose
- JWT (JSON Web Tokens) for authentication
- bcryptjs for password hashing
- CORS for cross-origin resource sharing
- HTML5
- CSS3 (with modern features like Grid and Flexbox)
- Vanilla JavaScript (ES6+)
- Fetch API for HTTP requests
Before running this application, ensure you have the following installed:
- Node.js (v14 or higher)
- MongoDB (Make sure MongoDB is running on your system)
-
Clone or download the project
-
Install dependencies
npm install
-
Configure environment variables
The
.envfile is already created with default values. You can modify it if needed:PORT=5000 MONGODB_URI=mongodb://localhost:27017/taskmanagement JWT_SECRET=your_jwt_secret_key_change_this_in_productionImportant: Change the
JWT_SECRETto a secure random string in production. -
Install and Start MongoDB
For Windows Users:
a. Download MongoDB Community Server from: https://www.mongodb.com/try/download/community
b. Run the installer and choose "Complete" installation
c. During installation, uncheck "Install MongoDB as a Service" if you want to start it manually
d. After installation, start MongoDB:
- If installed as service: MongoDB starts automatically
- Manual start: Open Command Prompt as Administrator and run:
"C:\Program Files\MongoDB\Server\7.0\bin\mongod.exe" --dbpath "C:\data\db" - Or use MongoDB Compass (GUI) to connect
e. Create the data directory if it doesn't exist:
mkdir C:\data\dbAlternative: Use MongoDB Atlas (Cloud)
a. Create a free account at https://www.mongodb.com/cloud/atlas
b. Create a new cluster (free tier)
c. Get your connection string from Atlas Dashboard
d. Update your
.envfile with the Atlas connection string:MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/taskmanagementVerify MongoDB is running:
- Open Command Prompt and run:
mongod(if in PATH) - Or check if MongoDB service is running in Services
-
Start the server
npm start
For development with auto-reload:
npm run dev
-
Access the application
Open your browser and navigate to:
http://localhost:5000
- Sign Up: Click "Sign up" on the login page to create a new account
- Login: Use your email and password to log in
- Logout: Click the logout button in the header to log out
- Create Task: Fill in the task form with title, description, priority, and due date
- View Tasks: All tasks are displayed in the task list
- Edit Task: Click the "Edit" button on a task to modify it
- Delete Task: Click the "Delete" button to remove a task
- Toggle Status: Click "Complete" to mark a task as done, or "Undo" to mark it as pending
- Search: Use the search box to find tasks by title or description
- Filter by Status: Click "All", "Pending", or "Completed" buttons
- Filter by Priority: Use the dropdown to filter by priority level
task-management-app/
├── models/
│ ├── User.js # User model with password hashing
│ └── Task.js # Task model with schema
├── routes/
│ ├── auth.js # Authentication routes (signup, login)
│ └── tasks.js # Task CRUD routes
├── middleware/
│ └── auth.js # JWT authentication middleware
├── public/
│ ├── index.html # Main HTML file
│ ├── styles.css # CSS styling
│ └── script.js # Frontend JavaScript
├── server.js # Express server setup
├── package.json # Dependencies and scripts
├── .env # Environment variables
└── .gitignore # Git ignore rules
POST /api/auth/signup- Register a new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user info
GET /api/tasks- Get all tasks (with search and filter support)GET /api/tasks/:id- Get single taskPOST /api/tasks- Create new taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete taskPATCH /api/tasks/:id/toggle- Toggle task completion status
- Password hashing with bcryptjs
- JWT token-based authentication
- Protected routes requiring authentication
- User-specific task isolation (users can only access their own tasks)
- Input validation on both frontend and backend
The application is fully responsive and works on:
- Desktop computers (1200px+)
- Tablets (768px - 1199px)
- Mobile devices (less than 768px)
- Ensure MongoDB is running on your system
- Check the
MONGODB_URIin your.envfile - Verify MongoDB is listening on the correct port (default: 27017)
- Change the
PORTin your.envfile to a different port - Or stop the process using the current port
- Clear your browser's localStorage
- Try logging out and logging back in
- Check that your JWT_SECRET is set correctly
Potential features to add:
- Task categories/tags
- Task sharing between users
- Email notifications for due dates
- Task reminders
- Dark mode
- Export tasks to CSV/PDF
- Drag and drop task reordering
- Subtasks
- File attachments to tasks
This project is open source and available for educational purposes.
Created as a full-stack project demonstrating modern web development practices.