# luchoss10/pills_project architecture

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

- Interactive diagram: https://gitdiagram.com/luchoss10/pills_project
- Repository: https://github.com/luchoss10/pills_project

## Overview

##### Main Components Identification

a) Core Domain Layer:
- "User" component (from user.py)
- "Pill" component (from pill.py)
- "Day" component (from day.py)
- "History" component (from history.py)

b) Storage Layer:
- JSON Storage (json_file_storage.py)
- Raw File Storage (raw_file_storage.py)
- SQL Storage (sql_file_storage.py)

##### Component Relationships

a) Main Application Flow:
- Main.py at the top level, showing it as the entry point

b) Storage Pattern:

##### Architectural Pattern Representation
The system follows a clear separation of concerns with:
- Domain objects (User, Pill, Day, History)
- Storage abstraction (Interface)
- Multiple storage implementations

**[Main Application (main.py)]**
- ↓
- [Domain Layer]
- /     |      \
**[User] [Pill]  [Day]**
- /
- [History]
- ↓
**[Storage Interface]**
- /     |     \
**[JSON] [Raw]  [SQL]**
**Storage Storage Storage**

##### Key Points to Emphasize
- The system follows the Interface Segregation Principle with its storage implementations
- The domain logic is separated from storage concerns
- The system appears to be designed for extensibility in terms of storage options

##### Technical Details
- Python version compatibility (if specified in any configuration)
- Any external dependencies (though none are immediately apparent)
- Storage format specifications for each implementation

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Application
    Main["Main Application"]:::main
    click Main "https://github.com/luchoss10/pills_project/blob/main/main.py"

    %% Domain Layer
    subgraph DomainLayer["Domain Layer"]
        User["User"]:::domain
        Pill["Pill"]:::domain
        Day["Day"]:::domain
        History["History"]:::domain
        click User "https://github.com/luchoss10/pills_project/blob/main/user.py"
        click Pill "https://github.com/luchoss10/pills_project/blob/main/pill.py"
        click Day "https://github.com/luchoss10/pills_project/blob/main/day.py"
        click History "https://github.com/luchoss10/pills_project/blob/main/history.py"
    end

    %% Storage Layer
    subgraph StorageLayer["Storage Layer"]
        StorageInterface["Storage Interface"]:::interface
        click StorageInterface "https://github.com/luchoss10/pills_project/blob/main/storage_modules/data_save_interface.py"
        click StorageModules "https://github.com/luchoss10/pills_project/blob/main/storage_modules/__init__.py"
        
        subgraph StorageImplementations["Storage Implementations"]
            JSONStorage["JSON Storage"]:::storage
            RawStorage["Raw File Storage"]:::storage
            SQLStorage["SQL Storage"]:::storage
            click JSONStorage "https://github.com/luchoss10/pills_project/blob/main/storage_modules/json_file_storage.py"
            click RawStorage "https://github.com/luchoss10/pills_project/blob/main/storage_modules/raw_file_storage.py"
            click SQLStorage "https://github.com/luchoss10/pills_project/blob/main/storage_modules/sql_file_storage.py"
        end
    end

    %% Relationships
    Main --> User
    Main --> Pill
    Main --> Day
    Main --> History
    
    User --> History
    Pill --> History
    Day --> History
    
    History --> StorageInterface
    
    StorageInterface -.-> JSONStorage
    StorageInterface -.-> RawStorage
    StorageInterface -.-> SQLStorage

    %% Styles
    classDef main fill:#4a90e2,stroke:#2c3e50,color:white
    classDef domain fill:#2ecc71,stroke:#27ae60,color:white
    classDef interface fill:#f1c40f,stroke:#f39c12,color:black
    classDef storage fill:#e67e22,stroke:#d35400,color:white

    %% Legend
    subgraph Legend
        MainL["Main Application"]:::main
        DomainL["Domain Component"]:::domain
        InterfaceL["Interface"]:::interface
        StorageL["Storage Implementation"]:::storage
    end
```
