# abdallah-ali247/custom-protfolio architecture

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

- Interactive diagram: https://gitdiagram.com/abdallah-ali247/custom-protfolio
- Repository: https://github.com/abdallah-ali247/custom-protfolio

## Overview

##### Project type and purpose
- This is a full-stack Django web application (“Portfolio Website”) for architects/interior designers.
- It provides both a public-facing site (to browse projects, view CV, read about/contact the architect) and a login-protected admin dashboard to manage content (projects, images, CV, theme, goals, about info, contact messages).

##### Main components
a. Client Tier
- Public User Browser – requests HTML/CSS/JS, views projects, submits contact form
- Admin User Browser – logs in to the Dashboard UI for content management
b. Application Tier (Django Server)
- ASGI/WSGI Layer (asgi.py / wsgi.py) handling incoming HTTP(S) requests
- Django Core (“architect_portfolio” settings, URLs, middleware)
- Apps:
- core – public-site models, views, templates, custom template filters
- dashboard – admin-site views, models (if any), templates
- Template Engine – renders templates in architect_portfolio/templates and per-app templates
- Static Files Handler – serves CSS, JS, fonts (managed via static/ + possibly WhiteNoise or CDN)
- Media Upload Handler – stores and serves user-uploaded CV PDFs and project images (media/ tree)
c. Data Tier
- Relational Database – SQLite in development (db.sqlite3) or PostgreSQL/MySQL in production
- Migrations – Django ORM migrations under core/migrations and dashboard/migrations
d. External Services
- Email SMTP Server – handles outgoing contact form emails
- (Optional) CDN or Object Storage – for production media & static file hosting
e. Deployment Infrastructure
- Procfile – declares entry point (e.g., “gunicorn architect_portfolio.wsgi”) for Heroku or similar
- Virtual Environment – venv holds Python dependencies
- requirements.txt – lists Python packages

##### Relationships and data flows
- Public or Admin Browser → HTTP(S) → Django ASGI/WSGI → URL router → view function
- View ↔ ORM → Database (CRUD on models)
- View → Template Engine → HTML response → Browser
- Browser ← Static assets (CSS/JS) ← Static handler/CDN
- Browser ← Media assets (images, PDFs) ← Media handler/CDN
- Contact form submission → Django view → SMTP client → Email provider
- Admin actions (Add/Edit) → File upload → Media storage → File system or external object store

##### Architectural patterns & design principles
- MTV Pattern (Model-Template-View)
- App modularization: “core” app for public functionality, “dashboard” app for admin panel
- Separation of concerns: static vs dynamic content, public vs admin, code vs configuration
- DRY templates with a shared base.html and dashboard/base.html

