Ali-Adel-Nour
LMS
JavaScript

Learning Management System(Udemy - Coursera)

Last updated Jul 5, 2026
32
Stars
1
Forks
0
Issues
0
Stars/day
Attention Score
63
Language breakdown
JavaScript 92.2%
HTML 3.9%
CSS 2.2%
Solidity 1.6%
Dockerfile 0.1%
โ–ธ Files click to expand
README

Learning Management System (LMS)

Welcome to the Learning Management System (LMS) repository! This project is inspired by leading e-learning platforms like Udemy and Coursera. It is designed to provide a comprehensive backend solution for managing users, courses, tutorials, blogs, documentation, reviews, and contact management. The system includes robust authentication, role-based access control, real-time messaging capabilities, Web3/blockchain integration, and scalable architecture.


๐ŸŒŸ Features

1. ๐Ÿ‘ค User Management

  • Registration & Authentication: Secure user registration and login with JWT tokens.
  • Role-Based Access Control: Administrator, instructor, and student roles with granular permissions.
  • Account Actions:
- Password reset and password hint generation. - User blocking/unblocking with detailed logging. - Profile management and account settings.

2. ๐Ÿ“š Course Management

  • Course Creation: Instructors can create, edit, and delete courses.
  • Categories: Assign courses to categories for streamlined organization.
  • Lesson Management: Add lessons to courses with support for pagination.
  • Course Enrollment: Track and manage student enrollments.

3. ๐ŸŽ“ Tutorials

  • Tutorials by Category: Fetch tutorials based on categories.
  • CRUD Operations: Create, update, and delete tutorial content.
  • Slug-based Routing: Easy-to-read URLs for tutorials.

4. ๐Ÿ“ Blogs

  • Blog Management:
- Post, edit, and delete blogs. - Assign blogs to categories and manage thumbnails or videos.
  • Blog Discovery: Browse blogs by category with pagination.

5. ๐Ÿ“„ Documentation

  • Documentation Management:
- Add, update, and delete documentation. - Fetch documentation by categories or single entries.
  • Knowledge Base: Centralized documentation for system reference.

6. โญ Reviews & Ratings

  • Review System:
- Users can leave reviews and ratings for courses. - Display average ratings and review counts. - Fetch all reviews with pagination support.

7. ๐Ÿ’ฌ Real-Time Chat

  • Socket.IO Integration: Real-time messaging between users.
  • Conversation Management: Create and manage conversations with read receipts.
  • Typing Indicators: Real-time typing status updates.
  • Online Status: Track user availability.

8. ๐Ÿ“ฌ Contact Management

  • Contact Forms:
- Submit and manage contact forms. - Retrieve and update contact submissions.
  • Notification System: Alerts for new contact submissions.

9. ๐Ÿ” Web3 & Blockchain Integration

  • Wallet Authentication:
- MetaMask wallet connection and authentication. - Secure wallet-based login with nonce verification. - Support for wallet address management and verification.
  • NFT Certificates:
- Mint course completion certificates as ERC-721 NFTs. - Store certificate metadata on-chain. - Issue certificates with course ID, score, and timestamp.
  • Smart Contracts:
- CourseCertificateNFT: ERC-721 contract for issuing course certificates. - LMSToken: ERC-20 reward token for gamification and incentives. - CoursePaymentHandler: Handle course payments in USDC stablecoin. - VerificationRegistry: Verify and track course completions on-chain.
  • Cryptocurrency Payments:
- USDC stablecoin course payments. - Secure payment intent creation and processing. - Transparent on-chain transaction records.
  • Reward System:
- Mint LMSR tokens as rewards for course completion. - Track and distribute rewards to students. - Gamification through token-based incentives.

10. ๐Ÿ›ก๏ธ Middleware & Security

  • Security:
- Input sanitization (XSS protection, HTTP Parameter Pollution prevention). - CORS configuration and helmet integration. - JWT authentication and authorization. - Ethers.js for secure Web3 interactions.
  • Logging:
- Request and response logging with timestamps. - Error tracking and monitoring.
  • API Versioning:
- URL and header-based versioning support.
  • Rate Limiting: Protect against abuse and brute-force attacks.

๐Ÿ“‹ API Endpoints Examples

User Routes

  • POST /api/v1/user/register: Register a new user.
  • POST /api/v1/user/login: Authenticate and log in a user.
  • GET /api/v1/user/all: Fetch all users with pagination.
  • POST /api/v1/user/password-reset: Request password reset.
  • POST /api/v1/user/logout: Logout a user.

Course Routes

  • GET /api/v1/course/all: Get all courses.
  • POST /api/v1/course: Create a new course.
  • GET /api/v1/course/:id: Get a specific course by ID.
  • PUT /api/v1/course/:id: Update a course.
  • DELETE /api/v1/course/:id: Delete a course by ID.
  • POST /api/v1/course/:id/enroll: Enroll in a course.

Tutorial Routes

  • GET /api/v1/tutorial/category/:category: Fetch tutorials by category.
  • GET /api/v1/tutorial/:slug: Get a specific tutorial.
  • POST /api/v1/tutorial: Create a tutorial.
  • PUT /api/v1/tutorial/:id: Update a tutorial.
  • DELETE /api/v1/tutorial/:id: Delete a tutorial.

Blog Routes

  • POST /api/v1/blog: Create a blog.
  • GET /api/v1/blog/all: Get all blogs.
  • GET /api/v1/blog/:id: Get a specific blog.
  • PUT /api/v1/blog/:id: Update a blog.
  • DELETE /api/v1/blog/:id: Delete a blog.

Documentation Routes

  • POST /api/v1/documentation: Add documentation.
  • GET /api/v1/documentation/all: Fetch all documentation.
  • GET /api/v1/documentation/:id: Get specific documentation.
  • PUT /api/v1/documentation/:id: Update documentation.
  • DELETE /api/v1/documentation/:id: Delete documentation.

Review Routes

  • POST /api/v1/review: Add a review.
  • GET /api/v1/review/all: Fetch all reviews.
  • GET /api/v1/review/:id: Get a specific review.
  • DELETE /api/v1/review/:id: Delete a review.

Chat Routes

  • GET /api/v1/chat/conversations: Fetch all conversations for a user.
  • GET /api/v1/chat/conversations/user/:recipientId: Get or create conversation with a user.
  • GET /api/v1/chat/conversations/:conversationId/messages: Fetch messages in a conversation.
  • POST /api/v1/chat/conversations/:conversationId/messages: Send a message.
  • Socket.IO events: message:new, typing:start, typing:stop, typing:update, message:read

Web3 & Wallet Routes

  • POST /api/v1/wallet/nonce: Request nonce for wallet login.
  • POST /api/v1/wallet/verify: Verify wallet signature and login.
  • POST /api/v1/web3/certificate/mint: Mint course completion NFT certificate.
  • GET /api/v1/web3/certificate/:tokenId: Retrieve certificate details.
  • POST /api/v1/web3/token/reward: Mint LMSR reward tokens to student.
  • GET /api/v1/web3/token/balance/:address: Get LMSR token balance.
  • POST /api/v1/web3/payment/intent: Create payment intent for course purchase.
  • POST /api/v1/web3/payment/process: Process USDC course payment.
  • GET /api/v1/web3/verification/:studentAddress/:courseId: Verify course completion status.

Contact Routes

  • POST /api/v1/contact: Submit a contact form.
  • GET /api/v1/contact/all: Fetch all contact submissions.
  • PUT /api/v1/contact/:id: Update a contact submission.
  • DELETE /api/v1/contact/:id: Delete a contact submission.

๐Ÿ—๏ธ Tech Stack

  • Programming Language: JavaScript (99.7%), Solidity (Smart Contracts)
  • Infrastructure: Docker (0.3%)
  • Frameworks & Libraries:
- Backend: Express.js for REST APIs and server management. - Database: MongoDB for document storage and management. - Caching: Redis for session management and caching. - Real-time Communication: Socket.IO for WebSocket-based messaging. - Authentication: JWT (JSON Web Tokens) for secure authentication. - Web3: Ethers.js v6 for Ethereum blockchain interactions. - Smart Contracts: Solidity ^0.8.20, OpenZeppelin contracts.
  • Frontend: React with Vite (included in chat-frontend subdirectory).
  • Blockchain: Ethereum-compatible networks (mainnet, testnets).

๐Ÿ”— Blockchain Setup

Environment Variables for Web3

# Ethereum RPC Configuration
ETHEREUMRPCURL=https://rpc-url-for-your-network
BACKENDWALLETPRIVATEKEY=yourbackendwalletprivate_key

Smart Contract Addresses

CERTIFICATECONTRACTADDRESS=0x... REWARDTOKENCONTRACT_ADDRESS=0x... PAYMENTCONTRACTADDRESS=0x... VERIFICATIONCONTRACTADDRESS=0x... USDCCONTRACTADDRESS=0x...

Smart Contracts Overview

1. CourseCertificateNFT (ERC-721)

Mints course completion certificates as non-fungible tokens.
- mintCertificate(address student, string courseId, uint256 score, string metadataURI)
  • certificateData: Maps tokenId to course details
  • Events: CertificateMinted

2. LMSToken (ERC-20)

Native reward token for incentivizing course completion.
- mintReward(address to, uint256 amount, string reason)
  • Total supply managed by owner
  • Events: RewardMinted

3. CoursePaymentHandler (ERC-20 USDC Handler)

Handles secure USDC stablecoin payments for course access.
- payForCourse(string courseId, uint256 amount)
  • Treasury management for payment collection
  • Events: CoursePaid

4. VerificationRegistry (Completion Tracker)

Tracks and verifies on-chain course completions.
- registerCompletion(address student, string courseId, uint256 score, uint256 certificateTokenId, bytes32 recordHash)
  • isCompleted(address student, string courseId)
  • Immutable completion records

๐Ÿ“ฅ Installation

  • Clone the repository:
git clone https://github.com/Ali-Adel-Nour/LMS.git
  • Navigate to the project directory:
cd LMS
  • Install dependencies:
npm install
  • Set up environment variables:
- Create a .env file in the root directory. - Add the necessary configurations:
# Server Configuration
     PORT=5000
     NODE_ENV=development
     
     # Database
     MONGODB_URI=mongodb://localhost:27017/lms
     
     # Authentication
     JWTSECRET=yourjwtsecretkey
     
     # Redis
     REDIS_URL=redis://localhost:6379
     
     # Frontend
     FRONTEND_URL=http://localhost:5173
     
     # Web3 Configuration
     ETHEREUMRPCURL=https://your-rpc-url
     BACKENDWALLETPRIVATEKEY=yourwalletprivatekey
     CERTIFICATECONTRACTADDRESS=0x...
     REWARDTOKENCONTRACT_ADDRESS=0x...
     PAYMENTCONTRACTADDRESS=0x...
     VERIFICATIONCONTRACTADDRESS=0x...
     USDCCONTRACTADDRESS=0x...
  • Deploy Smart Contracts (Optional):
cd "lms backend/blockchain"
   npm install
   npx hardhat deploy
  • Install frontend dependencies (for chat frontend):
cd "lms backend/chat-frontend"
   npm install
  • Start the development server:
# Backend
   npm run dev

# Frontend (in another terminal) cd "lms backend/chat-frontend" npm run dev


๐Ÿš€ Deployment

Using Docker

docker build -t lms-app .
docker run -p 5000:5000 --env-file .env lms-app

Docker Compose (with MongoDB and Redis)

docker-compose up -d

๐Ÿ“š Project Structure

