# erpgap/alokai-docker architecture

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

- Interactive diagram: https://gitdiagram.com/erpgap/alokai-docker
- Repository: https://github.com/erpgap/alokai-docker

## Overview

##### Project type and purpose
- This repo is a Docker-based demo that brings up two primary services: a Vue Storefront (VSF) frontend (“Alokai”) and an Odoo 18.0 backend.
- Its goal is to let developers quickly spin up and test a headless VSF storefront integrated with an Odoo ERP instance (not intended for production).

##### File-structure analysis
- Top-level artifacts:
- .env / .gitignore / README.md / docker-compose.yml
- “18.0/” directory: builds the Odoo 18.0 service (Dockerfile, odoo.conf, Python requirements, startup scripts)
- “alokai/” directory: builds the VSF frontend (its own Dockerfile)

##### Key README insights
- It specifies two HTTP endpoints: 3000 for the VSF UI, 8069 for Odoo.
- It calls out Redis (used for caching sessions or storefront data).
- It points to three GitHub repos for core storefront modules, Odoo modules, and the Storefront-UI boilerplate.

##### Main components
a. Frontend service (“Alokai” / Vue Storefront)
b. Backend service (Odoo 18.0 ERP)
c. PostgreSQL database (Odoo data store)
d. Redis cache (session/cache store)
e. Docker Compose network and volumes (to persist DB and modules)
f. External module repositories (SDK-migration branch, alokai-odoo modules, SFUI v2)

##### Relationships and interactions
- User’s browser → HTTP(S) → VSF frontend (port 3000)
- VSF frontend ↔ HTTP API calls → Odoo backend (port 8069)
- Odoo ↔ SQL protocol → PostgreSQL DB for persistence
- Odoo ↔ Redis protocol → Redis for caching or session storage
- Docker Compose orchestrates the network, volumes, and service lifecycles

##### Architectural patterns and design principles
- Headless architecture: decoupled frontend (Vue.js) vs. backend (Odoo)
- Micro-service-like separation via containers
- Clear separation of concerns: UI layer, business logic layer, persistence, caching
- Infrastructure as code: Dockerfiles + docker-compose.yml
- Volume mounts for hot-reloading custom modules and config files

##### Technologies, frameworks, and libraries to annotate
- Vue Storefront (Node.js) and Storefront-UI v2
- Odoo 18.0 (Python, Postgres, custom modules from alokai-odoo)
- Redis (cache)
- PostgreSQL (database)
- Docker & Docker Compose
- Supporting scripts: start_script.py, startup.sh

##### Diagramming recommendations
- Use clear labels on each container/component (e.g., “VSF Frontend”, “Odoo Backend”, “Postgres DB”, “Redis Cache”)
- Browser → VSF
- VSF → Odoo
- Odoo → Postgres / Redis
- Blue rectangles for application services
- Important ports (3000, 8069, 5432, 6379) and volume mounts (e.g., odoo.conf, custom modules folder)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User entry point
    Browser["User Browser"]:::external

    %% Docker Compose Boundary
    subgraph "Docker Compose"
        direction TB
        VSF["VSF Frontend (port 3000)"]:::app
        Odoo["Odoo Backend (port 8069)"]:::app
        Postgres["PostgreSQL DB (port 5432)"]:::db
        Redis["Redis Cache (port 6379)"]:::cache
    end

    %% External Module Sources
    subgraph "External Module Repositories"
        SDK["SDK Migration Branch"]:::external
        OdooModules["Alokai-Odoo Modules"]:::external
        SFUI["Storefront-UI v2"]:::external
    end

    %% Connections
    Browser -->|"HTTP 3000"| VSF
    VSF -->|"HTTP API 8069"| Odoo
    Odoo -->|"SQL Protocol 5432"| Postgres
    Odoo -->|"Redis Protocol 6379"| Redis

    SDK --> VSF
    SFUI --> VSF
    OdooModules --> Odoo

    %% Click Events
    click VSF "https://github.com/erpgap/alokai-docker/tree/18.0/alokai/Dockerfile"
    click Odoo "https://github.com/erpgap/alokai-docker/tree/18.0/18.0/"
    click Postgres "https://github.com/erpgap/alokai-docker/blob/18.0/docker-compose.yml"
    click Redis "https://github.com/erpgap/alokai-docker/blob/18.0/docker-compose.yml"
    click Browser "https://github.com/erpgap/alokai-docker/blob/18.0/.env"
    click Browser "https://github.com/erpgap/alokai-docker/blob/18.0/README.md"
    click Browser "https://github.com/erpgap/alokai-docker/blob/18.0/.gitignore"

    %% Styles
    classDef app fill:#D0E8FF,stroke:#0366d6,stroke-width:2px
    classDef db fill:#E6FFEA,stroke:#28a745,stroke-width:2px
    classDef cache fill:#FFF5BA,stroke:#dbab09,stroke-width:2px
    classDef external fill:#F0F0F0,stroke:#999999,stroke-width:1px,stroke-dasharray: 2 2
```
