Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

128 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ“ Lucent

Transforming Advanced Software Learning into Engaging Daily Challenges

Next.js React MongoDB Clerk Stripe

Lucent is an innovative learning platform that breaks down complex software engineering books into engaging, bite-sized daily challenges. Born from the struggle of understanding dense technical literature, Lucent makes mastering advanced concepts both achievable and enjoyable.

๐Ÿ“‹ Table of Contents

๐ŸŽฏ The Problem

As a software engineer or student, you've likely faced these challenges:

  • ๐Ÿ“š Struggling through 800-page technical books
  • ๐Ÿ˜ต Feeling overwhelmed by complex concepts
  • ๐Ÿ“… Difficulty maintaining consistent learning habits
  • ๐ŸŽฎ Lack of interactive elements in traditional learning
  • โšก No immediate feedback or reinforcement

โœจ The Solution

Lucent transforms the learning experience through:

  • โฑ๏ธ Daily 15-minute interactive lessons
  • ๐ŸŽฎ Gamified learning with XP and rewards
  • ๐Ÿ“Š Progress tracking and streaks
  • ๐Ÿงฉ Interactive quizzes and exercises
  • ๐Ÿ‘ฅ Community learning features
  • ๐Ÿค– AI-powered hints and guidance

๐Ÿš€ Key Features

๐Ÿ“– Course Management

  • Structured Learning Paths: Courses organized into chapters and lessons
  • Course Enrollment: Easy enrollment with progress tracking
  • Course Details: Comprehensive course information with ratings and reviews
  • Prerequisites: Smart prerequisite checking for course progression

๐Ÿ“š Interactive Lessons

  • Bite-sized Content: 15-minute daily lessons broken into digestible parts
  • Rich Content: Markdown support with code blocks and formatted text
  • Progress Tracking: Track completion status for each lesson part
  • Lesson Navigation: Easy navigation between lessons and chapters

๐Ÿงฉ Exercise Types

Lucent supports multiple interactive exercise types:

  1. Multiple Choice: Traditional multiple-choice questions with immediate feedback
  2. Fill-in-the-Blanks: Dropdown-based fill-in exercises with shuffled options
  3. Short Answer: Flexible text input with multiple acceptable answers
  4. Drag and Drop: Interactive matching exercises (desktop and mobile-friendly)
  5. Code Challenges: Programming exercises with Monaco editor integration
  6. True/False: Simple true/false questions

๐ŸŽฏ Quiz System

  • Lesson Quizzes: End-of-lesson assessments
  • Chapter Quizzes: Comprehensive chapter reviews
  • Final Course Exam: Complete course evaluation
  • Daily Quiz Limits:
    • Free tier: 1 quiz per day
    • PRO tier: 5 quizzes per day
  • Passing Scores: Configurable passing thresholds
  • Detailed Feedback: Explanations for each question

๐ŸŽฎ Gamification

  • XP System: Earn experience points for completing lessons and exercises
  • Gems: Virtual currency earned through learning activities
  • Level Progression: Level up as you gain XP
  • Achievement Badges:
    • First Quiz Completed
    • Streak milestones (5-day, 10-day, etc.)
    • Course completion badges
  • Daily Streaks: Maintain learning consistency with streak tracking
  • Visual Rewards: Confetti animations and notifications for achievements

๐Ÿ“Š Progress Tracking

  • Visual Progress Bars: See your progress at course, chapter, and lesson levels
  • Completion Metrics: Track completion percentages
  • Time Tracking: Monitor time spent on lessons
  • Performance Analytics: View scores and performance history
  • Last Activity: Track your learning activity timeline

๐Ÿ’ณ Subscription System

  • Three Tiers: FREE, PRO, and ENTERPRISE
  • Stripe Integration: Secure payment processing
  • Subscription Management: Easy upgrade/downgrade and billing management
  • Tier-based Limits: Different access levels per subscription tier

