Skip to content

satyam0709/CSEdge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CSEdge

⚑ CSEdge β€” Full Stack Learning & Placement Platform

Learn Smart. Prepare Right. Succeed Big.

React Node.js MongoDB Stripe Clerk Tailwind CSS Cloudinary


A production-grade Learning Management System built for CS students preparing for placements. Combines video courses, multi-category practice tests, company-wise interview prep, and separate educator/student dashboards β€” all in one platform.


πŸš€ Live Demo Β β€’Β  πŸ“Έ Screenshots Β β€’Β  βš™οΈ Setup Β β€’Β  πŸ—οΈ Architecture


πŸ“Έ Screenshots

Add your actual screenshots in a /screenshots folder and update the paths below.

Home Page Course Player
Home Player
Practice Tests Company Interview Prep
Practice Companies
Educator Dashboard Student Enrollments
Educator Enrollments

✨ Features

πŸŽ“ For Students

  • Video Courses β€” Watch YouTube-embedded lectures directly inside the platform (no redirect)
  • Chapter-wise Progress β€” Track completed lectures with a visual progress bar
  • Free & Paid Courses β€” Free courses enroll instantly; paid courses go through Stripe Checkout
  • Practice Tests β€” 4 categories Γ— 50 levels Γ— 15 questions each
  • Company Interview Prep β€” 70+ companies grouped by sector (MAANG, Fintech, Startups, etc.)
  • My Enrollments β€” All enrolled courses in one place with resume support
  • Ratings β€” Rate courses with a star rating system

πŸ‘©β€πŸ« For Educators

  • Course Builder β€” Add courses with chapters, lectures, thumbnails, and pricing
  • Student Analytics β€” See total enrollments, earnings, and student list
  • Publish / Unpublish β€” Control course visibility with a toggle
  • Manage Courses β€” Full CRUD (create, edit, delete) from the admin panel

πŸ›‘οΈ Platform

  • Clerk Authentication β€” Social login, JWT-secured API, auto user creation
  • Stripe Payments β€” Checkout sessions, webhook-verified enrollment
  • Cloudinary β€” Image & thumbnail uploads
  • Role-based Access β€” Student / Educator / Admin roles
  • Responsive Design β€” Works on mobile, tablet, and desktop

πŸ—οΈ Architecture

csedge/
β”œβ”€β”€ client/                        # React Frontend (Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ student/           # Home, CourseList, CourseDetails, Player, MyEnrollments
β”‚   β”‚   β”‚   β”œβ”€β”€ educator/          # Dashboard, MyCourses, AddCourse, StudentEnrolled
β”‚   β”‚   β”‚   β”œβ”€β”€ AptitudeTest.jsx   # 50-level aptitude tests
β”‚   β”‚   β”‚   β”œβ”€β”€ CodingTest.jsx     # DSA coding challenges
β”‚   β”‚   β”‚   β”œβ”€β”€ DevTest.jsx        # Full-stack dev questions
β”‚   β”‚   β”‚   └── CompanyInterview.jsx # Company-wise prep (6 categories, 70+ companies)
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ student/           # Navbar, CourseCard, CoursesSection, Hero, Footer
β”‚   β”‚   β”‚   └── educator/          # Sidebar, Navbar, Dashboard widgets
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── AppContext.jsx     # Global state β€” courses, user, auth helpers
β”‚   β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   β”‚   └── AdminCourses.jsx   # Full CRUD course management panel
β”‚   β”‚   └── utils/
β”‚   β”‚       └── axios.js           # Axios instance with base URL
β”‚
└── server/                        # Node.js + Express Backend
    β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ user.js                # User schema (enrolledCourses, role)
    β”‚   β”œβ”€β”€ course.js              # Course β†’ chapters β†’ lectures (nested)
    β”‚   β”œβ”€β”€ Purchase.js            # Stripe purchase records
    β”‚   β”œβ”€β”€ CourseProgress.js      # Per-user lecture completion tracking
    β”‚   β”œβ”€β”€ TestAttempt.js         # Test session records
    β”‚   β”œβ”€β”€ TestProgress.js        # Level unlock tracking
    β”‚   └── ExternalProblem.js     # User-saved problem links
    β”œβ”€β”€ controllers/
    β”‚   β”œβ”€β”€ userController.js      # Auth, enrollment, progress, ratings
    β”‚   β”œβ”€β”€ courseController.js    # Course CRUD, publish toggle
    β”‚   β”œβ”€β”€ educatorController.js  # Educator stats and management
    β”‚   β”œβ”€β”€ testController.js      # Questions, attempts, scoring
    β”‚   β”œβ”€β”€ adminController.js     # Admin-level overrides
    β”‚   └── webhooks.js            # Stripe webhook handler
    β”œβ”€β”€ routes/
    β”‚   β”œβ”€β”€ app-user-routes.js
    β”‚   β”œβ”€β”€ app-course-routes.js
    β”‚   β”œβ”€β”€ app-educator-routes.js
    β”‚   β”œβ”€β”€ app-test-routes.js
    β”‚   β”œβ”€β”€ app-admin-routes.js
    β”‚   └── app-company-articles-routes.js
    β”œβ”€β”€ middleware/
    β”‚   └── authMiddleware.js      # Clerk requireAuth + role protection
    └── server.js                  # Express app entry point

