Codemia is a comprehensive E-Learning platform designed to manage digital education processes, enhance student experiences, and streamline course administration. Built with a modern PERN stack (PostgreSQL, Express, React, Node.js), it features role-based access control, interactive quizzes, and advanced reporting systems.
- Course Enrollment: Browse and enroll in courses with instant access.
- Interactive Learning: Watch videos, read articles, and take quizzes.
- Progress Tracking: Real-time progress bars powered by the Observer Pattern.
- GPA Calculation: Automated GPA updates based on quiz performance.
- Course Management: Create and edit courses with a rich master-detail interface.
- Content Creation: Add lessons and attach resources (PDF, Video).
- Quiz Builder: Create quizzes with Multiple Choice, True/False, and Short Answer questions using the Factory Pattern.
- User Management: Manage students, instructors, and system admins.
- System Reports: Generate printable HTML reports for system analytics using complex SQL aggregations.
- Data Maintenance: Trigger batch jobs (e.g., GPA recalculation cursors).
This project implements 8 Software Design Patterns to ensure scalability and maintainability:
- Singleton: Manages a single database connection instance to optimize resources.
- Facade: Abstracts complex API fetch logic (
authFetch) into a simple interface. - Factory Method: Centralizes the creation of different question types (Multiple Choice, True/False).
- Observer: Updates UI components (progress bars, badges) automatically when a lesson is completed.
- Strategy: Handles different quiz scoring algorithms (Standard vs. Strict scoring) dynamically.
- Proxy: Configured via Vite to handle API requests and manage CORS between frontend and backend.
- State: Manages complex user role states and UI transitions (Student View vs. Admin View).
- Repository: Decouples business logic from data access layers for Users and Courses.
The project leverages advanced DBMS features rather than just simple CRUD operations:
- Stored Procedures:
enroll_student_in_coursehandles logic checks before inserting data. - Triggers: Automatically updates course progress percentages in the
enrollmentstable when a lesson is completed. - Cursors: Used for batch processing to recalculate student GPAs based on quiz results (
recalculate_all_gpas). - Views:
public_active_coursesfilters unpublished courses from the public API. - Constraints: Extensive use of
CHECK,UNIQUE,ON DELETE CASCADEto ensure data integrity.
- Node.js & npm
- PostgreSQL
git clone [https://github.com/your-username/codemia.git](https://github.com/your-username/codemia.git)
cd codemiaCreate a PostgreSQL database and run the schema script:
psql -U postgres -d codemia -f database/schema.sqlcd server
npm install
# Create a .env file with your DB credentials
# DB_USER=postgres
# DB_PASSWORD=yourpassword
# DB_HOST=localhost
npm run devcd client
npm install
npm run devThe application will run at http://localhost:3000.
📄 License
This project is licensed under the MIT License.