๐Ÿ‘จโ€๐Ÿ’ผ Admin Panel

  • Course Management: Create, edit, and delete courses
  • User Management: View and manage user accounts
  • Enrollment Tracking: See enrolled students per course
  • Subscription Management: Manage user subscriptions
  • Migration Tools: Admin utilities for data migration

๐Ÿ”” Notifications & Feedback

  • Real-time Notifications: Toast notifications for actions
  • Badge Notifications: Celebrate achievements
  • XP Notifications: Show XP gains and level-ups
  • Error Handling: User-friendly error messages

๐Ÿ›  Technology Stack

Frontend

  • Next.js 15.1.6 - React framework with App Router
  • React 18.2.0 - UI library
  • Tailwind CSS 3.4.1 - Utility-first CSS framework
  • Framer Motion 12.6.3 - Animation library
  • Lucide React 0.474.0 - Icon library
  • React Hot Toast 2.5.2 - Toast notifications
  • React Confetti 6.2.3 - Celebration animations
  • Monaco Editor 4.6.0 - Code editor component
  • Radix UI - Accessible UI primitives
  • React Beautiful DnD - Drag and drop functionality

Backend

  • Next.js API Routes - Serverless API endpoints
  • MongoDB 6.12.0 - NoSQL database
  • Mongoose 8.9.5 - MongoDB object modeling
  • Node.js 18+ - Runtime environment

Authentication & Payments

  • Clerk 6.10.3 - Authentication and user management
  • Stripe 15.12.0 - Payment processing and subscriptions
  • Svix 1.64.0 - Webhook verification

Development Tools

  • ESLint 9 - Code linting
  • PostCSS 8 - CSS processing
  • Git - Version control

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18 or higher
  • MongoDB database (local or Atlas)
  • Clerk account
  • Stripe account (for subscriptions)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/Lucent.git
    cd Lucent
  2. Install dependencies

    npm install
  3. Set up environment variables (see Environment Variables)

  4. Run the development server

    npm run dev
  5. Open http://localhost:3000 in your browser

Build for Production

npm run build
npm start

๐Ÿ” Environment Variables

Create a .env.local file in the root directory:

# MongoDB
MONGODB_URI=your_mongodb_connection_string

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/

# Stripe (for subscriptions)
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
STRIPE_WEBHOOK_SECRET=whsec_your_stripe_webhook_secret
STRIPE_PRICE_PRO_MONTHLY=price_xxxxx
STRIPE_PRICE_PRO_YEARLY=price_xxxxx
STRIPE_PRICE_ENTERPRISE_YEARLY=price_xxxxx

# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000

See SUBSCRIPTION_SETUP.md for detailed Stripe setup instructions.

๐Ÿ“ Project Structure

Lucent/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                    # Next.js App Router pages
โ”‚   โ”‚   โ”œโ”€โ”€ api/                # API routes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ admin/          # Admin endpoints
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ courses/        # Course management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ lessons/        # Lesson endpoints
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ quizzes/        # Quiz endpoints
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ profile/        # User profile
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ billing/        # Stripe integration
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ webhooks/        # Webhook handlers
โ”‚   โ”‚   โ”œโ”€โ”€ admin/              # Admin panel pages
โ”‚   โ”‚   โ”œโ”€โ”€ course-details/     # Course detail pages
โ”‚   โ”‚   โ”œโ”€โ”€ lesson/             # Lesson pages
โ”‚   โ”‚   โ”œโ”€โ”€ quiz/               # Quiz pages
โ”‚   โ”‚   โ”œโ”€โ”€ profile/            # User profile page
โ”‚   โ”‚   โ””โ”€โ”€ components/         # Page-specific components
โ”‚   โ”œโ”€โ”€ components/             # Shared React components
โ”‚   โ”‚   โ”œโ”€โ”€ exercises/          # Exercise components
โ”‚   โ”‚   โ””โ”€โ”€ ui/                 # UI primitives
โ”‚   โ”œโ”€โ”€ models/                 # Mongoose models
โ”‚   โ”‚   โ”œโ”€โ”€ User.js             # User schema
โ”‚   โ”‚   โ”œโ”€โ”€ Course.js           # Course schema
โ”‚   โ”‚   โ””โ”€โ”€ Exercise.js         # Exercise schema
โ”‚   โ”œโ”€โ”€ lib/                    # Utility libraries
โ”‚   โ”‚   โ”œโ”€โ”€ mongodb.js          # Database connection
โ”‚   โ”‚   โ”œโ”€โ”€ stripe.js           # Stripe configuration
โ”‚   โ”‚   โ”œโ”€โ”€ badgeDefinitions.js # Badge system
โ”‚   โ”‚   โ””โ”€โ”€ rewards.js          # Reward calculations
โ”‚   โ”œโ”€โ”€ hooks/                  # Custom React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ useEnrollmentCheck.js
โ”‚   โ”‚   โ””โ”€โ”€ useSubscription.js
โ”‚   โ”œโ”€โ”€ data/                   # Course data
โ”‚   โ”‚   โ”œโ”€โ”€ seedCourse.js       # Course seed data
โ”‚   โ”‚   โ””โ”€โ”€ designPatternsCourse.js
โ”‚   โ””โ”€โ”€ contexts/               # React contexts
โ”œโ”€โ”€ public/                     # Static assets
โ”œโ”€โ”€ docs/                       # Documentation
โ”œโ”€โ”€ scripts/                    # Utility scripts
โ””โ”€โ”€ package.json

