# achyutak41/crochet-oasis architecture

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

- Interactive diagram: https://gitdiagram.com/achyutak41/crochet-oasis
- Repository: https://github.com/achyutak41/crochet-oasis

## Overview

Crochet Oasis is a handmade-products storefront with customer accounts, cart-based order requests and an admin area for managing products and order statuses. The main flow is product browsing, cart review, customer details and order submission; payment is handled manually rather than through an indicated payment integration. The frontend contexts connect product and order workflows to Flask routes, which use SQLAlchemy models and SQLite. Admin and authentication capabilities are represented from the route structure and sampled backend code; unsampled page behavior and wiring are not assumed.

Main entry points: [`frontend/src/App.jsx`](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/App.jsx) (App routing), [`backend/routes/order_routes.py`](https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/order_routes.py) (Order routes), [`backend/routes/product_routes.py`](https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/product_routes.py) (Product routes), [`backend/app.py`](https://github.com/achyutak41/crochet-oasis/blob/main/backend/app.py) (Flask application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app_router["App routing<br/>[App.jsx]"]
  node_product_pages["Product browsing<br/>[Products.jsx]"]
  node_product_state["Product state<br/>[ProductContext.jsx]"]
  node_customer_accounts["Account pages<br/>[Login.jsx]"]
  node_auth_state["Auth state<br/>[AuthContext.jsx]"]
end

subgraph group_customer_flow["Customer Flow"]
  node_cart_page["Cart<br/>[Cart.jsx]"]
  node_cart_state["Cart state<br/>[CartContext.jsx]"]
  node_order_request["Order request<br/>[OrderRequest.jsx]"]
  node_order_state["Order state<br/>[OrderContext.jsx]"]
  node_customer_orders["Order history<br/>[MyOrders.jsx]"]
end

subgraph group_administration["Administration"]
  node_admin_pages["Admin pages<br/>[AdminDashboard.jsx]"]
  node_admin_products["Product management<br/>[AdminProducts.jsx]"]
  node_admin_orders["Order management<br/>[AdminOrders.jsx]"]
  node_admin_auth["Admin access"]
end

subgraph group_backend["Backend API"]
  node_api_app["Flask application<br/>[app.py]"]
  node_auth_routes["Authentication routes<br/>[auth_routes.py]"]
  node_product_routes["Product routes<br/>[product_routes.py]"]
  node_order_routes["Order routes<br/>[order_routes.py]"]
  node_user_model["User model<br/>[user.py]"]
  node_product_model["Product model<br/>[product.py]"]
  node_order_model["Order models<br/>[order.py]"]
  node_sqlite[("SQLite database<br/>[app.py]")]
end

node_customer(("Customer"))
node_admin_user(("Admin"))

node_customer -->|"uses"| node_app_router
node_admin_user -->|"uses"| node_app_router
node_app_router -->|"routes to"| node_product_pages
node_app_router -->|"routes to"| node_cart_page
node_app_router -->|"routes to"| node_order_request
node_app_router -->|"routes to"| node_customer_accounts
node_app_router -->|"routes to"| node_customer_orders
node_app_router -->|"routes to"| node_admin_pages
node_app_router -->|"routes to"| node_admin_products
node_app_router -->|"routes to"| node_admin_orders
node_app_router -->|"provides"| node_product_state
node_app_router -->|"provides"| node_cart_state
node_app_router -->|"provides"| node_order_state
node_app_router -->|"provides"| node_auth_state
node_app_router -->|"provides"| node_admin_auth
node_product_state -->|"requests products"| node_product_routes
node_order_state -->|"requests orders"| node_order_routes
node_order_request -->|"creates order"| node_order_state
node_order_request -->|"reads cart"| node_cart_state
node_api_app -->|"registers"| node_auth_routes
node_api_app -->|"registers"| node_product_routes
node_api_app -->|"registers"| node_order_routes
node_auth_routes -->|"queries and updates"| node_user_model
node_product_routes -->|"queries and updates"| node_product_model
node_order_routes -->|"validates items"| node_product_model
node_order_routes -->|"creates and updates"| node_order_model
node_auth_routes -->|"persists users"| node_sqlite
node_product_routes -->|"persists products"| node_sqlite
node_order_routes -->|"persists orders"| node_sqlite

click node_app_router "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/App.jsx"
click node_product_pages "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/Products.jsx"
click node_product_state "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/ProductContext.jsx"
click node_cart_page "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/Cart.jsx"
click node_cart_state "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/CartContext.jsx"
click node_order_request "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/OrderRequest.jsx"
click node_order_state "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/OrderContext.jsx"
click node_customer_orders "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/MyOrders.jsx"
click node_customer_accounts "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/Login.jsx"
click node_auth_state "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/AuthContext.jsx"
click node_admin_pages "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/admin/AdminDashboard.jsx"
click node_admin_products "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/admin/AdminProducts.jsx"
click node_admin_orders "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/admin/AdminOrders.jsx"
click node_admin_auth "https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/AdminAuthContext.jsx"
click node_api_app "https://github.com/achyutak41/crochet-oasis/blob/main/backend/app.py"
click node_auth_routes "https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/auth_routes.py"
click node_product_routes "https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/product_routes.py"
click node_order_routes "https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/order_routes.py"
click node_user_model "https://github.com/achyutak41/crochet-oasis/blob/main/backend/models/user.py"
click node_product_model "https://github.com/achyutak41/crochet-oasis/blob/main/backend/models/product.py"
click node_order_model "https://github.com/achyutak41/crochet-oasis/blob/main/backend/models/order.py"
click node_sqlite "https://github.com/achyutak41/crochet-oasis/blob/main/backend/app.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_app_router,node_product_pages,node_product_state,node_customer_accounts,node_auth_state toneBlue
class node_cart_page,node_cart_state,node_order_request,node_order_state,node_customer_orders toneAmber
class node_admin_pages,node_admin_products,node_admin_orders,node_admin_auth toneMint
class node_api_app,node_auth_routes,node_product_routes,node_order_routes,node_user_model,node_product_model,node_order_model,node_sqlite toneRose
class node_customer,node_admin_user toneIndigo
```

## Components

### Storefront

- [App routing](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Product browsing](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/Products.jsx): `frontend/src/pages/Products.jsx`
- [Product state](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/ProductContext.jsx): `frontend/src/context/ProductContext.jsx`
- [Account pages](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Auth state](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`

### Customer Flow

- [Cart](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/Cart.jsx): `frontend/src/pages/Cart.jsx`
- [Cart state](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Order request](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/OrderRequest.jsx): `frontend/src/pages/OrderRequest.jsx`
- [Order state](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/OrderContext.jsx): `frontend/src/context/OrderContext.jsx`
- [Order history](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/MyOrders.jsx): `frontend/src/pages/MyOrders.jsx`

### Administration

- [Admin pages](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/admin/AdminDashboard.jsx): `frontend/src/pages/admin/AdminDashboard.jsx`
- [Product management](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/admin/AdminProducts.jsx): `frontend/src/pages/admin/AdminProducts.jsx`
- [Order management](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/pages/admin/AdminOrders.jsx): `frontend/src/pages/admin/AdminOrders.jsx`
- [Admin access](https://github.com/achyutak41/crochet-oasis/blob/main/frontend/src/context/AdminAuthContext.jsx): `frontend/src/context/AdminAuthContext.jsx`

### Backend API

- [Flask application](https://github.com/achyutak41/crochet-oasis/blob/main/backend/app.py): `backend/app.py`
- [Authentication routes](https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/auth_routes.py): `backend/routes/auth_routes.py`
- [Product routes](https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/product_routes.py): `backend/routes/product_routes.py`
- [Order routes](https://github.com/achyutak41/crochet-oasis/blob/main/backend/routes/order_routes.py): `backend/routes/order_routes.py`
- [User model](https://github.com/achyutak41/crochet-oasis/blob/main/backend/models/user.py): `backend/models/user.py`
- [Product model](https://github.com/achyutak41/crochet-oasis/blob/main/backend/models/product.py): `backend/models/product.py`
- [Order models](https://github.com/achyutak41/crochet-oasis/blob/main/backend/models/order.py): `backend/models/order.py`
- [SQLite database](https://github.com/achyutak41/crochet-oasis/blob/main/backend/app.py): `backend/app.py`

### Other components

- **Customer**
- **Admin**

## Connections

- Customer → App routing: uses
- Admin → App routing: uses
- App routing → Product browsing: routes to
- App routing → Cart: routes to
- App routing → Order request: routes to
- App routing → Account pages: routes to
- App routing → Order history: routes to
- App routing → Admin pages: routes to
- App routing → Product management: routes to
- App routing → Order management: routes to
- App routing → Product state: provides
- App routing → Cart state: provides
- App routing → Order state: provides
- App routing → Auth state: provides
- App routing → Admin access: provides
- Product state → Product routes: requests products
- Order state → Order routes: requests orders
- Order request → Order state: creates order
- Order request → Cart state: reads cart
- Flask application → Authentication routes: registers
- Flask application → Product routes: registers
- Flask application → Order routes: registers
- Authentication routes → User model: queries and updates
- Product routes → Product model: queries and updates
- Order routes → Product model: validates items
- Order routes → Order models: creates and updates
- Authentication routes → SQLite database: persists users
- Product routes → SQLite database: persists products
- Order routes → SQLite database: persists orders
