# bosnape/eidos architecture

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

- Interactive diagram: https://gitdiagram.com/bosnape/eidos
- Repository: https://github.com/bosnape/eidos

## Overview

##### Main Components
- EidosApp (Project Configuration): This is the core Django project folder (eidosapp) where global settings, URL routing (eidosapp/urls.py), WSGI, and ASGI configurations reside.
- Business App: This Django app (folder “business”) handles business logic such as employee profiles, portfolio entries, service management, and other business-specific functionalities. It includes models, views, templates, URL definitions, tests, and migration scripts.
- Eidos App: This secondary Django app (folder “eidos”) seems to manage the public-facing side of the platform. It includes templates for homepage, contact and search functionality.
- Database: The project uses SQLite (db.sqlite3), which is the data persistence layer.
- Media and Static Files: There is a “media” directory that stores uploaded images and files for businesses, employees, portfolios, and services. Static assets (if any) might also need representation.
- External Libraries/Dependencies: The requirements.txt ensures that all Python packages (including Django) are installed. These dependencies support the web application framework, templating engine, and other tools.

##### Relationships and Interactions
- The EidosApp folder ties together the various Django apps through global URL configurations and settings.
- The Business app handles the domain-specific logic, connecting with its views, models, and templates for CRUD operations, forms, and admin functionalities.
- The Eidos app provides the public interface, likely handling route requests for the homepage, contact, and business search functionalities.
- Both apps interact with the underlying SQLite database using Django’s ORM with migrations managing schema evolution.
- Media content is stored and retrieved from the “media” directory; this is important for images associated with business profiles, employees, etc.
- The built-in Django admin (configurable via admin.py) enables administration of business data.

##### Architectural Patterns and Design Principles
- Django’s Model-View-Template (MVT) pattern is used extensively. Each app has its own models, views, and templates.
- Modularity is maintained by splitting the functionality into separate apps (e.g., “business” and “eidos”) for better separation of concerns.
- The system leverages Django migrations to manage database schema changes smoothly.
- The structure supports scalability and maintainability by isolating business logic from presentation logic.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Web Client/Browser"]:::frontend
    Config["EidosApp - Global Config & Routing"]:::config
    External["External Dependencies"]:::external
    DB["Database (SQLite)"]:::database
    Media["Media Storage"]:::storage

    Browser -->|"HTTP_Request"| Config
    Config -->|"Routes_to"| DAApps[ ]
    Config -->|"Uses"| External
    Business["Business App - Employee & Portfolio Management"]:::business
    Public["Eidos App - Public Interface"]:::public

    %% Subgraph for Django Applications
    subgraph "Django Applications"
        Business
        Public
    end

    Config -->|"Routes_to"| Business
    Config -->|"Routes_to"| Public
    Business <-->|"ORM_Queries"| DB
    Public <-->|"ORM_Queries"| DB
    Business -->|"Handles_media"| Media
    Public -->|"Handles_media"| Media

    %% Click Events
    click Config "https://github.com/bosnape/eidos/tree/main/eidosapp/"
    click Business "https://github.com/bosnape/eidos/tree/main/business/"
    click Public "https://github.com/bosnape/eidos/tree/main/eidos/"
    click DB "https://github.com/bosnape/eidos/blob/main/db.sqlite3"
    click Media "https://github.com/bosnape/eidos/tree/main/media/"
    click External "https://github.com/bosnape/eidos/blob/main/requirements.txt"

    %% Styles
    classDef frontend fill:#aed6f1,stroke:#1b4f72,stroke-width:2px;
    classDef config fill:#f9e79f,stroke:#b7950b,stroke-width:2px;
    classDef business fill:#f5cba7,stroke:#c0392b,stroke-width:2px;
    classDef public fill:#d2b4de,stroke:#8e44ad,stroke-width:2px;
    classDef database fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef storage fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef external fill:#f6ddcc,stroke:#d35400,stroke-width:2px;
```
