# team-altf4/gradegenie architecture

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

- Interactive diagram: https://gitdiagram.com/team-altf4/gradegenie
- Repository: https://github.com/team-altf4/gradegenie

## Overview

##### Project Type & Purpose
- GradeGenie is a full-stack application with two main parts: a frontend built with React and TypeScript (in the Client directory) and a backend built with Node.js/Express.js (in the Server directory). It also interacts with a MongoDB database.
- Its purpose is to streamline grading, offer performance analytics, and deliver a user-friendly dashboard.

##### Analyzing the File Structure
- Client Directory:
- Contains common React project files such as index.html, main.tsx, and tsconfig files.
- Organized into several folders (Components, Pages, Context API, assets, utils) that indicate separation of concerns:
▪ Components: Reusable UI elements (e.g., AssignmentCard, Dashboard, Sidebar) form the core of the UI.
▪ Pages: Different views (Home, Login, Signup, LandingPage, ErrorRoute) to handle routing.
▪ Context API: Centralized state management which indicates a shared state across components.
- Configuration for tools such as ESLint, Vite, and deployment (vercel.json) are also present.

- Server Directory:
- Contains configurations (Config), middleware for request processing, and schemas (for the database).
- The presence of Middleware, Schema, and Utils directories along with an entry point in index.ts suggests a classic Express.js setup.
- Environment sample file (.env.example) indicates externalized configuration details like DB connection strings, which in production might point toward MongoDB.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend (React + TypeScript)"
        FE1["Main Entry & HTML Template"] 
        FE2["UI Components"]
        FE3["State Management (Context API)"]
        FE4["Routing/Pages"]
        FE5["Utility Functions (Client)"]
    end

    subgraph "Backend (Express.js)"
        BE1["Configuration & Environment"]
        BE2["Middleware"]
        BE3["API Endpoints"]
        BE4["Database Schemas/Models"]
        BE5["Utility Functions (Backend)"]
    end

    DB1["MongoDB Database"]

    %% Frontend to Backend communication
    FE1 -->|"API_calls"| BE3

    %% Backend internal layers
    BE1 -->|"loads"| BE2
    BE2 -->|"handles"| BE3
    BE3 -->|"queries"| BE4
    BE4 -->|"reads/writes"| DB1
    DB1 -->|"returns_data"| BE3
    BE3 -->|"response"| FE1

    %% Styling classes for color coding
    class FE1,FE2,FE3,FE4,FE5 frontend
    class BE1,BE2,BE3,BE4,BE5 backend
    class DB1 database

    %% Click Events - Frontend Components
    click FE1 "https://github.com/team-altf4/gradegenie/blob/main/Client/src/main.tsx"
    click FE2 "https://github.com/team-altf4/gradegenie/tree/main/Client/src/Components/"
    click FE3 "https://github.com/team-altf4/gradegenie/tree/main/Client/src/Context API/"
    click FE4 "https://github.com/team-altf4/gradegenie/tree/main/Client/src/Pages/"
    click FE5 "https://github.com/team-altf4/gradegenie/tree/main/Client/src/utils/"

    %% Click Events - Backend Components
    click BE1 "https://github.com/team-altf4/gradegenie/tree/main/Server/src/Config/"
    click BE2 "https://github.com/team-altf4/gradegenie/tree/main/Server/src/Middleware/"
    click BE3 "https://github.com/team-altf4/gradegenie/blob/main/Server/src/index.ts"
    click BE4 "https://github.com/team-altf4/gradegenie/tree/main/Server/src/Schema/"
    click BE5 "https://github.com/team-altf4/gradegenie/tree/main/Server/src/Utils/"

    %% Class Definitions for color styling
    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#B9770E,stroke-width:2px;
    classDef database fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
```
