# taufit23/foodstore architecture

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

- Interactive diagram: https://gitdiagram.com/taufit23/foodstore
- Repository: https://github.com/taufit23/foodstore

## Overview

##### Project type and purpose
- This is a full-stack, monolithic web application built on Laravel 9 (“FoodStore”).
- It supports multiple user roles (public shoppers, store owners (“toko”), and admins) and provides features like category browsing, product detail, comments, Google Maps integration, and user management.

##### File structure
- **app/** – Laravel MVC: Controllers (HTTP, Console), Models, Requests (validation), Middleware, Exception handlers, Service Providers.
- **routes/** – Defines HTTP/web and API endpoints.
- **resources/** – Front-end assets and templates: Blade views (public & private sections), SCSS, minimal Vue components/router for some interactive parts.
- **public/** – Static assets (CSS, JS, images), entry point (index.php), AdminLTE template under public/private.
- **database/** – Migrations, factories, and seeders for DB schema and test data.
- **config/** – App configuration (database, services, queues, image, Google Maps).
- **bootstrap/cache, storage/** – Caching and persistent storage.
- **webpack.mix.js & package.json** – Front-end build pipeline via Laravel Mix (Webpack).
- **composer.json** – PHP dependencies.

##### README
- Confirms Laravel 9, PHP 8 required, basic install and serve instructions.
- Mentions Google Maps for shop location detail.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (Client)" 
        direction TB
        Browser["Web Browser"]:::ui
        StaticAssets["Static Assets\n(CSS/JS/Images)"]:::ui
    end

    %% Web Server Layer
    subgraph "Web Server" 
        direction TB
        WebServer["Nginx/Apache + PHP-FPM"]:::app
        WebEntry["public/index.php"]:::app
    end

    %% Application Layer
    subgraph "Laravel Application" 
        direction TB
        Bootstrap["Application Bootstrap\n(bootstrap/app.php)"]:::app
        ServiceProviders["Service Providers"]:::app
        Routing["Routing Layer"]:::app
        Middleware["Middleware Pipeline"]:::app
        Controllers["Controllers"]:::app
        FormRequests["Form Request Validation"]:::app
        Models["Models"]:::app
        Views["Blade Views & Templates"]:::app
        Configs["Configuration Files"]:::app
    end

    %% Data Stores
    subgraph "Data & Storage" 
        direction TB
        DB["Database\n(MySQL/PostgreSQL)"]:::store
        Cache["Cache\n(Redis/File)"]:::store
        FileStorage["File Storage\n(storage/app/public)"]:::store
    end

    %% External Services
    subgraph "External Services" 
        direction TB
        GoogleMaps["Google Maps API"]:::external
        MailService["Mail Service"]:::external
    end

    %% Connections
    Browser -->|HTTP/HTTPS| WebServer
    WebServer -->|Load index.php| WebEntry
    WebEntry -->|Bootstrap| Bootstrap
    Bootstrap --> ServiceProviders
    ServiceProviders --> Routing
    Routing --> Controllers
    Controllers --> Models
    Controllers --> Views
    Controllers --> FormRequests
    Controllers --> Middleware
    Controllers -->|Query/Update| DB
    Controllers -->|Cache Read/Write| Cache
    Controllers -->|Store Files| FileStorage
    Controllers -->|Call API| GoogleMaps
    Controllers -->|Send Email| MailService
    StaticAssets -->|Served by| WebServer

    %% Click Events
    click WebEntry "https://github.com/taufit23/foodstore/blob/main/public/index.php"
    click Bootstrap "https://github.com/taufit23/foodstore/blob/main/bootstrap/app.php"
    click Routing "https://github.com/taufit23/foodstore/blob/main/routes/web.php"
    click Routing "https://github.com/taufit23/foodstore/blob/main/routes/api.php"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366D6,stroke-width:1px;
    classDef app fill:#E6F4EA,stroke:#2E8B57,stroke-width:1px;
    classDef store fill:#FFE7C2,stroke:#D2691E,stroke-width:1px;
    classDef external fill:#E8D0FF,stroke:#800080,stroke-width:1px;
```