##### Detail level
- Django app as a sub-component
- Template directories vs static directories
- Config files (settings.py, Procfile) in the deployment context

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    subgraph "Client Tier"
        PUB["Public User Browser"]:::frontend
        ADM["Admin User Browser"]:::frontend
    end

    %% Application Tier
    subgraph "Application Tier"
        ASGI["ASGI Layer"]:::app
        WSGI["WSGI Layer"]:::app
        CORESET["Django Core Settings"]:::app
        URLCONF["Root URL Configuration"]:::app
        Middleware["Middleware"]:::app
        Dispatcher["URL Dispatcher"]:::app
        TemplateEngine["Template Engine"]:::app
        ORM["Django ORM"]:::app

        subgraph "Django Apps"
            subgraph "Public-Site App (core)"
                CMOD["core.models"]:::app
                CVIEW["core.views"]:::app
                CURL["core.urls"]:::app
                CMIG["core/migrations"]:::app
                CFILT["core.template filters"]:::app
            end
            subgraph "Admin Dashboard App (dashboard)"
                DMOD["dashboard.models"]:::app
                DVIEW["dashboard.views"]:::app
                DURL["dashboard.urls"]:::app
                DMIG["dashboard/migrations"]:::app
            end
        end

        Static["Static Files Handler"]:::storage
        Media["Media Upload Handler"]:::storage
    end

    %% Data Tier
    subgraph "Data Tier"
        DB["Relational Database"]:::db
    end

    %% External Services
    EXTSMTP["External SMTP Server"]:::external

    %% Deployment Environment
    subgraph "Deployment Environment"
        PROCF["Procfile"]:::config
        REQ["requirements.txt"]:::config
        VENV["venv"]:::config
        MGMT["manage.py"]:::config
    end

    %% Connections
    PUB -->|"HTTP(S)"| ASGI
    ADM -->|"HTTP(S)"| ASGI
    ASGI --> CORESET
    ASGI --> URLCONF
    ASGI --> Middleware
    Middleware --> Dispatcher
    Dispatcher --> CVIEW
    Dispatcher --> DVIEW
    CVIEW --> ORM
    DVIEW --> ORM
    ORM --> DB
    CVIEW --> TemplateEngine
    DVIEW --> TemplateEngine
    TemplateEngine --> PUB
    TemplateEngine --> ADM
    PUB -->|"Static requests"| Static
    PUB -->|"Media requests"| Media
    ADM -->|"Static requests"| Static
    ADM -->|"Media requests"| Media
    CVIEW -->|"send email"| EXTSMTP
    Static --> PUB
    Media --> PUB
    PROCF --> WSGI
    PROCF --> ASGI
    MGMT --> CORESET

    %% Click Events
    click ASGI "https://github.com/abdallah-ali247/custom-protfolio/blob/main/architect_portfolio/asgi.py"
    click WSGI "https://github.com/abdallah-ali247/custom-protfolio/blob/main/architect_portfolio/wsgi.py"
    click CORESET "https://github.com/abdallah-ali247/custom-protfolio/blob/main/architect_portfolio/settings.py"
    click URLCONF "https://github.com/abdallah-ali247/custom-protfolio/blob/main/architect_portfolio/urls.py"
    click CMOD "https://github.com/abdallah-ali247/custom-protfolio/blob/main/core/models.py"
    click CVIEW "https://github.com/abdallah-ali247/custom-protfolio/blob/main/core/views.py"
    click CURL "https://github.com/abdallah-ali247/custom-protfolio/blob/main/core/urls.py"
    click CMIG "https://github.com/abdallah-ali247/custom-protfolio/tree/main/core/migrations/"
    click CFILT "https://github.com/abdallah-ali247/custom-protfolio/blob/main/core/templatetags/custom_filters.py"
    click DMOD "https://github.com/abdallah-ali247/custom-protfolio/blob/main/dashboard/models.py"
    click DVIEW "https://github.com/abdallah-ali247/custom-protfolio/blob/main/dashboard/views.py"
    click DURL "https://github.com/abdallah-ali247/custom-protfolio/blob/main/dashboard/urls.py"
    click DMIG "https://github.com/abdallah-ali247/custom-protfolio/tree/main/dashboard/migrations/"
    click TemplateEngine "https://github.com/abdallah-ali247/custom-protfolio/tree/main/architect_portfolio/templates/"
    click Static "https://github.com/abdallah-ali247/custom-protfolio/tree/main/architect_portfolio/static/"
    click Media "https://github.com/abdallah-ali247/custom-protfolio/tree/main/media/"
    click DB "https://github.com/abdallah-ali247/custom-protfolio/blob/main/db.sqlite3"
    click PROCF "https://github.com/abdallah-ali247/custom-protfolio/tree/main/Procfile"
    click REQ "https://github.com/abdallah-ali247/custom-protfolio/blob/main/requirements.txt"
    click MGMT "https://github.com/abdallah-ali247/custom-protfolio/blob/main/manage.py"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:1px;
    classDef app fill:#c3e6cb,stroke:#155724,stroke-width:1px;
    classDef db fill:#ffeeba,stroke:#856404,stroke-width:1px;
    classDef storage fill:#e2e3e5,stroke:#6c757d,stroke-width:1px;
    classDef external fill:#d6d8db,stroke:#1b1e21,stroke-width:1px,stroke-dasharray: 5 5;
    classDef config fill:#f8d7da,stroke:#721c24,stroke-width:1px;
```