🧰 Tech Stack

Layer Technology Purpose
Frontend React 18 + Vite UI framework with fast HMR
Styling Tailwind CSS Utility-first responsive design
Routing React Router v6 Client-side navigation
Auth Clerk JWT auth, OAuth, session management
State React Context API Global course/user state
Backend Node.js + Express REST API server
Database MongoDB + Mongoose Document storage for nested data
Payments Stripe Checkout sessions + webhooks
Media Cloudinary Thumbnail/image hosting
Video YouTube Embed API In-platform video playback
Icons Lucide React Consistent icon library
Notifications React Toastify User feedback toasts
Deployment Vercel (client) + Railway/Render (server) Cloud hosting

πŸ—„οΈ Database Schema (Key Models)

Course

{
  courseTitle: String,
  courseDescription: String,     // Rich HTML
  courseThumbnail: String,       // Cloudinary URL
  coursePrice: Number,
  discount: Number,              // 0–100 percent
  isPublished: Boolean,
  educator: String,              // Clerk userId
  enrolledStudents: [String],
  courseRatings: [{ userId, rating }],
  courseContent: [{              // Chapters
    chapterId, chapterTitle, chapterOrder,
    chapterContent: [{           // Lectures
      lectureId, lectureTitle, lectureUrl,   // YouTube embed URL
      lectureDuration, isPreviewFree, lectureOrder
    }]
  }]
}

User

{
  _id: String,                   // Clerk userId
  name, email, imageUrl,
  enrolledCourses: [ObjectId],   // ref: Course
  role: String                   // student | educator | admin
}

Purchase

{
  courseId, userId,
  amount: Number,                // 0 for free courses
  status: String,                // pending | completed | failed
  stripeSessionId: String
}

βš™οΈ Getting Started

Prerequisites

1. Clone the repository

git clone https://github.com/YOUR_USERNAME/csedge.git
cd csedge

2. Setup the Server

cd server
npm install

Create server/.env:

MONGODB_URI=mongodb+srv://your-cluster-url
CLERK_SECRET_KEY=sk_test_xxxxxxxxxxxx
STRIPE_SECRET_KEY=sk_test_xxxxxxxxxxxx
STRIPE_WEBHOOK_SECRET=whsec_xxxxxxxxxxxx
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
CURRENCY=inr
PORT=5000
npm run dev

3. Setup the Client

cd ../client
npm install

Create client/.env.local:

VITE_CLERK_PUBLISHABLE_KEY=pk_test_xxxxxxxxxxxx
VITE_BACKEND_URL=http://localhost:5000
npm run dev

