# obscure74/django-sprint1 architecture

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

- Interactive diagram: https://gitdiagram.com/obscure74/django-sprint1
- Repository: https://github.com/obscure74/django-sprint1

## Overview

##### Project Type and Purpose
- This is a full-stack server-side rendered blog application built with Django (Python).
- It provides dynamic blog pages (through the `blog` app) and static informational pages (through the `pages` app).

##### File-Structure Analysis
Top‐level:
- `blogicum/` – Django project root (contains settings, URL config, ASGI/WSGI)
- `blogicum/blog/` – “blog” Django app: models, views, URLs, templates
- `blogicum/pages/` – “pages” Django app: models, views, URLs, templates
- `blogicum/static/` & `blogicum/templates/` – shared CSS, images, HTML templates
- `html/` – static HTML exports or fixtures (used in tests)
- `tests/` – pytest suite verifying URLs, views, templates, settings

##### Key Architectural Insights from README
- Very minimal README; core insights come from Django conventions and directory layout.
- Two main functional modules (apps) plugged into one Django project.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    Browser["Browser"]:::client

    %% Web Server & App Server
    Nginx["Nginx (Static & Proxy)"]:::webserver
    Gunicorn["Gunicorn (WSGI/ASGI)"]:::compute

    %% Django Project Container
    subgraph "Django Project (blogicum)"
      direction TB
      Settings["settings.py"]:::config
      ASGI["asgi.py"]:::compute
      WSGI["wsgi.py"]:::compute
      URLRouter["URL Router"]:::controller
      subgraph "Apps"
        direction TB
        BlogApp["blog app"]:::app
        PagesApp["pages app"]:::app
      end
      TemplateEngine["Template Engine"]:::template
      StaticHandler["Static Handler"]:::static
      Admin["Admin Interface"]:::admin
    end

    %% Database
    Database["Database"]:::db

    %% Testing Infrastructure
    subgraph "Testing Infrastructure"
      direction TB
      PytestIni["pytest.ini"]:::test
      Tests["tests/"]:::test
      HTMLFixtures["html/"]:::test
    end

    %% Connections
    Browser -->|"HTTPRequest"| Nginx
    Nginx -->|"ProxyHTTP"| Gunicorn
    Gunicorn -->|"InvokeASGI"| ASGI
    Gunicorn -->|"InvokeWSGI"| WSGI
    ASGI --> URLRouter
    WSGI --> URLRouter
    URLRouter -->|"routesTo"| BlogApp
    URLRouter -->|"routesTo"| PagesApp
    BlogApp -->|"fetchSave"| Database
    PagesApp -->|"fetchSave"| Database
    BlogApp --> TemplateEngine
    PagesApp --> TemplateEngine
    TemplateEngine -->|"RenderHTML"| BlogApp
    TemplateEngine -->|"RenderHTML"| PagesApp
    URLRouter --> Admin
    Admin -->|"manageData"| Database
    Nginx -->|"ServesStatic"| StaticHandler
    StaticHandler --> Browser

    %% Click Events
    click Settings "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blogicum/settings.py"
    click ASGI "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blogicum/asgi.py"
    click WSGI "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blogicum/wsgi.py"
    click URLRouter "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blogicum/urls.py"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/models.py"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/views.py"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/admin.py"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/apps.py"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/tests.py"
    click PagesApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/models.py"
    click PagesApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/views.py"
    click PagesApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/admin.py"
    click PagesApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/apps.py"
    click PagesApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/tests.py"
    click TemplateEngine "https://github.com/obscure74/django-sprint1/blob/main/blogicum/templates/base.html"
    click StaticHandler "https://github.com/obscure74/django-sprint1/tree/main/blogicum/static/"
    click PytestIni "https://github.com/obscure74/django-sprint1/blob/main/pytest.ini"
    click Tests "https://github.com/obscure74/django-sprint1/tree/main/tests/"
    click HTMLFixtures "https://github.com/obscure74/django-sprint1/tree/main/html/"
    click PagesApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/templates/pages/about.html"
    click PagesApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/templates/pages/rules.html"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/templates/blog/index.html"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/templates/blog/detail.html"
    click BlogApp "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/templates/blog/category.html"
    click Admin "https://github.com/obscure74/django-sprint1/blob/main/blogicum/blog/admin.py"
    click Admin "https://github.com/obscure74/django-sprint1/blob/main/blogicum/pages/admin.py"
    click Settings "https://github.com/obscure74/django-sprint1/blob/main/requirements.txt"

    %% Styles
    classDef client fill:#DDDDDD,stroke:#333,stroke-width:1px
    classDef webserver fill:#CCCCCC,stroke:#333,stroke-width:1px
    classDef compute fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef controller fill:#87CEFA,stroke:#333,stroke-width:1px
    classDef app fill:#98FB98,stroke:#333,stroke-width:1px
    classDef template fill:#FFFACD,stroke:#333,stroke-width:1px
    classDef static fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef db fill:#FFA500,stroke:#333,stroke-width:1px
    classDef admin fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef config fill:#B0E0E6,stroke:#333,stroke-width:1px
    classDef test fill:#E6E6FA,stroke:#333,stroke-width:1px
```
