# jadijadi/bestoon architecture

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

- Interactive diagram: https://gitdiagram.com/jadijadi/bestoon
- Repository: https://github.com/jadijadi/bestoon

## Overview

##### Main Components
- Backend Server (Django App):
- Core server application consisting of two major parts:
- Project Configuration and Setup: This is in the “bestoon” directory (with files like settings.py.sample, urls.py, and wsgi.py).
- Business Logic & Data Handling: Found in the “web” directory, which contains models, views, templates, migrations, and tests (indicating it’s where the application’s core functionalities reside).
- Django ORM’s connection to the database (implied by the migrations and “manage.py migrate” command).
- Clients:
- Command Line Clients: Under “clients/commandline”, these are shell scripts (e.g., bestoonconfig.sh, bestoonexpense.sh, etc.) that interface with the backend, likely via RESTful API endpoints.
- Ionic Mobile App: Under “clients/ionic/bestoon” is the Ionic-based client for Android/iOS, which includes the hybrid app resources (HTML, CSS, JavaScript, and bundled libraries from Ionic and AngularJS).
- Database:
- External Integrations:

##### Relationships and Interactions
- For the Ionic client, illustrate the mobile-specific assets (like those in “www”, “scss”, “res”, etc.) and how they communicate with the backend API.

##### Architectural Patterns and Principles
- MVC Pattern: Emphasize that the “web” directory embodies Django’s Model-View-Controller (technically Model-View-Template) approach.
- RESTful API: Note that the system provides a RESTful login service and likely additional REST endpoints that serve both the command line and mobile clients.
- Separation of Concerns: Distinguish the concerns between the core backend logic (business rules and data management) and the various client implementations that consume the services.

##### Technology Stack and Framework Details
- Backend: Python 2 (as per instructions), Django, and its associated packages (installed via “requirements.txt”).
- Mobile/Ionic: Ionic Framework (with AngularJS), Cordova configuration files, and related front-end libraries (bower, gulp).
- Command Line: A set of Bash shell scripts that trigger client-side operations against the API endpoints.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Django Backend"
        direction TB
        Config["Django Project Configuration"]:::backend
        Logic["Django Business Logic"]:::backend
        Config -->|"configures"| Logic
    end

    DB["Database"]:::database
    CLI["Command Line Client"]:::client
    Ionic["Ionic Mobile Client"]:::client
    External["External Integrations/Clients"]:::external

    Logic -->|"usesORM"| DB
    CLI -->|"REST_API"| Logic
    Ionic -->|"REST_API"| Logic
    External <-->|"REST_API"| Logic

    click Config "https://github.com/jadijadi/bestoon/tree/master/bestoon/"
    click Logic "https://github.com/jadijadi/bestoon/tree/master/web/"
    click CLI "https://github.com/jadijadi/bestoon/tree/master/clients/commandline/"
    click Ionic "https://github.com/jadijadi/bestoon/tree/master/clients/ionic/bestoon/"
    click DB "https://github.com/jadijadi/bestoon/tree/master/web/migrations/"

    classDef backend fill:#f9c,stroke:#333,stroke-width:2px,color:#000;
    classDef client fill:#bbf,stroke:#333,stroke-width:2px,color:#000;
    classDef database fill:#afa,stroke:#333,stroke-width:2px,color:#000;
    classDef external fill:#fad,stroke:#333,stroke-width:2px,color:#000;
```
