Skip to content

Iflaqbhat/coursel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Coursell - Modern Learning Platform

A comprehensive online learning platform built with React, TypeScript, Node.js, and MongoDB. Coursell provides a modern, scalable solution for course creation, management, and learning.

πŸš€ Features

For Students

  • Browse Courses: Discover courses across multiple categories
  • Course Details: View comprehensive course information with ratings and reviews
  • Purchase System: Secure course enrollment with payment processing
  • Learning Dashboard: Track progress and access purchased courses
  • User Profiles: Manage personal information and learning preferences
  • Responsive Design: Seamless experience across all devices

For Instructors/Admins

  • Course Management: Create, edit, and delete courses with rich content
  • Video Management: Add, organize, and manage course videos
  • Admin Dashboard: Comprehensive analytics and course overview
  • User Management: Monitor student enrollments and progress
  • Content Publishing: Control course visibility and publication status

Technical Features

  • Modern UI/UX: Built with Chakra UI for consistent, beautiful design
  • TypeScript: Full type safety across the entire application
  • Responsive Design: Mobile-first approach with excellent cross-device compatibility
  • Authentication: Secure JWT-based authentication for users and admins
  • API Security: Rate limiting, input validation, and security headers
  • Database: MongoDB with Mongoose for flexible data modeling
  • Real-time Updates: Toast notifications and loading states

πŸ› οΈ Tech Stack

Frontend

  • React 18 - Modern React with hooks and functional components
  • TypeScript - Type-safe development
  • Chakra UI - Component library for consistent design
  • React Router - Client-side routing
  • Axios - HTTP client for API communication
  • React Hot Toast - Toast notifications
  • React Icons - Icon library
  • Vite - Fast build tool and development server

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - MongoDB object modeling
  • JWT - JSON Web Tokens for authentication
  • bcrypt - Password hashing
  • Helmet - Security headers
  • Morgan - HTTP request logger
  • Winston - Logging
  • Express Rate Limit - Rate limiting
  • CORS - Cross-origin resource sharing

πŸ“ Project Structure

coursell/
β”œβ”€β”€ coursell-be/                 # Backend API
β”‚   β”œβ”€β”€ models/                  # Database models
β”‚   β”œβ”€β”€ routes/                  # API routes
β”‚   β”œβ”€β”€ middleware/              # Custom middleware
β”‚   β”œβ”€β”€ validators/              # Input validation
β”‚   β”œβ”€β”€ index.js                 # Server entry point
β”‚   └── package.json
β”œβ”€β”€ coursell-fe/                 # Frontend application
β”‚   └── course-frontend/
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/      # Reusable components
β”‚       β”‚   β”œβ”€β”€ pages/           # Page components
β”‚       β”‚   β”œβ”€β”€ context/         # React context
β”‚       β”‚   β”œβ”€β”€ services/        # API services
β”‚       β”‚   β”œβ”€β”€ styles/          # Global styles
β”‚       β”‚   β”œβ”€β”€ theme.ts         # Chakra UI theme
β”‚       β”‚   └── App.tsx          # Main app component
β”‚       β”œβ”€β”€ public/              # Static assets
β”‚       └── package.json
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (v4.4 or higher)
  • npm or yarn

Installation

  1. Clone the repository

    git clone <repository-url>
    cd coursell
  2. Install backend dependencies

    cd coursell-be
    npm install
  3. Install frontend dependencies

    cd ../coursell-fe/course-frontend
    npm install
  4. Environment Setup

    Create a .env file in the coursell-be directory:

    MONGO_URL=mongodb://localhost:27017/coursell
    JWT_SECRET=your-super-secret-jwt-key
    PORT=3000
    FRONTEND_URL=http://localhost:5173
    NODE_ENV=development
  5. Start MongoDB

    # Make sure MongoDB is running on your system
    mongod
  6. Start the backend server

    cd coursell-be
    npm run dev
  7. Start the frontend development server

    cd coursell-fe/course-frontend
    npm run dev
  8. Access the application

πŸ“š API Documentation

Authentication Endpoints

  • POST /api/user/signup - User registration
  • POST /api/user/signin - User login
  • POST /api/admin/signin - Admin login

Course Endpoints

  • GET /api/courses/preview - Get published courses
  • GET /api/courses/:id - Get course details
  • POST /api/courses/purchase - Purchase a course
  • GET /api/courses/:id/purchase - Check purchase status

Admin Endpoints

  • GET /api/admin/courses - Get all courses (admin)
  • POST /api/admin/course - Create course
  • PUT /api/admin/course - Update course
  • DELETE /api/admin/course/:id - Delete course

User Endpoints

  • GET /api/user/purchases - Get user's purchased courses
  • PUT /api/user/profile - Update user profile

🎨 Design System

The application uses a comprehensive design system built with Chakra UI:

Colors

  • Primary: Purple (#6366f1)
  • Accent: Yellow (#f59e0b)
  • Success: Green (#22c55e)
  • Error: Red (#ef4444)

Typography

  • Font Family: Inter
  • Headings: Bold with tight letter spacing
  • Body: Regular weight with good line height

Components

  • Buttons: Multiple variants (solid, outline, ghost, accent)
  • Cards: Rounded corners with hover effects
  • Forms: Consistent styling with validation states
  • Badges: Color-coded for different purposes

πŸ”’ Security Features

  • JWT Authentication: Secure token-based authentication
  • Password Hashing: bcrypt for password security
  • Input Validation: Comprehensive validation on all inputs
  • Rate Limiting: Protection against brute force attacks
  • CORS Configuration: Secure cross-origin requests
  • Security Headers: Helmet.js for additional security
  • Environment Variables: Sensitive data protection

πŸ§ͺ Testing

Backend Testing

cd coursell-be
npm test

Frontend Testing

cd coursell-fe/course-frontend
npm test

πŸ“¦ Deployment

Backend Deployment

  1. Set up environment variables for production
  2. Build the application: npm run build
  3. Start the server: npm start

Frontend Deployment

  1. Build the application: npm run build
  2. Deploy the dist folder to your hosting service

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Add feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

πŸ“„ License

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

πŸ†˜ Support

For support and questions:

πŸ™ Acknowledgments

  • Chakra UI for the excellent component library
  • React team for the amazing framework
  • MongoDB for the flexible database solution
  • All contributors who helped build this platform

Made with ❀️ by the Coursell team

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors