Overview
SkillRise follows a monorepo structure with clear separation between frontend and backend. The project is organized into two main directories:client/ for the React frontend and server/ for the Express backend.
The project uses modern tooling including Vite for frontend builds, Docker for containerization, and GitHub Actions for CI/CD.
Root Directory Structure
Client Architecture
The frontend is built with React 19, Vite, and Tailwind CSS, following a feature-based organization pattern.Client Directory Tree
The client uses feature-based organization where components are grouped by domain (admin, educator, student, community) rather than by type.
Server Architecture
The backend follows an MVC-inspired pattern with clear separation of concerns across controllers, models, routes, and middlewares.Server Directory Tree
Models
14 Mongoose schemas defining the data structure for users, courses, quizzes, community features, and more.
Controllers
10 controller files handling business logic for admin, educator, student, and AI features.
Routes
6 route modules organizing API endpoints by feature domain with appropriate auth middleware.
Webhooks
Clerk user sync and Stripe payment webhooks for real-time integrations.
API Route Organization
The server exposes RESTful APIs organized by feature domain:| Route Prefix | Authentication | Purpose |
|---|---|---|
GET / | Public | Health check endpoint |
POST /clerk | Clerk signature | User synchronization webhook |
POST /stripe | Stripe signature | Payment fulfillment webhook |
/api/course | Public | Course browsing, search, details |
/api/user | Clerk (any user) | Enrollments, progress, AI features |
/api/educator | Educator role | Course creation, analytics |
/api/admin | Admin role | Platform management |
/api/community | Clerk (any user) | Groups, posts, discussions |
/api/quiz | Clerk (any user) | Quiz generation, submissions |
Technology Stack by Layer
Frontend Stack
- Framework: React 19 with React DOM
- Build Tool: Vite 6 for fast development and optimized builds
- Styling: Tailwind CSS with custom configuration
- UI Components: Radix UI primitives, Lucide icons
- Routing: React Router v7
- State Management: Context API (AppContext, ThemeContext)
- Authentication: Clerk React SDK
- Payments: Stripe embedded checkout
- Media Player: React Player for video playback
- Markdown: React Markdown with GitHub-flavored markdown
- Charts: Recharts for analytics visualization
- Code Quality: ESLint + Prettier
Backend Stack
- Runtime: Node.js 20+
- Framework: Express 5
- Database: MongoDB with Mongoose ODM
- Authentication: Clerk Express SDK with @clerk/express
- Payments: Stripe Node SDK
- AI/ML: Groq SDK for LLaMA models
- Media Storage: Cloudinary for image/video uploads
- File Upload: Multer middleware
- Security: Helmet for headers, express-rate-limit
- Webhooks: Svix for Clerk webhook verification
- Web Scraping: Puppeteer for roadmap generation
- Validation: Zod schemas
- Code Quality: ESLint + Prettier
DevOps & Tooling
- Containerization: Docker with multi-stage builds
- Orchestration: Docker Compose for local development
- CI/CD: GitHub Actions workflows
- Version Control: Git with feature branch workflow
- Package Management: npm with package-lock.json
Database Schema Overview
SkillRise uses MongoDB with the following main collections:Core Collections
Core Collections
- users: User profiles, roles, enrolled courses
- courses: Course metadata, chapters, lectures, educator info
- purchases: Transaction history with Stripe payment IDs
- courseProgresses: Per-user progress tracking for each course
Learning Features
Learning Features
- quizzes: AI-generated quizzes per chapter
- quizResults: Student quiz submissions and scores
- timeTrackings: Learning session time logs
- aiChats: Chat conversation history with AI assistant
- certificates: Course completion certificates
Community Features
Community Features
- groups: Community groups by category
- groupMemberships: User group memberships
- communityPosts: Discussion posts within groups
- replies: Threaded replies to posts
Admin Features
Admin Features
- educatorApplications: Pending educator role applications
Configuration Files
Environment Variables
The project requires environment configuration in two locations:Docker Architecture
Multi-Container Setup
Thedocker-compose.yml orchestrates two services:
Server Container
Runs the Express API on port 3000 with environment variables loaded from
server/.env.Key Design Patterns
Component Organization
- Feature-based folders: Components grouped by domain (admin, educator, student)
- Shared components: Reusable UI elements in
components/shared/andcomponents/ui/ - Smart vs Presentational: Pages handle data fetching, components handle rendering
State Management
- AppContext: Global user state, authentication status
- ThemeContext: Dark/light mode preference with localStorage persistence
- Local state: Component-level state with useState for UI interactions
API Design
- RESTful routes: Resource-based endpoints with standard HTTP methods
- Controller pattern: Business logic separated from route definitions
- Middleware chain: Auth → Role guards → Controller → Response
- Error handling: Centralized error responses with appropriate status codes
Data Flow
Build Output
Client Build
Server Build
The server runs directly from source using Node.js with ES modules.Production deployments use Docker images pushed to Docker Hub via GitHub Actions on every merge to
main.