# aihamjassar/online_courses_web_project architecture

> Architecture diagram of the GitHub repository aihamjassar/online_courses_web_project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aihamjassar/online_courses_web_project
- Repository: https://github.com/aihamjassar/online_courses_web_project

## Overview

##### Project Type and Purpose
- This is a full-stack, web-based learning platform front-end (HTML/CSS/JS/React) coupled with a Node.js/Express backend and MongoDB database.
- Purpose: let users browse/enroll in courses, track progress, and allow admins to manage content.

##### File Structure
- Top-level files:
- index.html – entry point
- css/ – style sheets (normalize.css, style.css)
- javascript/main.js – front-end behavior hooks (likely augmented by React)
- images/, webfonts/, screenshots/ – static assets
- Missing actual React components folder suggests this snapshot is the static front end; the back end lives elsewhere (per README).

##### README for Additional Insights
- Front-end tech: React, plain HTML/CSS/JS
- Backend: Node.js + Express
- Database: MongoDB
- Key features: authentication, course catalog, progress tracking, admin panel

##### Main Components
a. Client (Browser/Front-end)
- Static assets served: index.html, CSS, JS, images, fonts
- React app (renders UI, handles routing, triggers AJAX/REST calls)
b. API Gateway / Web Server
- Node.js + Express
- Exposes REST endpoints: /auth, /courses, /progress, /admin
c. Business Logic Layer
- Express middleware and controllers implementing authentication, course queries, progress updates, admin operations
d. Database
- MongoDB collections: Users, Courses, ProgressRecords, etc.
e. External Services (optional)
- Email service (for registration verification)
- Payment gateway (if monetization planned)

##### Relationships and Data Flow
- Browser → HTTP(S) GET/POST to Express server
- Express → CRUD operations on MongoDB
- Express → External service (e.g., SMTP)
- Data flows back → JSON responses → React app updates UI

##### Design Patterns and Principles
- Separation of concerns: static front-end vs. API layer vs. data persistence
- REST architectural style for API endpoints
- MVC-inspired layers inside the Node/Express back end (Routes → Controllers → Models)
- Single-page-application pattern in React (client-side routing + state management)

##### Final Checklist
- [ ] Components: Browser/React SPA, Express API, MongoDB, External Services
- [ ] Annotations of key technologies (React, Express.js, MongoDB)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Browser"
        Browser["Browser / React SPA"]:::frontend
    end

    subgraph "Web Server / CDN"
        direction TB
        SF["Static File Handler"]:::backend
        subgraph "Static Assets"
            direction TB
            index["index.html"]:::frontend
            css["css/"]:::frontend
            js["javascript/main.js"]:::frontend
            img["images/"]:::frontend
            fonts["webfonts/"]:::frontend
            ss["screenshots/"]:::frontend
        end
    end

    subgraph "Backend (Node.js / Express)"
        API["Express REST API"]:::backend
    end

    DB["MongoDB"]:::database

    subgraph "External Services"
        direction TB
        Email["Email Service"]:::external
        Payment["Payment Gateway"]:::external
    end

    subgraph "Project Documentation"
        direction TB
        README["README.md"]:::metadata
        LICENSE["LICENSE"]:::metadata
    end

    Browser -->|"HTTPS GET Static Assets"| SF
    SF --> index
    SF --> css
    SF --> js
    SF --> img
    SF --> fonts
    SF --> ss

    Browser -->|"HTTPS REST calls"| API
    API -->|"CRUD queries"| DB
    API -->|"SMTP calls"| Email
    API -->|"Payment API calls"| Payment

    click index "https://github.com/aihamjassar/online_courses_web_project/blob/main/index.html"
    click css "https://github.com/aihamjassar/online_courses_web_project/tree/main/css/"
    click js "https://github.com/aihamjassar/online_courses_web_project/blob/main/javascript/main.js"
    click img "https://github.com/aihamjassar/online_courses_web_project/tree/main/images/"
    click fonts "https://github.com/aihamjassar/online_courses_web_project/tree/main/webfonts/"
    click ss "https://github.com/aihamjassar/online_courses_web_project/tree/main/screenshots/"
    click README "https://github.com/aihamjassar/online_courses_web_project/blob/main/README.md"
    click LICENSE "https://github.com/aihamjassar/online_courses_web_project/tree/main/LICENSE"

    classDef frontend fill:#D0E6FF,stroke:#005B96
    classDef backend fill:#D0FFD6,stroke:#2E8B57
    classDef database fill:#FFDD99,stroke:#CC8400,stroke-width:2px
    classDef external fill:#F0F0F0,stroke:#888,stroke-dasharray:5 5
    classDef metadata fill:#EEEEEE,stroke:#AAA
```
