# christoahn/ai_resume_back architecture

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

- Interactive diagram: https://gitdiagram.com/christoahn/ai_resume_back
- Repository: https://github.com/christoahn/ai_resume_back

## Overview

##### Project type and purpose
- This is a Django-based backend microservice (“AI_RESUME_BACK”) whose sole responsibility is to expose RESTful endpoints for AI-powered resume generation.
- There is no frontend in this repo; it focuses on the API, service layer, and data persistence using SQLite.

##### File structure
- Top-level:
- manage.py, wsgi.py, settings.py, urls.py → Django entrypoints, configuration, URL dispatcher
- db.sqlite3 → development database
- resume_app/ → main Django app
- Inside resume_app:
- model.py → Django ORM models (resume records, user profiles, etc.)
- views.py → REST endpoints that map URLs to request handlers
- urls.py → app-specific URL patterns
- service/ai_service.py → encapsulates all AI invocation logic
- Patterns:
- Typical MVC/Layers: URL → View (controller) → Service → Model → DB
- Clear separation between HTTP handling (views), business logic (service), and data access (models).

##### README for additional insights
- README is minimal; the project name implies “AI Resume Backend.”

##### Detail is critical
- URL patterns feeding into specific view functions.
- Important configs: settings.py may hold API keys, middleware, etc.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Systems
    Client["Client (External Consumer)"]:::external
    ExternalAI["External AI API"]:::external

    %% Django App Container
    subgraph "AI_RESUME_BACK Service (Django App)" 
        style AI_RESUME_BACK fill:#e8f5e9,stroke:#388e3c,stroke-width:2px

        %% Entrypoints & Configuration
        EntryConfig["Django Entry & Config"]:::internal
        click EntryConfig "https://github.com/christoahn/ai_resume_back/blob/main/manage.py"
        click EntryConfig "https://github.com/christoahn/ai_resume_back/blob/main/settings.py"
        click EntryConfig "https://github.com/christoahn/ai_resume_back/blob/main/urls.py"
        click EntryConfig "https://github.com/christoahn/ai_resume_back/blob/main/wsgi.py"

        %% Django Application Code
        subgraph "resume_app"
            style resume_app fill:#e8f5e9,stroke:#388e3c

            Router["URL Routing\n(resume_app/urls.py)"]:::internal
            click Router "https://github.com/christoahn/ai_resume_back/blob/main/resume_app/urls.py"

            Views["View Layer\n(resume_app/views.py)"]:::internal
            click Views "https://github.com/christoahn/ai_resume_back/blob/main/resume_app/views.py"

            AIService["AI Service Layer\n(resume_app/service/ai_service.py)"]:::internal
            click AIService "https://github.com/christoahn/ai_resume_back/blob/main/resume_app/service/ai_service.py"

            Models["Data Model Layer\n(resume_app/model.py)"]:::internal
            click Models "https://github.com/christoahn/ai_resume_back/blob/main/resume_app/model.py"
        end

    end

    %% Database Container
    SQLiteDB[("SQLite DB\n(db.sqlite3)")]:::database
    click SQLiteDB "https://github.com/christoahn/ai_resume_back/blob/main/db.sqlite3"

    %% Flows
    Client -->|"POST /generate"| EntryConfig
    EntryConfig -->|"routes to"| Router
    Router -->|"calls generate_resume()"| Views
    Views -->|"invokes"| AIService
    AIService -->|"HTTPS request"| ExternalAI
    ExternalAI -->|"response"| AIService
    AIService -->|"parse & return data"| Views
    Views -->|"ORM save/read"| Models
    Models -->|"SQL transactions"| SQLiteDB
    Views -->|"JSON response"| Client

    %% Styles
    classDef internal fill:#c8e6c9,stroke:#2e7d32,stroke-width:1px
    classDef external fill:#bbdefb,stroke:#1976d2,stroke-width:1px
    classDef database fill:#ffe0b2,stroke:#f57c00,stroke-width:1px
```
