# aleryp/masterproject architecture

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

- Interactive diagram: https://gitdiagram.com/aleryp/masterproject
- Repository: https://github.com/aleryp/masterproject

## Overview

##### Project Type and Purpose
- Project Type: This is a full-stack web application built using Django. It is containerized with Docker & Docker-Compose.
- Purpose: The project, titled “ShuGenAI”, integrates AI/ML functionalities (as indicated by the AI API configuration and specific directories for image AI utilities) and standard web functionalities (user management, feature modules). The README details system requirements (GPU, RAM, etc.) and configuration for a Postgres database, email service (Gmail), and AI API, which together indicate a robust back-end system meant for AI-driven features.

##### File Structure
- The root includes the environment configuration (.env), Docker-related files (Dockerfile, docker-compose.yml, run.sh), and a README.
- The main Django project folder (“ShuGenAI”) contains the core Django configuration files in the inner “ShuGenAI” directory (settings.py, asgi.py, urls.py, wsgi.py).
- There are three main Django apps:
- features: Contains models, serializers, views, migrations, and JSON files for history/subscription examples.
- users: Handles user-related functionalities (models, views, serializers, custom utilities).
- utilities: Provides helper functionalities (file, image, text processing) including a dedicated submodule for image AI utilities with its own static assets and tools.
- Static files are managed under “ShuGenAI/static” (backgrounds, fonts) which likely support the web UI.
- Migrations and tests are present in each Django app, indicating adherence to standard Django (MVT) patterns.

##### Architectural Patterns and Technologies
- Follows the standard Django MVT architecture, with clear separation of project configuration and modularized apps.
- Uses containerization to encapsulate the environment and dependencies (Docker, Docker-Compose).
- Utilizes a micro-modular approach where each app (features, users, utilities) represents well-defined responsibilities.
- Incorporates modern approaches to serving static assets and handling migrations and tests for continuous integration.
- Includes integration with external services (PostgreSQL for databases, Gmail for email communications, and external AI APIs for ML functionalities).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraphs
    subgraph "Infrastructure Layer"
        Docker["Docker & Containerization"]:::infra
    end

    subgraph "Client Layer"
        Client["Client/User Interface"]:::client
    end

    subgraph "Application Container (Django App)"
        Django_Core["Django Core (settings, asgi, wsgi, urls)"]:::core
        Features["Features App"]:::app
        Users["Users App"]:::app
        Utilities["Utilities App"]:::app
        Image_AI["Image AI Utilities"]:::app
    end

    subgraph "Data Store"
        Database["PostgreSQL Database"]:::database
    end

    subgraph "External Services"
        External_AI["External AI API"]:::external
        Gmail["Gmail Service"]:::external
    end

    %% Connections
    Client -->|"sends_request"| Django_Core
    Docker -->|"runs"| Django_Core

    Django_Core -->|"dispatches"| Features
    Django_Core -->|"dispatches"| Users
    Django_Core -->|"dispatches"| Utilities
    Utilities -->|"includes"| Image_AI

    Features -->|"crud"| Database
    Users -->|"crud"| Database

    Django_Core -->|"calls"| External_AI
    Utilities -->|"calls"| External_AI
    Users -->|"emails_via"| Gmail

    %% Click Events
    click Client "https://github.com/aleryp/masterproject/tree/ML-docker/ShuGenAI/static"
    click Django_Core "https://github.com/aleryp/masterproject/tree/ML-docker/ShuGenAI/ShuGenAI"
    click Docker "https://github.com/aleryp/masterproject/tree/ML-docker/Dockerfile"
    click Docker "https://github.com/aleryp/masterproject/blob/ML-docker/docker-compose.yml"
    click Docker "https://github.com/aleryp/masterproject/blob/ML-docker/run.sh"
    click Features "https://github.com/aleryp/masterproject/tree/ML-docker/ShuGenAI/features"
    click Users "https://github.com/aleryp/masterproject/tree/ML-docker/ShuGenAI/users"
    click Utilities "https://github.com/aleryp/masterproject/tree/ML-docker/ShuGenAI/utilities"
    click Image_AI "https://github.com/aleryp/masterproject/tree/ML-docker/ShuGenAI/utilities/image_ai_utils"

    %% Styles
    classDef client fill:#FFD700,stroke:#DAA520,stroke-width:2px;
    classDef core fill:#FFDEAD,stroke:#CD853F,stroke-width:2px;
    classDef app fill:#98FB98,stroke:#2E8B57,stroke-width:2px;
    classDef infra fill:#ADD8E6,stroke:#1E90FF,stroke-width:2px;
    classDef external fill:#FFB6C1,stroke:#FF69B4,stroke-width:2px;
    classDef database fill:#87CEFA,stroke:#4682B4,stroke-width:2px;
```