4. Seed the Courses (optional)

cd server
node scripts/seedCourses.js

This seeds 4 real YouTube playlist courses:

  • ⚑ Namaste JavaScript (Akshay Saini)
  • βš›οΈ Chai aur React (Hitesh Choudhary)
  • πŸ’» DSA with C++ (Apna College)
  • 🌐 Full Stack Web Dev Bootcamp

5. Configure Stripe Webhook (local testing)

# Install Stripe CLI
stripe listen --forward-to localhost:5000/stripe

πŸ”Œ API Reference

User Routes β€” /api/user

Method Endpoint Description
GET /data Get current user profile
GET /enrolled-courses Get all enrolled courses
POST /purchase Create Stripe checkout session
POST /enroll-free Directly enroll in a free course
POST /update-course-progress Mark lecture as completed
POST /get-course-progress Get progress for a course
POST /add-rating Rate a course (1–5 stars)
GET /dashboard Get test stats and course counts

Course Routes β€” /api/course

Method Endpoint Description
GET /all Get all published courses
GET /:id Get single course with content

Educator Routes β€” /api/educator

Method Endpoint Description
GET /courses Get educator's own courses
POST /add-course Create new course
PUT /update-course/:id Update course details
DELETE /delete-course/:id Delete a course
GET /dashboard Get earnings and enrollments

Test Routes β€” /api/test

Method Endpoint Description
GET /questions Get questions by type and level
POST /attempt Submit test answers
GET /progress/:type Get unlocked levels

πŸ§ͺ Practice Test System

4 Categories Γ— 50 Levels Γ— 15 Questions = 3,000+ Questions

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Category        β”‚ Coverage                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Aptitude        β”‚ Quant, Verbal, Logical Reasoning         β”‚
β”‚ DSA & Coding    β”‚ Arrays β†’ Graphs β†’ DP (50 levels)        β”‚
β”‚ Full Stack Dev  β”‚ HTML/CSS/JS/React/Node/MongoDB           β”‚
β”‚ Company-wise    β”‚ Google, Amazon, Microsoft, etc.          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Level unlock: Score β‰₯ 70% to unlock the next level

πŸ” Authentication Flow

User visits app
      β”‚
      β–Ό
Clerk handles login (Google / GitHub / Email)
      β”‚
      β–Ό
JWT token stored in browser
      β”‚
      β–Ό
Every API request: Authorization: Bearer <token>
      β”‚
      β–Ό
Server: requireAuth() middleware validates token
      β”‚
      β–Ό
req.auth().userId β†’ fetch/create user in MongoDB

πŸ’³ Payment Flow

Student clicks "Buy Now"
        β”‚
        β–Ό
POST /api/user/purchase
        β”‚
        β”œβ”€ Free course (price = 0)?
        β”‚       β”‚
        β”‚       β–Ό
        β”‚  POST /api/user/enroll-free
        β”‚  β†’ Add to enrolledCourses directly
        β”‚  β†’ Redirect to Player
        β”‚
        └─ Paid course?
                β”‚
                β–Ό
          Stripe Checkout Session created
                β”‚
                β–Ό
          User completes payment on Stripe
                β”‚
                β–Ό
          Stripe webhook β†’ /stripe
                β”‚
                β–Ό
          Purchase status β†’ "completed"
          User.enrolledCourses updated
                β”‚
                β–Ό
          Redirect to My Enrollments

🀝 Contributing

Contributions are welcome! Here's how:

# Fork the repo, then:
git checkout -b feature/your-feature-name
git commit -m "feat: add your feature"
git push origin feature/your-feature-name
# Open a Pull Request

Please follow Conventional Commits for commit messages.


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Satyam Kumar

GitHub LinkedIn


⭐ Star this repo if you found it helpful! ⭐

Built with ❀️ for CS students aiming for their dream companies

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages