# docesforg/portfolio-api architecture

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

- Interactive diagram: https://gitdiagram.com/docesforg/portfolio-api
- Repository: https://github.com/docesforg/portfolio-api

## Overview

##### Project Type & Purpose
- A Django (MTV) web application with Django REST Framework (“photo_portfolio”)
- Manages photos, categories, likes and user profiles via a REST API
- Uses SQLite locally; deployed on Heroku (Procfile, runtime.txt)

##### Main Components
- Clients: Browser or Mobile App (HTTP/HTTPS)
- Heroku Router / Load Balancer (optional)
- Web Process: Gunicorn → WSGI
- Django Project (“photo_portfolio”): URL dispatcher
- photos app:
– URLs & Views (API endpoints)
– Serializers (data transformation)
– Models (ORM, photos/models.py)
– Permissions, Signals (photos/permissions.py, photos/signals.py)
– Admin interface (photos/admin.py)
- Database: SQLite (db.sqlite3)

##### Data Flow & Relationships
Client → HTTP → Heroku Router → Gunicorn → WSGI →
URLconf → View → Serializer → ORM → SQLite
← ORM ← Serializer ← View ← HTTP Response

##### Architectural Patterns & Tech
- MTV (Django) with REST layer (DRF)
- ORM for persistence
- Signals for decoupled event handling
- Procfile/runtime.txt for Heroku deployment

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients"
        Browser["Browser"]:::clients
        Mobile["Mobile App"]:::clients
    end

    subgraph "Web Server"
        HerokuRouter["Heroku Router"]:::server
        Gunicorn["Gunicorn"]:::server
        WSGI["WSGI"]:::server
        ASGI["ASGI"]:::server
    end

    subgraph "Project Core"
        CoreDir["photo_portfolio/"]:::app
        URLconf["URLconf"]:::app
        Settings["settings.py"]:::app
        Manage["manage.py"]:::app
        Procfile["Procfile"]:::infra
        Runtime["runtime.txt"]:::infra
        Requirements["requirements.txt"]:::infra
    end

    subgraph "Photos App"
        PhotosDir["photos/"]:::app
        Aurls["photos/urls.py"]:::app
        Views["photos/views.py"]:::app
        Serializers["photos/serializers.py"]:::app
        Models["photos/models.py"]:::app
        Permissions["photos/permissions.py"]:::app
        Signals["photos/signals.py"]:::app
        Admin["photos/admin.py"]:::app
        Tests["photos/tests.py"]:::app
        Migrations["photos/migrations/"]:::app
    end

    DB["db.sqlite3"]:::db

    Browser --> HerokuRouter
    Mobile --> HerokuRouter
    HerokuRouter --> Gunicorn --> WSGI --> URLconf
    URLconf --> Aurls --> Views --> Serializers --> Models --> DB
    Models --> Signals
    URLconf --> Admin

    click CoreDir "https://github.com/docesforg/portfolio-api/tree/main/photo_portfolio/"
    click URLconf "https://github.com/docesforg/portfolio-api/blob/main/photo_portfolio/urls.py"
    click WSGI "https://github.com/docesforg/portfolio-api/blob/main/photo_portfolio/wsgi.py"
    click ASGI "https://github.com/docesforg/portfolio-api/blob/main/photo_portfolio/asgi.py"
    click Settings "https://github.com/docesforg/portfolio-api/blob/main/photo_portfolio/settings.py"
    click Manage "https://github.com/docesforg/portfolio-api/blob/main/manage.py"
    click Procfile "https://github.com/docesforg/portfolio-api/tree/main/Procfile"
    click Runtime "https://github.com/docesforg/portfolio-api/blob/main/runtime.txt"
    click Requirements "https://github.com/docesforg/portfolio-api/blob/main/requirements.txt"
    click DB "https://github.com/docesforg/portfolio-api/blob/main/db.sqlite3"
    click PhotosDir "https://github.com/docesforg/portfolio-api/tree/main/photos/"
    click Aurls "https://github.com/docesforg/portfolio-api/blob/main/photos/urls.py"
    click Views "https://github.com/docesforg/portfolio-api/blob/main/photos/views.py"
    click Serializers "https://github.com/docesforg/portfolio-api/blob/main/photos/serializers.py"
    click Models "https://github.com/docesforg/portfolio-api/blob/main/photos/models.py"
    click Permissions "https://github.com/docesforg/portfolio-api/blob/main/photos/permissions.py"
    click Signals "https://github.com/docesforg/portfolio-api/blob/main/photos/signals.py"
    click Admin "https://github.com/docesforg/portfolio-api/blob/main/photos/admin.py"
    click Tests "https://github.com/docesforg/portfolio-api/blob/main/photos/tests.py"
    click Migrations "https://github.com/docesforg/portfolio-api/tree/main/photos/migrations/"

    classDef clients fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef server fill:#90EE90,stroke:#333,stroke-width:1px
    classDef app fill:#FFA500,stroke:#333,stroke-width:1px
    classDef infra fill:#98FB98,stroke:#333,stroke-width:1px
    classDef db fill:#D3D3D3,stroke:#333,stroke-width:1px
```
