# leluza/appfullstackparaportfoliofront architecture

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

- Interactive diagram: https://gitdiagram.com/leluza/appfullstackparaportfoliofront
- Repository: https://github.com/leluza/appfullstackparaportfoliofront

## Overview

##### Project Type and Purpose
- This is a hybrid PWA + mobile front-end application built with Ionic React and Capacitor.
- It targets both web browsers (served at localhost:3000) and Android (packaged via Capacitor).
- It consumes data from an external backend REST API (not included in this repo), providing CRUD pages for customers, employees, and suppliers.

##### File Structure
Top-level:
- capacitor.config.ts, ionic.config.json – Ionic & Capacitor configuration
- Dockerfile, .env/.env.production – (potential) containerization & env setup
- android/ – Capacitor’s Android platform integration
- public/ – Static assets & PWA manifest for web
- src/ – React + TypeScript application code
- package.json / node_modules – build/runtime dependencies
Inside src/:
- pages/ – page-level components and “Api” modules for HTTP calls
- components/ – shared UI components (Menu, ExploreContainer, etc.)
- theme/ – global CSS variables & card styling
- serviceWorkerRegistration.ts & service-worker.ts – PWA caching layer
- reportWebVitals.ts – performance measuring

##### Key Architectural Patterns
- Single-Page Application (SPA) using React + Ionic UI components
- PWA with Service Worker for offline support & manifest.json for installability
- Capacitor native bridge to package the same codebase for Android
- Clean separation between UI pages and API modules (CustomerApi, EmployeeApi, SupplierApi)

##### Main Components and Their Interactions
a. User Interfaces
- Web Browser (served by npm start / React dev server)
- Android App (wrapped by Capacitor, running on Android OS)
b. Front-End Application
- Ionic/React SPA – UI pages & shared components
- Service Worker – caches assets & API responses (optional offline support)
c. Native Layer (Android)
- Capacitor Runtime – bridges web code to native Android APIs
d. External Backend
- REST API – provides JSON endpoints for Customers, Employees, Suppliers

##### Relationships & Data Flows
1. User → Browser/Android App: interacts with UI components (pages/forms).
2. SPA → API Modules: CustomerApi, EmployeeApi, SupplierApi make HTTP requests.
3. HTTP(s) → External Backend: returns JSON responses.
4. Service Worker (if active) intercepts requests for caching strategies.
5. Capacitor Bridge (Android only): if requesting native functionality (e.g., file system, camera), calls Android plugins.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User interaction
    User["User"]:::external
    subgraph "Client Devices"
        Browser["Web Browser"]:::frontend
        Mobile["Android App"]:::native
    end
    User -->|"interacts with"| Browser
    User -->|"interacts with"| Mobile

    %% Frontend SPA
    subgraph "Front-End (Ionic/React SPA)" 
        direction TB
        Core["SPA Core\n(src/index.tsx, src/App.tsx)"]:::frontend
        subgraph "Pages (src/pages)" 
            direction TB
            CustList["CustomerList"]:::pages
            CustEdit["CustomerEdit"]:::pages
            CustView["Customer"]:::pages
            EmpList["EmployeeList"]:::pages
            EmpEdit["EmployeeEdit"]:::pages
            EmpView["Employee"]:::pages
            SuppList["SupplierList"]:::pages
            SuppEdit["SupplierEdit"]:::pages
            SuppView["Supplier"]:::pages
            CV["Cv"]:::pages
            PageBase["Page"]:::pages
        end
        subgraph "Shared Components (src/components)"
            direction TB
            Menu["Menu"]:::components
            Explore["ExploreContainer"]:::components
        end
        subgraph "Theme & Styling (src/theme)"
            direction TB
            Variables["variables.css"]:::theme
            CardStyle["cardStyle.css"]:::theme
        end
        Core --> Pages
        Core --> Menu
        Core --> Explore
        Core --> Variables
        Core --> CardStyle
        SW["Service Worker"]:::sw
        Core -->|"registers"| SW
    end

    Browser -->|"loads SPA"| Core
    Mobile -->|"loads SPA via Capacitor WebView"| Core

    %% Service Worker intercept
    SW -->|"caches requests"| Core

    %% External Backend
    API["External REST API"]:::external
    Core -->|"HTTP(s) calls via CustomerApi, EmployeeApi, SupplierApi"| API

    %% Native Bridge
    CB["Capacitor Bridge"]:::native
    Core -->|"native plugin calls"| CB
    CB -->|"Android runtime calls"| Mobile

    %% Build & Env
    subgraph "Build & Deployment"
        direction TB
        NodeBuild["Node.js Build (npm/webpack)"]:::build
        Env[".env, .env.production"]:::build
        Docker["Dockerfile"]:::build
    end
    Env --> NodeBuild
    NodeBuild --> Browser
    NodeBuild --> Mobile
    Docker --> NodeBuild

    %% Click Events
    click Core "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/index.tsx"
    click Core "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/App.tsx"
    click CustList "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/customer/CustomerList.tsx"
    click CustEdit "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/customer/CustomerEdit.tsx"
    click CustView "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/customer/Customer.ts"
    click EmpList "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/employee/EmployeeList.tsx"
    click EmpEdit "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/employee/EmployeeEdit.tsx"
    click EmpView "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/employee/Employee.ts"
    click SuppList "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/supplier/SupplierList.tsx"
    click SuppEdit "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/supplier/SupplierEdit.tsx"
    click SuppView "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/supplier/Supplier.ts"
    click CV "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/cv/Cv.tsx"
    click PageBase "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/pages/Page.tsx"
    click Menu "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/components/Menu.tsx"
    click Explore "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/components/ExploreContainer.tsx"
    click Variables "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/theme/variables.css"
    click CardStyle "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/theme/cardStyle.css"
    click SW "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/service-worker.ts"
    click SW "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/src/serviceWorkerRegistration.ts"
    click Env "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/.env"
    click Env "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/.env.production"
    click Docker "https://github.com/leluza/appfullstackparaportfoliofront/tree/main/Dockerfile"
    click CB "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/capacitor.config.ts"
    click CB "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/ionic.config.json"
    click Mobile "https://github.com/leluza/appfullstackparaportfoliofront/tree/main/android/"
    click Mobile "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/android/app/src/main/assets/capacitor.config.json"
    click Mobile "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/android/app/src/main/assets/capacitor.plugins.json"
    click Mobile "https://github.com/leluza/appfullstackparaportfoliofront/blob/main/android/app/src/main/java/io/ionic/starter/MainActivity.java"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#034293
    classDef pages fill:#E8F4FF,stroke:#1f76d1,color:#0b3d91
    classDef components fill:#E0FFFA,stroke:#20c997,color:#117a65
    classDef theme fill:#F0FFF0,stroke:#28a745,color:#19692c
    classDef sw fill:#FFF4E5,stroke:#ff8c00,color:#cc7000
    classDef native fill:#FFF0F0,stroke:#dc3545,color:#a71d2a
    classDef external fill:#E8FFE8,stroke:#28a745,color:#19692c
    classDef build fill:#F8F9FA,stroke:#6c757d,color:#343a40
```
