How whiteshadow1234/e-course works
Project type and purpose
• This is a full-stack MERN (MongoDB, Express.js, React, Node.js) web application for managing course enrollment with both user and admin functionality.
• Key features (from README): secure authentication, dynamic course management, interactive weekly schedule, admin controls, type-safe backend, Dockerized deployment.
File structure
• Top-level:
• client/ – React front-end (TypeScript, Jest tests, service layer)
• server/ – Express.js back-end (TypeScript, Mongoose models, Jest tests)
• docker-compose.yml, Dockerfile – container orchestration and builds
• .github/workflows/ci-cd.yml – CI/CD pipeline definition
• client/src/service contains authService & courseService indicating a clear API service layer.
• server/src/models and server/src/routes follow an MVC-like pattern.
• The presence of .env.example in both client & server implies environment-based configuration.
Inspect the README for architectural insights
• The tech stack badges confirm React ≥18, Node.js ≥20, Express ≥4.21, MongoDB ≥6.0, Docker.
• Docker Compose is the recommended deployment mechanism.
• CI/CD via GitHub Actions builds and tests both client and server.
Main components and their interactions
a. Frontend (React SPA)
• Hosts UI: Login, Registration, Schedule Calendar, Course Management
• Communicates over HTTPS/REST to the backend API
b. Backend API (Node.js + Express)
• Exposes auth routes (/login, /register) and course routes (/courses, /enroll)
• Implements business logic, validation, JWT auth, uses Mongoose to talk to MongoDB
c. Database (MongoDB)
• Stores User and Course documents
d. DevOps/Infrastructure
• Docker containers for client, server, and MongoDB (via docker-compose)
• CI/CD service (GitHub Actions) runs tests and builds images
e. External services (optional)
• Hosted database if not running locally
• Container registry (Docker Hub or similar)
• Render.com or other hosting for live demo
Architectural patterns and design principles
• Separation of concerns: UI layer ↔ API layer ↔ Persistence layer
• MVC-style in server: Models (User, Course), Controllers (routes), Services (business logic)
• Service layer in client abstracts API calls into authService & courseService
• Environment-based configuration via .env files
• Containerization to isolate dependencies and simplify deployment