# codyvijay/grocery_store architecture

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

- Interactive diagram: https://gitdiagram.com/codyvijay/grocery_store
- Repository: https://github.com/codyvijay/grocery_store

## Overview

This is a role-based grocery-store web application: visitors can register or log in, shoppers browse and order products, managers maintain catalog data and handle requests, and administrators manage manager roles. Flask serves role-specific pages and API endpoints; separate Vue entry points provide the public, shopper, manager, and admin interfaces. The tree and excerpts support the app wiring, role routing, manager catalog/request actions, and scheduled email/report tasks. Most API handlers, shopper checkout behavior, persistence details, and admin wiring are unsampled, so those links are shown only at the subsystem level where supported.

Main entry points: [`grocery_store_v2/application/api.py`](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/api.py) (REST API), [`grocery_store_v2/app.py`](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/app.py) (Flask application), [`grocery_store_v2/static/vue/user_main.js`](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_main.js) (Shopper interface), [`grocery_store_v2/static/vue/manager_main.js`](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_main.js) (Manager interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interfaces"]
  node_public_ui["Public entry<br/>[main.js]"]
  node_shopper_ui["Shopper interface<br/>[user_main.js]"]
  node_manager_ui["Manager interface<br/>[manager_main.js]"]
  node_admin_ui["Admin interface<br/>[admin_main.js]"]
end

subgraph group_server["Application server"]
  node_app["Flask application<br/>[app.py]"]
  node_page_routes["Role page routes<br/>[controllers.py]"]
  node_api["REST API<br/>[api.py]"]
  node_security["Authentication<br/>[security.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_database[("Application database<br/>[database.py]")]
end

subgraph group_commerce["Store operations"]
  node_shopper_catalog["Browse catalog<br/>[user_products.js]"]
  node_shopper_cart["Cart and checkout<br/>[user_checkout.js]"]
  node_shopper_orders["Order history<br/>[my_orders.js]"]
  node_manager_catalog["Catalog management"]
  node_manager_categories["Category management"]
  node_manager_requests["Manager requests"]
  node_admin_managers["Manager approvals<br/>[managers.js]"]
end

subgraph group_async["Background services"]
  node_tasks["Scheduled tasks<br/>[tasks.py]"]
  node_worker["Celery worker<br/>[workers.py]"]
end

node_visitor(("Visitor / user"))
node_mail["SMTP mail service"]
node_browser(("Web browser"))

node_visitor -->|"uses"| node_browser
node_browser -->|"loads"| node_public_ui
node_browser -->|"loads"| node_shopper_ui
node_browser -->|"loads"| node_manager_ui
node_browser -->|"loads"| node_admin_ui
node_public_ui -->|"HTTP requests"| node_app
node_shopper_ui -->|"API requests"| node_api
node_manager_ui -->|"API requests"| node_api
node_admin_ui -->|"API requests"| node_api
node_app -->|"imports"| node_api
node_app -->|"imports"| node_page_routes
node_app -->|"initializes"| node_database
node_app -->|"initializes"| node_security
node_page_routes -->|"queries and commits"| node_database
node_page_routes -->|"redirects or renders"| node_browser
node_manager_ui -->|"routes to"| node_manager_catalog
node_manager_ui -->|"routes to"| node_manager_categories
node_manager_ui -->|"routes to"| node_manager_requests
node_shopper_ui -->|"routes to"| node_shopper_catalog
node_shopper_ui -->|"routes to"| node_shopper_cart
node_shopper_ui -->|"routes to"| node_shopper_orders
node_manager_catalog -->|"sends requests"| node_api
node_manager_categories -->|"sends requests"| node_api
node_manager_requests -->|"sends requests"| node_api
node_admin_managers -->|"sends requests"| node_api
node_api -->|"uses"| node_database
node_api -->|"uses"| node_models
node_app -->|"configures"| node_worker
node_worker -->|"runs"| node_tasks
node_tasks -->|"queries"| node_database
node_tasks -->|"sends email"| node_mail

click node_public_ui "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/main.js"
click node_shopper_ui "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_main.js"
click node_manager_ui "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_main.js"
click node_admin_ui "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/admin_main.js"
click node_app "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/app.py"
click node_page_routes "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/controllers.py"
click node_api "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/api.py"
click node_security "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/security.py"
click node_models "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/models.py"
click node_database "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/database.py"
click node_shopper_catalog "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_components/user_products.js"
click node_shopper_cart "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_components/user_checkout.js"
click node_shopper_orders "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_components/my_orders.js"
click node_manager_catalog "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_components/manager_products.js"
click node_manager_categories "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_components/manager_categories.js"
click node_manager_requests "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_components/manager_requests.js"
click node_admin_managers "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/admin_components/managers.js"
click node_tasks "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/tasks.py"
click node_worker "https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/workers.py"

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_public_ui,node_shopper_ui,node_manager_ui,node_admin_ui,node_visitor,node_browser toneBlue
class node_app,node_page_routes,node_api,node_security,node_models,node_database toneAmber
class node_shopper_catalog,node_shopper_cart,node_shopper_orders,node_manager_catalog,node_manager_categories,node_manager_requests,node_admin_managers toneMint
class node_tasks,node_worker toneRose
class node_mail toneIndigo
```

## Components

### Web interfaces

- [Public entry](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/main.js): `grocery_store_v2/static/vue/main.js`
- [Shopper interface](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_main.js): `grocery_store_v2/static/vue/user_main.js`
- [Manager interface](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_main.js): `grocery_store_v2/static/vue/manager_main.js`
- [Admin interface](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/admin_main.js): `grocery_store_v2/static/vue/admin_main.js`

### Application server

- [Flask application](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/app.py): `grocery_store_v2/app.py`
- [Role page routes](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/controllers.py): `grocery_store_v2/application/controllers.py`
- [REST API](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/api.py): `grocery_store_v2/application/api.py`
- [Authentication](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/security.py): `grocery_store_v2/application/security.py`
- [Domain models](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/models.py): `grocery_store_v2/application/models.py`
- [Application database](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/database.py): `grocery_store_v2/application/database.py`

### Store operations

- [Browse catalog](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_components/user_products.js): `grocery_store_v2/static/vue/user_components/user_products.js`
- [Cart and checkout](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_components/user_checkout.js): `grocery_store_v2/static/vue/user_components/user_checkout.js`
- [Order history](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/user_components/my_orders.js): `grocery_store_v2/static/vue/user_components/my_orders.js`
- [Catalog management](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_components/manager_products.js): `grocery_store_v2/static/vue/manager_components/manager_products.js`
- [Category management](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_components/manager_categories.js): `grocery_store_v2/static/vue/manager_components/manager_categories.js`
- [Manager requests](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/manager_components/manager_requests.js): `grocery_store_v2/static/vue/manager_components/manager_requests.js`
- [Manager approvals](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/static/vue/admin_components/managers.js): `grocery_store_v2/static/vue/admin_components/managers.js`

### Background services

- [Scheduled tasks](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/tasks.py): `grocery_store_v2/application/tasks.py`
- [Celery worker](https://github.com/codyvijay/grocery_store/blob/master/grocery_store_v2/application/workers.py): `grocery_store_v2/application/workers.py`

### Other components

- **Visitor / user**
- **SMTP mail service**
- **Web browser**

## Connections

- Visitor / user → Web browser: uses
- Web browser → Public entry: loads
- Web browser → Shopper interface: loads
- Web browser → Manager interface: loads
- Web browser → Admin interface: loads
- Public entry → Flask application: HTTP requests
- Shopper interface → REST API: API requests
- Manager interface → REST API: API requests
- Admin interface → REST API: API requests
- Flask application → REST API: imports
- Flask application → Role page routes: imports
- Flask application → Application database: initializes
- Flask application → Authentication: initializes
- Role page routes → Application database: queries and commits
- Role page routes → Web browser: redirects or renders
- Manager interface → Catalog management: routes to
- Manager interface → Category management: routes to
- Manager interface → Manager requests: routes to
- Shopper interface → Browse catalog: routes to
- Shopper interface → Cart and checkout: routes to
- Shopper interface → Order history: routes to
- Catalog management → REST API: sends requests
- Category management → REST API: sends requests
- Manager requests → REST API: sends requests
- Manager approvals → REST API: sends requests
- REST API → Application database: uses
- REST API → Domain models: uses
- Flask application → Celery worker: configures
- Celery worker → Scheduled tasks: runs
- Scheduled tasks → Application database: queries
- Scheduled tasks → SMTP mail service: sends email