LMS/
โ”œโ”€โ”€ lms backend/
โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ”œโ”€โ”€ web3Ctrl.js         # Web3 controller for blockchain operations
โ”‚   โ”‚   โ””โ”€โ”€ ...                  # Other controllers
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ web3Routes.js        # Web3 API routes
โ”‚   โ”‚   โ”œโ”€โ”€ walletRoutes.js      # Wallet authentication routes
โ”‚   โ”‚   โ””โ”€โ”€ ...                  # Other routes
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ”œโ”€โ”€ web3Config.js        # Web3 provider and signer setup
โ”‚   โ”‚   โ””โ”€โ”€ ...                  # Other configs
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ web3RecordModel.js   # Web3 transaction records
โ”‚   โ”‚   โ””โ”€โ”€ ...                  # Other models
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ web3Service.js       # Web3 utility functions
โ”‚   โ”‚   โ””โ”€โ”€ ...                  # Other services
โ”‚   โ”œโ”€โ”€ blockchain/
โ”‚   โ”‚   โ”œโ”€โ”€ contracts/           # Solidity smart contracts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CourseCertificateNFT.sol
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LMSToken.sol
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CoursePaymentHandler.sol
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ VerificationRegistry.sol
โ”‚   โ”‚   โ”œโ”€โ”€ hardhat.config.js    # Hardhat configuration
โ”‚   โ”‚   โ””โ”€โ”€ deployments/         # Deployment scripts
โ”‚   โ”œโ”€โ”€ chat-frontend/           # React chat client
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”‚   โ””โ”€โ”€ metamask.html        # Web3 testing interface
โ”‚   โ””โ”€โ”€ app.js
โ”œโ”€โ”€ .env.example                 # Environment variables template
โ”œโ”€โ”€ package.json                 # Dependencies and scripts
โ””โ”€โ”€ README.md                    # Documentation

๐Ÿ’ป Web3 Integration Examples

Wallet Login

// Client-side: Connect wallet and request nonce
const response = await fetch('/api/v1/wallet/nonce', {
  method: 'POST',
  body: JSON.stringify({ walletAddress: userWallet })
});

// Sign the nonce with MetaMask const signature = await signer.signMessage(nonceMessage);

// Verify and login const loginResponse = await fetch('/api/v1/wallet/verify', { method: 'POST', body: JSON.stringify({ walletAddress: userWallet, signature }) });

Mint Certificate

// Server-side: Mint certificate NFT
POST /api/v1/web3/certificate/mint
{
  "studentWalletAddress": "0x...",
  "courseId": "course123",
  "score": 95,
  "metadataURI": "ipfs://..."
}

Process Payment

// Approve USDC and pay for course
POST /api/v1/web3/payment/intent
{
  "courseId": "course123",
  "amountUSDC": "99.99"
}

๐Ÿค Contribution

We welcome contributions! Please follow the contribution guidelines to get started.

Steps to Contribute:

  • Fork the repository.
  • Create a feature branch: git checkout -b feature/your-feature-name
  • Make your changes and commit: git commit -m 'Add your feature'
  • Push to the branch: git push origin feature/your-feature-name
  • Open a pull request.

๐Ÿ”ฎ Future Enhancements

  • Advanced Video Integration: Streaming service integration for high-quality video content.
  • Multi-Chain Support: Expand to Polygon, Arbitrum, and other EVM-compatible networks.
  • DAO Governance: Decentralized governance for course content and platform decisions.
  • Notifications: Email and push notifications for courses, reviews, and messages.
  • Analytics Dashboard: Track user engagement, course completion rates, and on-chain metrics.
  • AI-Powered Recommendations: Suggest courses based on user behavior and blockchain history.
  • DeFi Integration: Stake LMSR tokens for platform benefits and rewards.
  • Advanced Search: Full-text search with filters and AI-powered suggestions.
  • Multi-language Support: Internationalization (i18n) for global users.

๐Ÿ“„ License

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


๐Ÿ“ž Support

For issues, questions, or suggestions, please open an issue on GitHub.


๐Ÿ”— Useful Resources

  • MetaMask: https://metamask.io/
  • Ethers.js Documentation: https://docs.ethers.org/v6/
  • OpenZeppelin Contracts: https://docs.openzeppelin.com/contracts/
  • Solidity Documentation: https://docs.soliditylang.org/

๐Ÿ‘จโ€๐Ÿ’ป Author

Ali Adel Nour GitHub Profile


Last Updated: June 2026 Status: Active Development

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท Ali-Adel-Nour/LMS ยท Updated daily from GitHub