A Modern Task & Learning Management System Features β’ Tech Stack β’ Installation β’ Project Structure β’ Usage β’ Contributing β’ License
- About
- Features
- Tech Stack
- Project Structure
- Installation
- Configuration
- Usage
- API Endpoints
- Database Schema
- Troubleshooting
- Contributing
- License
- Contact
LearnSpace is a task and learning management systembuilt with Node.js, Express, MongoDB, and Vite. It helps you manage your tasks, organize learning materials, and track your progress in one place.
- π Task Management:
- π Secure Authentication:
- π± Modern UI:
- πΎ Persistent Storage: User Dashboard:
- π― Organized Views:
- β User Registration & Authentication:
- β Task Management: Task Organization: User Dashboard: Profile Management: Session Management:
- π Password Hashing: JWT Authentication: Input Validation: Error Handling:
- Vite HTML5 CSS3 Vanilla JavaScript PostCSS
- Node.js Express.js MongoDB Mongoose JWT bcryptjs dotenv
- Git npm EJS
LearnSpace/
β
βββ client/ # Frontend application
β βββ public/ # Static assets
β βββ src/ # Source files
β βββ vite.config.js # Vite configuration
β βββ package.json # Frontend dependencies
β βββ tailwind.config.js # Tailwind CSS configuration
β βββ postcss.config.mjs # PostCSS configuration
β
βββ config/ # Configuration files
β βββ db.js # MongoDB connection setup
β
βββ models/ # Mongoose schemas
β βββ Task.js # Task model schema
β βββ user-model.js # User model schema
β
βββ routes/ # API route handlers
β βββ task-routes.js # Task CRUD routes
β βββ user-routes.js # User authentication routes
β
βββ views/ # EJS template files
β βββ register.ejs # User registration page
β βββ login.ejs # User login page
β βββ index.ejs # Dashboard/home page
β
βββ .gitignore # Git ignore rules
βββ package.json # Backend dependencies
βββ .env # Environment variables
βββ app.js # Express application setup
βββ server.js # Server entry point
βββ README.md # Project documentation
Ensure you have the following installed:
- Node.js npm MongoDB Git
git clone https://github.com/HimanshiSh03/LearnSpace.git
cd LearnSpace# Install backend dependencies
npm install
# Install frontend dependencies
cd client
npm install
cd ..Create a .env file in the root directory:
touch .envAdd the following variables to .env:
# Server Configuration
PORT=3000
NODE_ENV=development
# Database
MONGO_URI=mongodb://localhost:27017/learnspace
# Or MongoDB Atlas: mongodb+srv://username:password@cluster.mongodb.net/learnspace
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here_change_in_production
JWT_EXPIRE=7d
# Frontend URL
CLIENT_URL=http://localhost:5173
# Session Configuration
SESSION_SECRET=your_session_secret_keyTerminal 1 - Backend:
npm run dev
# Backend runs on http://localhost:3000Terminal 2 - Frontend:
cd client
npm run dev
# Frontend runs on http://localhost:5173# Build frontend
cd client
npm run build
# Start backend (serves frontend)
cd ..
npm start# macOS (with Homebrew)
brew services start mongodb-community
# Ubuntu/Linux
sudo systemctl start mongod
# Windows - MongoDB runs as a Windows Service automatically- Create account at MongoDB Atlas
- Create a cluster
- Get connection string
- Update
MONGO_URIin.env
- Navigate to
/register - Fill in username, email, and password
- Click "Create Account"
- Automatically redirected to login
- Navigate to
/login - Enter email and password
- Click "Login"
- Redirected to dashboard
- Create Task: Click "New Task" button
- View Tasks: All tasks displayed on dashboard
- Edit Task: Click on task to edit details
- Delete Task: Click delete button to remove task
- Change Status: Update task status (todo, in-progress, completed)
POST /register
Content-Type: application/json
{
"username": "john_doe",
"email": "john@example.com",
"password": "securePassword123"
}POST /login
Content-Type: application/json
{
"email": "john@example.com",
"password": "securePassword123"
}GET /api/tasks
Authorization: Bearer {token}POST /api/tasks
Authorization: Bearer {token}
Content-Type: application/json
{
"title": "Complete Project",
"description": "Finish the LearnSpace project",
"priority": "high",
"dueDate": "2025-12-31"
}PUT /api/tasks/:taskId
Authorization: Bearer {token}
Content-Type: application/json
{
"status": "completed"
}DELETE /api/tasks/:taskId
Authorization: Bearer {token}{
_id: ObjectId,
username: { type: String, required: true, unique: true },
email: { type: String, required: true, unique: true },
password: { type: String, required: true },
createdAt: { type: Date, default: Date.now },
updatedAt: { type: Date, default: Date.now }
}{
_id: ObjectId,
title: { type: String, required: true },
description: { type: String },
userId: { type: ObjectId, ref: 'User', required: true },
status: { type: String, enum: ['todo', 'in-progress', 'completed'] },
priority: { type: String, enum: ['low', 'medium', 'high'] },
dueDate: { type: Date },
createdAt: { type: Date, default: Date.now },
updatedAt: { type: Date, default: Date.now }
}Error: Error: connect ECONNREFUSED 127.0.0.1:27017
Solutions:
- Ensure MongoDB is running
- Check if port 27017 is available
- Verify
MONGO_URIin.envfile
Error: Error: listen EADDRINUSE: address already in use :::3000
Solution:
# Find process using port
lsof -i :3000
# Kill the process
kill -9 <PID>
# Or change port in .env
PORT=3001We welcome contributions! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes and commit:
git commit -am 'Add new feature' - Push to branch:
git push origin feature/your-feature - Submit a Pull Request
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License β see the LICENSE file for details.
HimanshiSh03
- GitHub: @HimanshiSh03
- Issues: Report a bug or request a feature
- Node.js - Runtime environment
- Express - Web framework
- MongoDB - Database
- Vite - Build tool
- Tailwind CSS - Styling
- EJS - Template engine
Made with β€οΈ by HimanshiSh03 Back to Top