๐Ÿ’Ž Subscription Tiers

FREE Tier

  • โœ… Access to 2 courses
  • โœ… 3 lessons per day
  • โœ… 5 exercises per day
  • โœ… 1 quiz per day
  • โœ… Basic progress tracking
  • โœ… Daily streaks

PRO Tier (ยฃ20/month or ยฃ200/year)

  • โœ… Unlimited courses
  • โœ… Unlimited lessons
  • โœ… Unlimited exercises
  • โœ… 5 quizzes per day
  • โœ… Priority support
  • โœ… All FREE tier features

ENTERPRISE Tier

  • โœ… Everything in PRO
  • โœ… Custom features
  • โœ… Dedicated support
  • โœ… Custom integrations

๐Ÿ‘จโ€๐Ÿ’ผ Admin Features

The admin panel (/admin) provides:

  • Course Management

    • Create new courses with full editor
    • Edit existing courses
    • Delete courses
    • View enrolled students per course
  • User Management

    • View all users
    • Manage user roles (USER/ADMIN)
    • Update subscription tiers
    • View user progress
  • Migration Tools

    • Migrate users to subscription system
    • Data cleanup utilities

๐Ÿ— Architecture

Lucent follows a modern full-stack architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Next.js App   โ”‚
โ”‚  (Frontend +    โ”‚
โ”‚   API Routes)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
    โ”‚         โ”‚
โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”
โ”‚ Clerk โ”‚ โ”‚Stripe โ”‚
โ”‚ (Auth)โ”‚ โ”‚(Pay)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”
    โ”‚ MongoDB โ”‚
    โ”‚  Atlas  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Architectural Decisions

  • Server Components: Leverages Next.js 15 App Router for optimal performance
  • API Routes: RESTful API endpoints for all backend operations
  • MongoDB: Flexible schema for course content and user progress
  • Clerk: Managed authentication to focus on core features
  • Stripe: Industry-standard payment processing

๐Ÿงช Exercise System

The platform supports multiple exercise types with rich feedback:

  • Multiple Choice: Standard MCQ with explanations
  • Fill-in-the-Blanks: Dropdown-based with shuffled options
  • Short Answer: Flexible matching with multiple acceptable answers
  • Drag and Drop: Interactive matching (desktop & mobile)
  • Code Challenges: Monaco editor integration
  • True/False: Simple binary questions

See docs/short-answer-guide.md for exercise formatting details.

๐Ÿ“ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is private and proprietary. All rights reserved.

๐Ÿ™ Acknowledgments


Made with โค๏ธ for developers who want to master advanced software engineering concepts

Releases

Packages

Used by

Contributors

Languages