# dhanusrisenthikumar/furry-backend architecture

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

- Interactive diagram: https://gitdiagram.com/dhanusrisenthikumar/furry-backend
- Repository: https://github.com/dhanusrisenthikumar/furry-backend

## Overview

This is a MongoDB-backed pet-commerce API. Shoppers browse products, manage carts, get order quotes, place and pay for orders, then follow delivery, returns, rewards, and notifications; staff manage catalog and operations. The graph includes the documented domain branches and the shared persistence layer. Evidence is limited to the README (empty), SOURCE INDEX references, and sampled excerpts; unsampled routes and integrations are shown only where those references support the link.

Main entry points: [`app/main.py`](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/main.py) (API application), [`app/modules/orders/service.py`](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/orders/service.py) (Orders), [`app/modules/stock_alerts/service.py`](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/stock_alerts/service.py) (Stock alerts), [`app/modules/products/repository.py`](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/products/repository.py) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_api_app["API application<br/>[main.py]"]
  node_auth["Authentication<br/>[router.py]"]
  node_mcp["MCP tools<br/>[server.py]"]
end

subgraph group_commerce["Commerce lifecycle"]
  node_catalog["Product catalog<br/>[repository.py]"]
  node_cart["Cart<br/>[service.py]"]
  node_orders["Orders<br/>[service.py]"]
  node_payments["Payments<br/>[service.py]"]
  node_returns["Returns and refunds<br/>[service.py]"]
  node_pricing["Pricing and shipping<br/>[pricing.py]"]
  node_reviews["Reviews and questions<br/>[service.py]"]
  node_recommendations["Recommendations<br/>[service.py]"]
end

subgraph group_engagement["Customer services"]
  node_loyalty["Loyalty and referrals<br/>[service.py]"]
  node_notifications["Notifications<br/>[service.py]"]
  node_email["Email delivery<br/>[email.py]"]
  node_users["Customer accounts<br/>[service.py]"]
end

subgraph group_operations["Store operations"]
  node_stock_alerts["Stock alerts<br/>[service.py]"]
  node_subscriptions["Subscriptions<br/>[service.py]"]
  node_admin["Administration<br/>[service.py]"]
  node_scheduler["Subscription scheduler<br/>[scheduler.py]"]
end

subgraph group_storage["Persistence"]
  node_mongodb[("MongoDB connection<br/>[mongodb.py]")]
  node_repositories["Repository base<br/>[base_repository.py]"]
end

node_shopper(("Shopper"))
node_staff(("Staff"))

node_shopper -->|"uses API"| node_api_app
node_staff -->|"uses API"| node_api_app
node_api_app -->|"routes to"| node_auth
node_api_app -->|"mounts tools"| node_mcp
node_api_app -->|"initializes"| node_mongodb
node_api_app -->|"routes catalog"| node_catalog
node_api_app -->|"routes cart"| node_cart
node_api_app -->|"routes orders"| node_orders
node_api_app -->|"routes payments"| node_payments
node_api_app -->|"routes returns"| node_returns
node_api_app -->|"routes alerts"| node_stock_alerts
node_api_app -->|"routes admin"| node_admin
node_mcp -->|"uses order logic"| node_orders
node_mcp -->|"uses cart logic"| node_cart
node_mcp -->|"queries catalog"| node_catalog
node_orders -->|"checks stock"| node_catalog
node_orders -->|"calculates totals"| node_pricing
node_orders -.->|"coordinates payment"| node_payments
node_orders -->|"applies rewards"| node_loyalty
node_orders -->|"notifies lifecycle"| node_notifications
node_orders -->|"sends order mail"| node_email
node_orders -->|"flushes stock alerts"| node_stock_alerts
node_payments -->|"uses order service"| node_orders
node_returns -->|"checks eligibility"| node_orders
node_returns -->|"prices refunds"| node_pricing
node_returns -->|"reports decisions"| node_notifications
node_returns -->|"emails customer"| node_email
node_loyalty -->|"pushes rewards"| node_notifications
node_stock_alerts -->|"checks availability"| node_catalog
node_stock_alerts -->|"looks up customer"| node_users
node_stock_alerts -.->|"announces restock"| node_notifications
node_stock_alerts -->|"emails restock"| node_email
node_scheduler -->|"connects database"| node_mongodb
node_scheduler -.->|"runs due work"| node_subscriptions
node_recommendations -->|"ranks products"| node_catalog
node_reviews -->|"checks products"| node_catalog
node_reviews -->|"verifies purchases"| node_orders
node_users -.->|"persists accounts"| node_mongodb
node_repositories -.->|"accesses collections"| node_mongodb
node_admin -.->|"manages store data"| node_mongodb

