# maneesh-007/minimartapi architecture

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

- Interactive diagram: https://gitdiagram.com/maneesh-007/minimartapi
- Repository: https://github.com/maneesh-007/minimartapi

## Overview

This is a FastAPI minimart API. The main user-to-result flows are customer registration/login and product/category management, with SQL-backed customer/app-info records and MongoDB-backed catalog/activity documents. Product creation can also upload images to S3-compatible storage. The sampled entry point shows which routers are mounted and initializes MongoDB; activity-log and admin route behavior was not excerpted, so their internal flows are not inferred.

Main entry points: [`main.py`](https://github.com/maneesh-007/minimartapi/blob/main/main.py) (FastAPI application), [`routes/customer.py`](https://github.com/maneesh-007/minimartapi/blob/main/routes/customer.py) (Customer endpoints), [`routes/product.py`](https://github.com/maneesh-007/minimartapi/blob/main/routes/product.py) (Product endpoints), [`mongo_database.py`](https://github.com/maneesh-007/minimartapi/blob/main/mongo_database.py) (MongoDB initialization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API entry and routes"]
  node_app["FastAPI application<br/>[main.py]"]
  node_customer_routes["Customer endpoints<br/>[customer.py]"]
  node_appinfo_routes["App-info endpoints<br/>[appinfo.py]"]
  node_product_routes["Product endpoints<br/>[product.py]"]
  node_activity_routes["Activity-log endpoints<br/>[activitylog.py]"]
  node_admin_routes["Admin endpoints<br/>[admin.py]"]
end

subgraph group_identity["Customer identity"]
  node_identity_logic["Password and token utilities<br/>[utility.py]"]
  node_customer_model[("Customer records<br/>[customer.py]")]
end

subgraph group_catalog["Catalog and media"]
  node_product_model[("Product documents<br/>[product.py]")]
  node_category_model[("Category documents<br/>[category.py]")]
end

subgraph group_data["Persistence and schemas"]
  node_customer_schema["Customer request schemas<br/>[customer.py]"]
  node_appinfo_schema["App-info schema<br/>[appinfo.py]"]
  node_product_schema["Product schema<br/>[product.py]"]
  node_activity_schema["Activity-log schema<br/>[activitylog.py]"]
  node_sql_models[("SQL app-info and admin records")]
  node_sql_database[("SQL session access<br/>[mydatabase.py]")]
  node_activity_model[("Activity-log documents<br/>[activitylog.py]")]
  node_mongo_init["MongoDB initialization<br/>[mongo_database.py]"]
end

node_client(("API client"))
node_s3[("S3-compatible object storage")]

node_client -->|"sends requests"| node_app
node_app -->|"mounts"| node_customer_routes
node_app -->|"mounts"| node_appinfo_routes
node_app -->|"mounts"| node_product_routes
node_app -->|"mounts"| node_activity_routes
node_app -->|"initializes MongoDB"| node_mongo_init
node_customer_routes -->|"validates with"| node_customer_schema
node_customer_routes -->|"uses"| node_identity_logic
node_customer_routes -->|"queries and writes"| node_customer_model
node_customer_routes -->|"gets sessions"| node_sql_database
node_identity_logic -->|"loads customer"| node_customer_model
node_identity_logic -->|"gets sessions"| node_sql_database
node_appinfo_routes -->|"accepts"| node_appinfo_schema
node_appinfo_routes -->|"creates records"| node_sql_models
node_appinfo_routes -->|"gets sessions"| node_sql_database
node_product_routes -->|"accepts"| node_product_schema
node_product_routes -->|"inserts and reads"| node_product_model
node_product_routes -->|"inserts and reads"| node_category_model
node_product_routes -->|"uploads images"| node_s3
node_activity_routes -->|"uses"| node_activity_schema
node_activity_routes -->|"uses"| node_activity_model
node_app -->|"closes MongoDB"| node_mongo_init
node_mongo_init -->|"registers models"| node_product_model
node_mongo_init -->|"registers models"| node_category_model
node_mongo_init -->|"registers models"| node_activity_model

click node_app "https://github.com/maneesh-007/minimartapi/blob/main/main.py"
click node_customer_routes "https://github.com/maneesh-007/minimartapi/blob/main/routes/customer.py"
click node_appinfo_routes "https://github.com/maneesh-007/minimartapi/blob/main/routes/appinfo.py"
click node_product_routes "https://github.com/maneesh-007/minimartapi/blob/main/routes/product.py"
click node_activity_routes "https://github.com/maneesh-007/minimartapi/blob/main/routes/activitylog.py"
click node_admin_routes "https://github.com/maneesh-007/minimartapi/blob/main/routes/admin.py"
click node_identity_logic "https://github.com/maneesh-007/minimartapi/blob/main/utility.py"
click node_customer_schema "https://github.com/maneesh-007/minimartapi/blob/main/schemas/customer.py"
click node_appinfo_schema "https://github.com/maneesh-007/minimartapi/blob/main/schemas/appinfo.py"
click node_product_schema "https://github.com/maneesh-007/minimartapi/blob/main/schemas/product.py"
click node_activity_schema "https://github.com/maneesh-007/minimartapi/blob/main/schemas/activitylog.py"
click node_customer_model "https://github.com/maneesh-007/minimartapi/blob/main/models/sql/customer.py"
click node_sql_models "https://github.com/maneesh-007/minimartapi/tree/main/models/sql"
click node_sql_database "https://github.com/maneesh-007/minimartapi/blob/main/mydatabase.py"
click node_product_model "https://github.com/maneesh-007/minimartapi/blob/main/models/nosql/product.py"
click node_category_model "https://github.com/maneesh-007/minimartapi/blob/main/models/nosql/category.py"
click node_activity_model "https://github.com/maneesh-007/minimartapi/blob/main/models/nosql/activitylog.py"
click node_mongo_init "https://github.com/maneesh-007/minimartapi/blob/main/mongo_database.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,node_customer_routes,node_appinfo_routes,node_product_routes,node_activity_routes,node_admin_routes,node_client toneBlue
class node_identity_logic,node_customer_model,node_s3 toneAmber
class node_product_model,node_category_model toneMint
class node_customer_schema,node_appinfo_schema,node_product_schema,node_activity_schema,node_sql_models,node_sql_database,node_activity_model,node_mongo_init toneRose
```

## Components

### API entry and routes

- [FastAPI application](https://github.com/maneesh-007/minimartapi/blob/main/main.py): `main.py`
- [Customer endpoints](https://github.com/maneesh-007/minimartapi/blob/main/routes/customer.py): `routes/customer.py`
- [App-info endpoints](https://github.com/maneesh-007/minimartapi/blob/main/routes/appinfo.py): `routes/appinfo.py`
- [Product endpoints](https://github.com/maneesh-007/minimartapi/blob/main/routes/product.py): `routes/product.py`
- [Activity-log endpoints](https://github.com/maneesh-007/minimartapi/blob/main/routes/activitylog.py): `routes/activitylog.py`
- [Admin endpoints](https://github.com/maneesh-007/minimartapi/blob/main/routes/admin.py): `routes/admin.py`

### Customer identity

- [Password and token utilities](https://github.com/maneesh-007/minimartapi/blob/main/utility.py): `utility.py`
- [Customer records](https://github.com/maneesh-007/minimartapi/blob/main/models/sql/customer.py): `models/sql/customer.py`

### Catalog and media

- [Product documents](https://github.com/maneesh-007/minimartapi/blob/main/models/nosql/product.py): `models/nosql/product.py`
- [Category documents](https://github.com/maneesh-007/minimartapi/blob/main/models/nosql/category.py): `models/nosql/category.py`

### Persistence and schemas

- [Customer request schemas](https://github.com/maneesh-007/minimartapi/blob/main/schemas/customer.py): `schemas/customer.py`
- [App-info schema](https://github.com/maneesh-007/minimartapi/blob/main/schemas/appinfo.py): `schemas/appinfo.py`
- [Product schema](https://github.com/maneesh-007/minimartapi/blob/main/schemas/product.py): `schemas/product.py`
- [Activity-log schema](https://github.com/maneesh-007/minimartapi/blob/main/schemas/activitylog.py): `schemas/activitylog.py`
- [SQL app-info and admin records](https://github.com/maneesh-007/minimartapi/tree/main/models/sql): `models/sql`
- [SQL session access](https://github.com/maneesh-007/minimartapi/blob/main/mydatabase.py): `mydatabase.py`
- [Activity-log documents](https://github.com/maneesh-007/minimartapi/blob/main/models/nosql/activitylog.py): `models/nosql/activitylog.py`
- [MongoDB initialization](https://github.com/maneesh-007/minimartapi/blob/main/mongo_database.py): `mongo_database.py`

### Other components

- **API client**
- **S3-compatible object storage**

## Connections

- API client → FastAPI application: sends requests
- FastAPI application → Customer endpoints: mounts (evidence: `main.py`)
- FastAPI application → App-info endpoints: mounts (evidence: `main.py`)
- FastAPI application → Product endpoints: mounts (evidence: `main.py`)
- FastAPI application → Activity-log endpoints: mounts (evidence: `main.py`)
- FastAPI application → MongoDB initialization: initializes MongoDB (evidence: `main.py`)
- Customer endpoints → Customer request schemas: validates with (evidence: `routes/customer.py`)
- Customer endpoints → Password and token utilities: uses (evidence: `routes/customer.py`)
- Customer endpoints → Customer records: queries and writes (evidence: `routes/customer.py`)
- Customer endpoints → SQL session access: gets sessions (evidence: `routes/customer.py`)
- Password and token utilities → Customer records: loads customer (evidence: `utility.py`)
- Password and token utilities → SQL session access: gets sessions (evidence: `utility.py`)
- App-info endpoints → App-info schema: accepts (evidence: `routes/appinfo.py`)
- App-info endpoints → SQL app-info and admin records: creates records (evidence: `routes/appinfo.py`)
- App-info endpoints → SQL session access: gets sessions (evidence: `routes/appinfo.py`)
- Product endpoints → Product schema: accepts (evidence: `routes/product.py`)
- Product endpoints → Product documents: inserts and reads (evidence: `routes/product.py`)
- Product endpoints → Category documents: inserts and reads (evidence: `routes/product.py`)
- Product endpoints → S3-compatible object storage: uploads images (evidence: `routes/product.py`)
- Activity-log endpoints → Activity-log schema: uses (evidence: `routes/activitylog.py`)
- Activity-log endpoints → Activity-log documents: uses (evidence: `routes/activitylog.py`)
- FastAPI application → MongoDB initialization: closes MongoDB (evidence: `main.py`)
- MongoDB initialization → Product documents: registers models (evidence: `mongo_database.py`)
- MongoDB initialization → Category documents: registers models (evidence: `mongo_database.py`)
- MongoDB initialization → Activity-log documents: registers models (evidence: `mongo_database.py`)
