# h-sihan/bizreview architecture

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

- Interactive diagram: https://gitdiagram.com/h-sihan/bizreview
- Repository: https://github.com/h-sihan/bizreview

## Overview

bizReview is a business discovery and review application: users browse and page through businesses, open a business detail page, and can submit/read reviews in the review-enabled frontend. The repository contains a Flask/MongoDB backend and two similar Angular frontends; the bizReview frontend adds review-related API methods. The source index and excerpts support the main routing, service calls, and backend storage areas, but several component and backend details are unsampled, so their internal links are omitted.

Main entry points: [`bizFE/src/app/app.routes.ts`](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/app.routes.ts) (App routes), [`bizBE/blueprints/auth/auth.py`](https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/auth/auth.py) (Authentication routes), [`bizBE/blueprints/businesses/businesses.py`](https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/businesses/businesses.py) (Business routes), [`bizBE/blueprints/reviews/reviews.py`](https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/reviews/reviews.py) (Review routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular frontends"]
  node_app_routes["App routes<br/>[app.routes.ts]"]
  node_biz_list["Business listing<br/>[businesses.ts]"]
  node_biz_detail["Business detail<br/>[business.ts]"]
  node_login["Login view<br/>[login.ts]"]
  node_navigation["Navigation<br/>[navigation.ts]"]
  node_auth_service["Auth service<br/>[auth-service.ts]"]
  node_web_service["Business API client<br/>[web-service.ts]"]
  node_review_frontend["Review-enabled UI<br/>[business.ts]"]
  node_review_api_client["Review API client<br/>[web-services.ts]"]
  node_review_data[("Local business data<br/>[business-data.ts]")]
end

subgraph group_backend["Flask API"]
  node_api_app["API application<br/>[app.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_business_routes["Business routes<br/>[businesses.py]"]
  node_review_routes["Review routes<br/>[reviews.py]"]
  node_auth_guard["Auth decorators<br/>[decorators.py]"]
end

subgraph group_storage["Data access"]
  node_mongo[("MongoDB connection<br/>[globals.py]")]
  node_review_store[("Business review records<br/>[reviews.py]")]
end

subgraph group_integration["External services"]
  node_review_api(("Review API"))
  node_business_api(("Business API"))
  node_auth_api(("Auth API"))
end

node_user(("Visitor"))

node_user -->|"navigates"| node_app_routes
node_app_routes -->|"routes to"| node_biz_list
node_app_routes -->|"routes to"| node_biz_detail
node_app_routes -->|"routes to"| node_login
node_biz_list -->|"requests pages"| node_web_service
node_biz_detail -->|"requests details"| node_web_service
node_login -->|"submits credentials"| node_auth_service
node_navigation -->|"checks session"| node_auth_service
node_web_service -->|"HTTP requests"| node_business_api
node_auth_service -->|"HTTP requests"| node_auth_api
node_user -.->|"opens business"| node_review_frontend
node_review_frontend -->|"requests reviews"| node_review_api_client
node_review_api_client -->|"HTTP requests"| node_review_api
node_api_app -->|"registers blueprint"| node_auth_routes
node_api_app -->|"registers blueprint"| node_business_routes
node_api_app -->|"registers blueprint"| node_review_routes
node_auth_routes -->|"uses guards"| node_auth_guard
node_auth_routes -->|"uses database config"| node_mongo
node_business_routes -->|"uses guards"| node_auth_guard
node_business_routes -->|"uses database config"| node_mongo
node_review_routes -->|"uses database config"| node_mongo
node_review_routes -->|"reads and writes"| node_review_store
node_review_api -.->|"calls endpoints"| node_review_routes
node_business_api -.->|"calls endpoints"| node_business_routes
node_auth_api -.->|"calls endpoints"| node_auth_routes

click node_app_routes "https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/app.routes.ts"
click node_biz_list "https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/businesses/businesses.ts"
click node_biz_detail "https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/businesses/business/business.ts"
click node_login "https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/login/login.ts"
click node_navigation "https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/navigation/navigation.ts"
click node_auth_service "https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/services/auth-service.ts"
click node_web_service "https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/services/web-service.ts"
click node_review_frontend "https://github.com/h-sihan/bizreview/blob/main/bizReview/bizFE/src/app/businesses/business/business.ts"
click node_review_api_client "https://github.com/h-sihan/bizreview/blob/main/bizReview/bizFE/src/app/services/web-services.ts"
click node_review_data "https://github.com/h-sihan/bizreview/blob/main/bizReview/bizFE/src/app/services/business-data.ts"
click node_api_app "https://github.com/h-sihan/bizreview/blob/main/bizBE/app.py"
click node_auth_routes "https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/auth/auth.py"
click node_business_routes "https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/businesses/businesses.py"
click node_review_routes "https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/reviews/reviews.py"
click node_auth_guard "https://github.com/h-sihan/bizreview/blob/main/bizBE/decorators.py"
click node_mongo "https://github.com/h-sihan/bizreview/blob/main/bizBE/globals.py"
click node_review_store "https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/reviews/reviews.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_routes,node_biz_list,node_biz_detail,node_login,node_navigation,node_auth_service,node_web_service,node_review_frontend,node_review_api_client,node_review_data toneBlue
class node_api_app,node_auth_routes,node_business_routes,node_review_routes,node_auth_guard toneAmber
class node_mongo,node_review_store toneMint
class node_review_api,node_business_api,node_auth_api toneRose
class node_user toneIndigo
```

## Components

### Angular frontends

- [App routes](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/app.routes.ts): `bizFE/src/app/app.routes.ts`
- [Business listing](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/businesses/businesses.ts): `bizFE/src/app/businesses/businesses.ts`
- [Business detail](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/businesses/business/business.ts): `bizFE/src/app/businesses/business/business.ts`
- [Login view](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/login/login.ts): `bizFE/src/app/login/login.ts`
- [Navigation](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/navigation/navigation.ts): `bizFE/src/app/navigation/navigation.ts`
- [Auth service](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/services/auth-service.ts): `bizFE/src/app/services/auth-service.ts`
- [Business API client](https://github.com/h-sihan/bizreview/blob/main/bizFE/src/app/services/web-service.ts): `bizFE/src/app/services/web-service.ts`
- [Review-enabled UI](https://github.com/h-sihan/bizreview/blob/main/bizReview/bizFE/src/app/businesses/business/business.ts): `bizReview/bizFE/src/app/businesses/business/business.ts`
- [Review API client](https://github.com/h-sihan/bizreview/blob/main/bizReview/bizFE/src/app/services/web-services.ts): `bizReview/bizFE/src/app/services/web-services.ts`
- [Local business data](https://github.com/h-sihan/bizreview/blob/main/bizReview/bizFE/src/app/services/business-data.ts): `bizReview/bizFE/src/app/services/business-data.ts`

### Flask API

- [API application](https://github.com/h-sihan/bizreview/blob/main/bizBE/app.py): `bizBE/app.py`
- [Authentication routes](https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/auth/auth.py): `bizBE/blueprints/auth/auth.py`
- [Business routes](https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/businesses/businesses.py): `bizBE/blueprints/businesses/businesses.py`
- [Review routes](https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/reviews/reviews.py): `bizBE/blueprints/reviews/reviews.py`
- [Auth decorators](https://github.com/h-sihan/bizreview/blob/main/bizBE/decorators.py): `bizBE/decorators.py`

### Data access

- [MongoDB connection](https://github.com/h-sihan/bizreview/blob/main/bizBE/globals.py): `bizBE/globals.py`
- [Business review records](https://github.com/h-sihan/bizreview/blob/main/bizBE/blueprints/reviews/reviews.py): `bizBE/blueprints/reviews/reviews.py`

### External services

- **Review API**
- **Business API**
- **Auth API**

### Other components

- **Visitor**

## Connections

- Visitor → App routes: navigates (evidence: `bizFE/src/app/app.routes.ts`)
- App routes → Business listing: routes to (evidence: `bizFE/src/app/app.routes.ts`)
- App routes → Business detail: routes to (evidence: `bizFE/src/app/app.routes.ts`)
- App routes → Login view: routes to (evidence: `bizFE/src/app/app.routes.ts`)
- Business listing → Business API client: requests pages (evidence: `bizFE/src/app/businesses/businesses.ts`)
- Business detail → Business API client: requests details (evidence: `bizFE/src/app/businesses/business/business.ts`)
- Login view → Auth service: submits credentials (evidence: `bizFE/src/app/login/login.ts`)
- Navigation → Auth service: checks session (evidence: `bizFE/src/app/navigation/navigation.ts`)
- Business API client → Business API: HTTP requests (evidence: `bizFE/src/app/services/web-service.ts`)
- Auth service → Auth API: HTTP requests (evidence: `bizFE/src/app/services/auth-service.ts`)
- Visitor → Review-enabled UI: opens business
- Review-enabled UI → Review API client: requests reviews (evidence: `bizReview/bizFE/src/app/businesses/business/business.ts`)
- Review API client → Review API: HTTP requests (evidence: `bizReview/bizFE/src/app/services/web-services.ts`)
- API application → Authentication routes: registers blueprint (evidence: `bizBE/app.py`)
- API application → Business routes: registers blueprint (evidence: `bizBE/app.py`)
- API application → Review routes: registers blueprint (evidence: `bizBE/app.py`)
- Authentication routes → Auth decorators: uses guards (evidence: `bizBE/blueprints/auth/auth.py`)
- Authentication routes → MongoDB connection: uses database config (evidence: `bizBE/blueprints/auth/auth.py`)
- Business routes → Auth decorators: uses guards (evidence: `bizBE/blueprints/businesses/businesses.py`)
- Business routes → MongoDB connection: uses database config (evidence: `bizBE/blueprints/businesses/businesses.py`)
- Review routes → MongoDB connection: uses database config (evidence: `bizBE/blueprints/reviews/reviews.py`)
- Review routes → Business review records: reads and writes (evidence: `bizBE/blueprints/reviews/reviews.py`)
- Review API → Review routes: calls endpoints
- Business API → Business routes: calls endpoints
- Auth API → Authentication routes: calls endpoints