click node_api_app "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/main.py"
click node_auth "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/auth/router.py"
click node_mcp "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/mcp/server.py"
click node_catalog "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/products/repository.py"
click node_cart "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/cart/service.py"
click node_orders "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/orders/service.py"
click node_payments "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/payments/service.py"
click node_returns "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/returns/service.py"
click node_pricing "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/core/pricing.py"
click node_reviews "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/reviews/service.py"
click node_recommendations "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/recommendations/service.py"
click node_loyalty "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/loyalty/service.py"
click node_notifications "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/notifications/service.py"
click node_email "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/core/email.py"
click node_users "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/users/service.py"
click node_stock_alerts "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/stock_alerts/service.py"
click node_subscriptions "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/subscriptions/service.py"
click node_admin "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/admin/service.py"
click node_scheduler "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/scheduler.py"
click node_mongodb "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/db/mongodb.py"
click node_repositories "https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/db/base_repository.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_api_app,node_auth,node_mcp toneBlue
class node_catalog,node_cart,node_orders,node_payments,node_returns,node_pricing,node_reviews,node_recommendations toneAmber
class node_loyalty,node_notifications,node_email,node_users toneMint
class node_stock_alerts,node_subscriptions,node_admin,node_scheduler toneRose
class node_mongodb,node_repositories,node_shopper,node_staff toneIndigo
```

## Components

### API and access

- [API application](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/main.py): `app/main.py`
- [Authentication](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/auth/router.py): `app/modules/auth/router.py`
- [MCP tools](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/mcp/server.py): `app/mcp/server.py`

### Commerce lifecycle

- [Product catalog](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/products/repository.py): `app/modules/products/repository.py`
- [Cart](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/cart/service.py): `app/modules/cart/service.py`
- [Orders](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/orders/service.py): `app/modules/orders/service.py`
- [Payments](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/payments/service.py): `app/modules/payments/service.py`
- [Returns and refunds](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/returns/service.py): `app/modules/returns/service.py`
- [Pricing and shipping](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/core/pricing.py): `app/core/pricing.py`
- [Reviews and questions](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/reviews/service.py): `app/modules/reviews/service.py`
- [Recommendations](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/recommendations/service.py): `app/modules/recommendations/service.py`

### Customer services

- [Loyalty and referrals](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/loyalty/service.py): `app/modules/loyalty/service.py`
- [Notifications](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/notifications/service.py): `app/modules/notifications/service.py`
- [Email delivery](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/core/email.py): `app/core/email.py`
- [Customer accounts](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/users/service.py): `app/modules/users/service.py`

### Store operations

- [Stock alerts](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/stock_alerts/service.py): `app/modules/stock_alerts/service.py`
- [Subscriptions](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/subscriptions/service.py): `app/modules/subscriptions/service.py`
- [Administration](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/modules/admin/service.py): `app/modules/admin/service.py`
- [Subscription scheduler](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/scheduler.py): `app/scheduler.py`

### Persistence

- [MongoDB connection](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/db/mongodb.py): `app/db/mongodb.py`
- [Repository base](https://github.com/dhanusrisenthikumar/furry-backend/blob/main/app/db/base_repository.py): `app/db/base_repository.py`

### Other components

- **Shopper**
- **Staff**

## Connections

- Shopper → API application: uses API
- Staff → API application: uses API
- API application → Authentication: routes to (evidence: `app/main.py`)
- API application → MCP tools: mounts tools (evidence: `app/main.py`)
- API application → MongoDB connection: initializes (evidence: `app/main.py`)
- API application → Product catalog: routes catalog (evidence: `app/main.py`)
- API application → Cart: routes cart (evidence: `app/main.py`)
- API application → Orders: routes orders (evidence: `app/main.py`)
- API application → Payments: routes payments (evidence: `app/main.py`)
- API application → Returns and refunds: routes returns (evidence: `app/main.py`)
- API application → Stock alerts: routes alerts (evidence: `app/main.py`)
- API application → Administration: routes admin (evidence: `app/main.py`)
- MCP tools → Orders: uses order logic (evidence: `app/mcp/server.py`)
- MCP tools → Cart: uses cart logic (evidence: `app/mcp/server.py`)
- MCP tools → Product catalog: queries catalog (evidence: `app/mcp/server.py`)
- Orders → Product catalog: checks stock (evidence: `app/modules/orders/service.py`)
- Orders → Pricing and shipping: calculates totals (evidence: `app/modules/orders/service.py`)
- Orders → Payments: coordinates payment (evidence: `app/modules/payments/service.py`)
- Orders → Loyalty and referrals: applies rewards (evidence: `app/modules/orders/service.py`)
- Orders → Notifications: notifies lifecycle (evidence: `app/modules/orders/service.py`)
- Orders → Email delivery: sends order mail (evidence: `app/modules/orders/service.py`)
- Orders → Stock alerts: flushes stock alerts (evidence: `app/modules/orders/service.py`)
- Payments → Orders: uses order service (evidence: `app/modules/payments/service.py`)
- Returns and refunds → Orders: checks eligibility (evidence: `app/modules/returns/service.py`)
- Returns and refunds → Pricing and shipping: prices refunds (evidence: `app/modules/returns/service.py`)
- Returns and refunds → Notifications: reports decisions (evidence: `app/modules/returns/service.py`)
- Returns and refunds → Email delivery: emails customer (evidence: `app/modules/returns/service.py`)
- Loyalty and referrals → Notifications: pushes rewards (evidence: `app/modules/loyalty/service.py`)
- Stock alerts → Product catalog: checks availability (evidence: `app/modules/stock_alerts/service.py`)
- Stock alerts → Customer accounts: looks up customer (evidence: `app/modules/stock_alerts/service.py`)
- Stock alerts → Notifications: announces restock (evidence: `app/modules/stock_alerts/service.py`)
- Stock alerts → Email delivery: emails restock (evidence: `app/modules/stock_alerts/service.py`)
- Subscription scheduler → MongoDB connection: connects database (evidence: `app/scheduler.py`)
- Subscription scheduler → Subscriptions: runs due work
- Recommendations → Product catalog: ranks products (evidence: `app/modules/recommendations/service.py`)
- Reviews and questions → Product catalog: checks products (evidence: `app/modules/reviews/service.py`)
- Reviews and questions → Orders: verifies purchases (evidence: `app/modules/reviews/service.py`)
- Customer accounts → MongoDB connection: persists accounts
- Repository base → MongoDB connection: accesses collections
- Administration → MongoDB connection: manages store data
