# mahiyat/academia-task-management architecture

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

- Interactive diagram: https://gitdiagram.com/mahiyat/academia-task-management
- Repository: https://github.com/mahiyat/academia-task-management

## Overview

##### Main Components
- Frontend (Client): Located in the “client” directory, this React application provides the web-based interface. It includes multiple components (e.g., TeacherDashboard, KanbanBoard, ReportGeneration, etc.) and is Dockerized, as indicated by its Dockerfile and package.json.
- Backend (Server): Found in the “server” directory, the Node.js server is structured using an MVC-like layering approach. It houses routes, controllers, services, and models. It is also Dockerized and includes testing, JSDoc documentation, and configuration files.
- Database: The README specifies MongoDB for data storage, with environment variables set up for connecting to a MongoDB instance.
- AI Service (Ollama): This external service is invoked by the backend for AI-driven responses. Environment variables and Docker Compose configuration (including GPU support) are included.
- Infrastructure & Deployment: Docker Compose files (docker-compose.yml and docker-compose-ollama-gpu.yml) indicate that the system’s services are containerized, and CI/CD workflows (GitHub Actions in the .github/workflows folder) are in place.
- Documentation and Testing: The project includes directories for tests and documentation (via JSDoc), providing additional layers to the design.

##### Relationships and Interactions
- The server, acting as the central orchestrator, communicates asynchronously with MongoDB for CRUD operations and with the Ollama AI service for generating AI responses.
- Within the server, illustrate the internal flow: requests hit the API routes, are handled by controllers, have business logic encapsulated in services, and interact with the models for database operations.
- Docker is used to encapsulate the client, server, and possibly the Ollama service. This indicates a microservice-like deployment even if the services are part of the same project.

##### Architectural Patterns/Design Principles
- Use of the MVC pattern on the server side (Routes → Controllers → Services → Models).
- Separation of concerns between frontend and backend.
- Deployment using Docker Compose signifies a containerized microservice approach.
- Clear environment variable configuration allows the system to be flexible (for example, switching between local MongoDB and cloud-based services or adjusting the Ollama service endpoint).

##### Relevant Technologies
- Client: React.js, Yarn/npm, Docker.
- Server: Node.js, Express (implied from controllers/routes), possibly Babel (given the .babelrc), testing frameworks (e.g., Jest or similar for unit tests), and Docker.
- Database: MongoDB (with the connection string provided via environment variables).
- External AI: Ollama AI model, integrated via a REST endpoint.
- CI/CD and Documentation: GitHub Actions for CI, JSDoc for documentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FC("React Client"):::frontend
    end

    %% Backend Layer with internal API Flow
    subgraph "Backend Layer"
        API_Server("Node.js API Server"):::backend
        subgraph "Internal API Flow"
            BSR("Routes"):::backend
            BC("Controllers"):::backend
            BS("Services"):::backend
            BM("Models/DB Layer"):::backend
        end
        API_Server -->|"handles"| BSR
        BSR -->|"to"| BC
        BC -->|"to"| BS
        BS -->|"to"| BM
        BM -->|"queries"| DB
        BS -->|"calls"| AI
    end

    %% Database Node
    DB("MongoDB Database"):::database

    %% External AI Service Node
    AI("Ollama AI Service"):::ai

    %% Infrastructure & Deployment
    subgraph "Infrastructure & Deployment"
        INFR("Deployment (Docker Compose)"):::infrastructure
    end

    %% CI/CD Pipeline
    CICD("CI/CD Pipeline"):::cicd

    %% Testing & Documentation
    subgraph "Testing & Documentation"
        BDOC("Backend Documentation"):::infrastructure
        PDOC("Project Documents"):::infrastructure
        BTEST("Backend Tests"):::infrastructure
        FTEST("Frontend Tests"):::infrastructure
    end

    %% Connections among main components
    FC -->|"HTTPREST"| API_Server
    CICD -->|"deploys"| INFR
    INFR -->|"hosts"| FC
    INFR -->|"hosts"| API_Server
    INFR -->|"hosts"| AI

    %% Styles
    classDef frontend fill:#a8d5e2,stroke:#31708f,stroke-width:2px;
    classDef backend fill:#f3e1d3,stroke:#8a6d3b,stroke-width:2px;
    classDef database fill:#e2f0d9,stroke:#4f8a5f,stroke-width:2px;
    classDef ai fill:#fceabb,stroke:#f8b500,stroke-width:2px;
    classDef cicd fill:#d4c2fc,stroke:#6f42c1,stroke-width:2px;
    classDef infrastructure fill:#e6e6e6,stroke:#999,stroke-width:2px;

    %% Click Events
    click FC "https://github.com/mahiyat/academia-task-management/tree/main/client/"
    click API_Server "https://github.com/mahiyat/academia-task-management/tree/main/server/"
    click AI "https://github.com/mahiyat/academia-task-management/blob/main/docker-compose-ollama-gpu.yml"
    click INFR "https://github.com/mahiyat/academia-task-management/blob/main/docker-compose.yml"
    click CICD "https://github.com/mahiyat/academia-task-management/tree/main/.github/workflows/"
    click BDOC "https://github.com/mahiyat/academia-task-management/tree/main/server/docs/"
    click BTEST "https://github.com/mahiyat/academia-task-management/tree/main/server/test/"
    click FTEST "https://github.com/mahiyat/academia-task-management/blob/main/client/src/App.test.js"
    click PDOC "https://github.com/mahiyat/academia-task-management/blob/main/resources/documents/Academic_Activity_Management_System_SRS.pdf"
```
