Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

105 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LearnSpace πŸŽ“

LearnSpace GitHub stars GitHub forks GitHub license

A Modern Task & Learning Management System Features β€’ Tech Stack β€’ Installation β€’ Project Structure β€’ Usage β€’ Contributing β€’ License


Table of Contents


About

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.

Why use LearnSpace?

  • πŸ“ Task Management:
  • πŸ” Secure Authentication:
  • πŸ“± Modern UI:
  • πŸ’Ύ Persistent Storage: User Dashboard:
  • 🎯 Organized Views:

Features

User Features

  • βœ… User Registration & Authentication:
  • βœ… Task Management: Task Organization: User Dashboard: Profile Management: Session Management:

Security Features

  • πŸ”’ Password Hashing: JWT Authentication: Input Validation: Error Handling:

Tech Stack

Frontend

  • Vite HTML5 CSS3 Vanilla JavaScript PostCSS

Backend

  • Node.js Express.js MongoDB Mongoose JWT bcryptjs dotenv

Development Tools

  • Git npm EJS

Project Structure

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

Installation

Prerequisites

Ensure you have the following installed:

  • Node.js npm MongoDB Git

Clone the Repository

git clone https://github.com/HimanshiSh03/LearnSpace.git
cd LearnSpace

Install Dependencies

# Install backend dependencies
npm install

# Install frontend dependencies
cd client
npm install
cd ..

Create Environment File

Create a .env file in the root directory:

touch .env

Add 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_key

Start the Application

Development Mode

Terminal 1 - Backend:

npm run dev
# Backend runs on http://localhost:3000

Terminal 2 - Frontend:

cd client
npm run dev
# Frontend runs on http://localhost:5173

Production Build

# Build frontend
cd client
npm run build

# Start backend (serves frontend)
cd ..
npm start

βš™οΈ Configuration

MongoDB Setup

Local MongoDB

# macOS (with Homebrew)
brew services start mongodb-community

# Ubuntu/Linux
sudo systemctl start mongod

# Windows - MongoDB runs as a Windows Service automatically

MongoDB Atlas (Cloud)

  1. Create account at MongoDB Atlas
  2. Create a cluster
  3. Get connection string
  4. Update MONGO_URI in .env

πŸ“– Usage

For Users

1. Registration

  • Navigate to /register
  • Fill in username, email, and password
  • Click "Create Account"
  • Automatically redirected to login

2. Login

  • Navigate to /login
  • Enter email and password
  • Click "Login"
  • Redirected to dashboard

3. Task Management

  • 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)

πŸ”Œ API Endpoints

Authentication Routes

Register New User

POST /register
Content-Type: application/json

{
  "username": "john_doe",
  "email": "john@example.com",
  "password": "securePassword123"
}

Login User

POST /login
Content-Type: application/json

{
  "email": "john@example.com",
  "password": "securePassword123"
}

Task Routes

Get All Tasks

GET /api/tasks
Authorization: Bearer {token}

Create New Task

POST /api/tasks
Authorization: Bearer {token}
Content-Type: application/json

{
  "title": "Complete Project",
  "description": "Finish the LearnSpace project",
  "priority": "high",
  "dueDate": "2025-12-31"
}

Update Task

PUT /api/tasks/:taskId
Authorization: Bearer {token}
Content-Type: application/json

{
  "status": "completed"
}

Delete Task

DELETE /api/tasks/:taskId
Authorization: Bearer {token}

πŸ—„οΈ Database Schema

User Schema

{
  _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 }
}

Task Schema

{
  _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 }
}

πŸ”§ Troubleshooting

MongoDB Connection Issues

Error: Error: connect ECONNREFUSED 127.0.0.1:27017

Solutions:

  • Ensure MongoDB is running
  • Check if port 27017 is available
  • Verify MONGO_URI in .env file

Port Already in Use

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=3001

🀝 Contributing

We welcome contributions! Here's how:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes and commit: git commit -am 'Add new feature'
  4. Push to branch: git push origin feature/your-feature
  5. Submit a Pull Request

See CONTRIBUTING.md for detailed guidelines.


License

This project is licensed under the MIT License – see the LICENSE file for details.


Contact

HimanshiSh03


Acknowledgments

Built With


Star this repository if you found it helpful!

Made with ❀️ by HimanshiSh03 Back to Top

About

LearnSpace is a personal productivity hub combining planning, learning, organization, and collaboration tools. A platform for Learning and Growing together. Having features like collaborative task management, whiteboard and many more to come!

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages