# jmgalvis12/proyecto_alkosto architecture

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

- Interactive diagram: https://gitdiagram.com/jmgalvis12/proyecto_alkosto
- Repository: https://github.com/jmgalvis12/proyecto_alkosto

## Overview

##### Project type and purpose
- This is a full-stack e-commerce web application.
- Backend: a Django “modular monolith” with separate apps for accounts, products, cart, orders, and analytics.
- Frontend: a React single-page application (bootstrapped with Create React App), plus supporting JS MVC code under `src/` for controllers, models, and views.

##### File structure
- Top level
- `.gitignore`, `README.md` – repo metadata
- `backend/` – Django project root (manage.py, requirements.txt)
- `frontend/` – React CRA scaffold (src/, public/, package.json)
- `public/` & root `src/` – additional static+MVC assets (likely part of a legacy or alternative frontend)
- `backend/config/` – Django settings, URL routing, ASGI/WSGI entry points
- `backend/apps/…` – five domain apps, each with models, views, migrations, admin & tests
- `frontend/src/` – React components (views), API helper (`api.js`), CSS, HTML shell
- Root `src/controllers`, `src/models`, `src/views` – lightweight JS MVC layer interacting with `src/data/categories.json`

##### README for additional insights
- The README is the standard Create React App boilerplate, confirming that the React SPA is the intended production UI.
- Deployment and build scripts are managed by npm; the backend likely runs separately on Django’s runserver or deployed via WSGI/ASGI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    Browser["Client Browser"]:::external

    %% UI Layer
    subgraph "UI Layer"
        ReactSPA["React SPA"]:::frontend
        LegacyMVC["Legacy JS MVC"]:::frontend
    end

    Browser --> ReactSPA
    Browser --> LegacyMVC

    %% Static Assets Layer
    StaticServer["Static Asset Server / CDN"]:::cdn
    ReactSPA -->|"serves build"| StaticServer

    %% API Gateway
    APIRouter["Django Config & Routing"]:::backend
    ReactSPA -->|"REST API calls"| APIRouter
    LegacyMVC -->|"AJAX API calls"| APIRouter

    %% Backend Services Layer
    subgraph "Django Apps (Modular Monolith)"
        AuthService["Auth Service\n(Accounts App)"]:::backend
        ProductsService["Products Service"]:::backend
        CartService["Cart Service"]:::backend
        OrdersService["Orders Service"]:::backend
        AnalyticsService["Analytics Service"]:::backend
    end

    APIRouter --> AuthService
    APIRouter --> ProductsService
    APIRouter --> CartService
    APIRouter --> OrdersService
    APIRouter --> AnalyticsService

    %% Database
    DB["Relational Database\n(PostgreSQL/MySQL)"]:::database
    AuthService --> DB
    ProductsService --> DB
    CartService --> DB
    OrdersService --> DB
    AnalyticsService --> DB

    %% External Integrations
    subgraph "External Services"
        Payment["Payment Gateway"]:::external
        Email["Email Service"]:::external
    end

    OrdersService -->|"process payments"| Payment
    OrdersService -->|"send emails"| Email
    AnalyticsService -->|"event hooks"| Payment
    AnalyticsService -->|"event hooks"| Email

    %% Click Events
    click AuthService "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/backend/apps/accounts/"
    click ProductsService "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/backend/apps/products/"
    click CartService "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/backend/apps/cart/"
    click OrdersService "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/backend/apps/orders/"
    click AnalyticsService "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/backend/apps/analytics/"
    click APIRouter "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/backend/config/"
    click ReactSPA "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/frontend/src/"
    click LegacyMVC "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/src/"
    click StaticServer "https://github.com/jmgalvis12/proyecto_alkosto/tree/main/public/"

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#0d47a1,color:#0d47a1;
    classDef backend fill:#c8e6c9,stroke:#1b5e20,color:#1b5e20;
    classDef database fill:#ffe082,stroke:#ff6f00,color:#ff6f00;
    classDef external fill:#f8bbd0,stroke:#880e4f,color:#880e4f;
    classDef cdn fill:#e1bee7,stroke:#4a148c,color:#4a148c;
```
