# devopstem/plna_web_backend architecture

> Architecture diagram of the GitHub repository devopstem/plna_web_backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devopstem/plna_web_backend
- Repository: https://github.com/devopstem/plna_web_backend

## Overview

PLNA is a multi-tenant retail planning system: users manage stores, departments, products and equipment, arrange products into planograms, and can export store/catalog data to Firebase. The application also covers floor plans, user and tenant administration, subscriptions and invoices. The graph combines sampled controller/model/service references with capabilities documented in the README; some feature implementations were not sampled, so their links rely on that documentation rather than source inspection.

Main entry points: [`app/Http/Controllers/PlanogramController.php`](https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/PlanogramController.php) (Planogram editing), [`app/Http/Controllers/ExportController.php`](https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/ExportController.php) (Store export), [`app/Jobs/SyncStoreToFirebase.php`](https://github.com/devopstem/plna_web_backend/blob/main/app/Jobs/SyncStoreToFirebase.php) (Firebase sync job), [`app/Http/Controllers/Auth`](https://github.com/devopstem/plna_web_backend/tree/main/app/Http/Controllers/Auth) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and tenancy"]
  node_auth["Authentication"]
  node_twofactor["Two-factor checks"]
  node_tenant[("Tenant accounts<br/>[Tenant.php]")]
  node_users["User administration<br/>[UserController.php]"]
end

subgraph group_retail["Retail planning"]
  node_catalog["Stores and catalog"]
  node_retaildata[("Retail records<br/>[Store.php]")]
  node_equipment[("Store equipment<br/>[Shelf.php]")]
  node_planograms["Planogram editing"]
  node_placements[("Product placements<br/>[Placement.php]")]
  node_floorplan["Floor plans"]
end

subgraph group_integrations["Export and integrations"]
  node_export["Store export"]
  node_exportservice["Export assembly"]
  node_firebase["Firebase services"]
  node_firebasejob["Firebase sync job"]
end

subgraph group_operations["Business operations"]
  node_billing["Billing and invoices<br/>[BillingService.php]"]
  node_plans["Plans and subscriptions<br/>[PlanService.php]"]
  node_analytics["Analytics"]
  node_chat["Team chat<br/>[ChatService.php]"]
end

node_user(("Store team"))
node_web["Web interface"]
node_firebaseexternal["Firebase"]

node_user -->|"uses"| node_web
node_web -.->|"submits login"| node_auth
node_auth -->|"verifies code"| node_twofactor
node_twofactor -->|"returns verification"| node_auth
node_user -->|"maintains catalog"| node_catalog
node_catalog -->|"reads and writes"| node_retaildata
node_user -->|"arranges products"| node_planograms
node_planograms -->|"loads store"| node_retaildata
node_planograms -->|"loads equipment"| node_equipment
node_planograms -->|"manages placements"| node_placements
node_user -->|"designs layout"| node_floorplan
node_user -->|"requests export"| node_export
node_export -->|"assembles data"| node_exportservice
node_export -->|"dispatches sync"| node_firebasejob
node_firebasejob -->|"gets export data"| node_exportservice
node_firebasejob -->|"writes sync data"| node_firebase
node_firebase -->|"connects to"| node_firebaseexternal
node_user -->|"manages users"| node_users
node_users -->|"checks quotas"| node_tenant
node_user -->|"manages billing"| node_billing
node_user -->|"manages subscriptions"| node_plans
node_user -->|"views analytics"| node_analytics
node_user -.->|"communicates"| node_chat

click node_web "https://github.com/devopstem/plna_web_backend/tree/main/resources/js/Pages"
click node_auth "https://github.com/devopstem/plna_web_backend/tree/main/app/Http/Controllers/Auth"
click node_twofactor "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/TwoFactorService.php"
click node_tenant "https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Tenant.php"
click node_users "https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/UserController.php"
click node_catalog "https://github.com/devopstem/plna_web_backend/tree/main/app/Http/Controllers/Api/V1"
click node_retaildata "https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Store.php"
click node_equipment "https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Shelf.php"
click node_planograms "https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/PlanogramController.php"
click node_placements "https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Placement.php"
click node_floorplan "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/FloorPlanService.php"
click node_export "https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/ExportController.php"
click node_exportservice "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/StoreExportService.php"
click node_firebase "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/FirebaseService.php"
click node_firebasejob "https://github.com/devopstem/plna_web_backend/blob/main/app/Jobs/SyncStoreToFirebase.php"
click node_billing "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/BillingService.php"
click node_plans "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/PlanService.php"
click node_analytics "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/AnalyticsService.php"
click node_chat "https://github.com/devopstem/plna_web_backend/blob/main/app/Services/ChatService.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth,node_twofactor,node_tenant,node_users toneBlue
class node_catalog,node_retaildata,node_equipment,node_planograms,node_placements,node_floorplan toneAmber
class node_export,node_exportservice,node_firebase,node_firebasejob toneMint
class node_billing,node_plans,node_analytics,node_chat toneRose
class node_user,node_firebaseexternal toneIndigo
class node_web toneTeal
```

## Components

### Identity and tenancy

- [Authentication](https://github.com/devopstem/plna_web_backend/tree/main/app/Http/Controllers/Auth): `app/Http/Controllers/Auth`
- [Two-factor checks](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/TwoFactorService.php): `app/Services/TwoFactorService.php`
- [Tenant accounts](https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Tenant.php): `app/Models/Tenant.php`
- [User administration](https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`

### Retail planning

- [Stores and catalog](https://github.com/devopstem/plna_web_backend/tree/main/app/Http/Controllers/Api/V1): `app/Http/Controllers/Api/V1`
- [Retail records](https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Store.php): `app/Models/Store.php`
- [Store equipment](https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Shelf.php): `app/Models/Shelf.php`
- [Planogram editing](https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/PlanogramController.php): `app/Http/Controllers/PlanogramController.php`
- [Product placements](https://github.com/devopstem/plna_web_backend/blob/main/app/Models/Placement.php): `app/Models/Placement.php`
- [Floor plans](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/FloorPlanService.php): `app/Services/FloorPlanService.php`

### Export and integrations

- [Store export](https://github.com/devopstem/plna_web_backend/blob/main/app/Http/Controllers/ExportController.php): `app/Http/Controllers/ExportController.php`
- [Export assembly](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/StoreExportService.php): `app/Services/StoreExportService.php`
- [Firebase services](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/FirebaseService.php): `app/Services/FirebaseService.php`
- [Firebase sync job](https://github.com/devopstem/plna_web_backend/blob/main/app/Jobs/SyncStoreToFirebase.php): `app/Jobs/SyncStoreToFirebase.php`

### Business operations

- [Billing and invoices](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/BillingService.php): `app/Services/BillingService.php`
- [Plans and subscriptions](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/PlanService.php): `app/Services/PlanService.php`
- [Analytics](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/AnalyticsService.php): `app/Services/AnalyticsService.php`
- [Team chat](https://github.com/devopstem/plna_web_backend/blob/main/app/Services/ChatService.php): `app/Services/ChatService.php`

### Other components

- **Store team**
- [Web interface](https://github.com/devopstem/plna_web_backend/tree/main/resources/js/Pages): `resources/js/Pages`
- **Firebase**

## Connections

- Store team → Web interface: uses (evidence: `README.md`)
- Web interface → Authentication: submits login
- Authentication → Two-factor checks: verifies code (evidence: `app/Http/Controllers/Auth/TwoFactorChallengeController.php`)
- Two-factor checks → Authentication: returns verification (evidence: `app/Http/Controllers/Auth/TwoFactorChallengeController.php`)
- Store team → Stores and catalog: maintains catalog (evidence: `README.md`)
- Stores and catalog → Retail records: reads and writes (evidence: `app/Http/Controllers/Api/V1/StoreController.php`)
- Store team → Planogram editing: arranges products (evidence: `README.md`)
- Planogram editing → Retail records: loads store (evidence: `app/Http/Controllers/PlanogramController.php`)
- Planogram editing → Store equipment: loads equipment (evidence: `app/Http/Controllers/PlanogramController.php`)
- Planogram editing → Product placements: manages placements (evidence: `app/Http/Controllers/PlanogramController.php`)
- Store team → Floor plans: designs layout (evidence: `README.md`)
- Store team → Store export: requests export (evidence: `README.md`)
- Store export → Export assembly: assembles data (evidence: `app/Http/Controllers/ExportController.php`)
- Store export → Firebase sync job: dispatches sync (evidence: `app/Http/Controllers/ExportController.php`)
- Firebase sync job → Export assembly: gets export data (evidence: `app/Jobs/SyncStoreToFirebase.php`)
- Firebase sync job → Firebase services: writes sync data (evidence: `app/Jobs/SyncStoreToFirebase.php`)
- Firebase services → Firebase: connects to (evidence: `README.md`)
- Store team → User administration: manages users (evidence: `README.md`)
- User administration → Tenant accounts: checks quotas (evidence: `app/Http/Controllers/UserController.php`)
- Store team → Billing and invoices: manages billing (evidence: `README.md`)
- Store team → Plans and subscriptions: manages subscriptions (evidence: `README.md`)
- Store team → Analytics: views analytics (evidence: `README.md`)
- Store team → Team chat: communicates
