How lekhoi2709/lumen works
Project Type & Purpose
• Lumen is a full-stack web-based LMS aimed at enabling educators to create/manage courses and students to access course materials.
• The README clearly outlines features such as course management, content creation, assignments, gradebook, and communication.
• The project is split into a frontend (client) built with React, TypeScript, Vite, TailwindCSS, Tauri (for desktop packaging) and a backend server built with ExpressJS and Node.js. It uses MongoDB for data persistence and Supabase for file storage.
Analyzing the File Structure
• The top-level directories are:
• /client (the frontend side)
• /server (the backend side)
• /docs (documentation)
• In the /client directory you see:
• A clear separation between UI source files (client/src) with components, routes, contexts, layouts, services, etc.
• A Tauri integration area in client/src-tauri that includes Rust code, Tauri configurations, and build scripts. This informs you that the frontend might be packaged as a desktop app.
• The /server directory contains:
• Controllers that handle application logic for admin, courses, users, authentication, and more.
• Models and routes indicating typical MVC organizational patterns.
• Middleware for tasks like authentication and utilities (JWT, email sending).
Key Components
a. Frontend Component:
• Client UI built with React using Vite.
• Tauri module (client/src-tauri) for desktop application support.
• Sub-components: pages (routes), layouts, contexts (e.g., auth, theme), and shared UI components.
• Communication layer via services (API calls) – note the separation into services/api, mutations, and queries.
b. Backend Server:
• ExpressJS server handling REST API endpoints.
• Controllers for administrators, courses, authentication, OTP management, and more.
• Models that interact with the database (MongoDB) and the routing system.
• Middleware for authentication (JWT) and other global tasks.
c. Database:
• Use MongoDB for data persistence (keeping track of courses, users, assignments, etc.).
d. External/Integrations:
• Supabase is used for file storage.
• Tauri integration for building desktop versions (leveraging Rust components).
• Optional external services (e.g., mailing services, OAuth if indicated in controllers).
Architectural Patterns and Design Principles
• Separation of concerns: Frontend (presentation), backend (business logic) and data persistence are clearly separated.
• MVC-like pattern in the backend, where models, views (or controllers) and routes work together.
• API-driven communication: the frontend calls backend APIs using well-defined routes exposed in the server.
• Modular structure in the frontend ensures reusable components and layered architecture (e.g., authentication context separate from UI components).