# pantr2318/business-compass architecture

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

- Interactive diagram: https://gitdiagram.com/pantr2318/business-compass
- Repository: https://github.com/pantr2318/business-compass

## Overview

Business Compass (also branded NXvanta in the backend) is a business-intelligence and startup-news platform. The principal reader workflow is to enter the site, discover news or company and market information, and view detailed content; the newsroom also ingests feed stories, uses AI to rewrite them, and queues them for review or publication. Editors manage content through admin tools, while a separate FastAPI backend exposes authentication, article, category, and media endpoints. README capabilities exceed what the sampled source confirms, so unsampled feature wiring is shown only where the tree supports a meaningful subsystem.

Main entry points: [`src/router.tsx`](https://github.com/pantr2318/business-compass/blob/main/src/router.tsx) (Web Router), [`src/lib/news-ingest.server.ts`](https://github.com/pantr2318/business-compass/blob/main/src/lib/news-ingest.server.ts) (Feed Ingestion), [`backend/app/main.py`](https://github.com/pantr2318/business-compass/blob/main/backend/app/main.py) (FastAPI App), [`src/routes/index.tsx`](https://github.com/pantr2318/business-compass/blob/main/src/routes/index.tsx) (Home Discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Reader Discovery"]
  node_web_router["Web Router<br/>[router.tsx]"]
  node_home["Home Discovery<br/>[index.tsx]"]
  node_public_content["Public Content Data"]
  node_profiles["Profiles &amp; Intelligence"]
  node_data_api["Public Data API"]
end

subgraph group_newsroom["Newsroom"]
  node_news_routes["News Pages<br/>[news.index.tsx]"]
  node_article_page["Article Detail<br/>[news.$slug.tsx]"]
  node_news_ingest["Feed Ingestion"]
end

subgraph group_operations["Platform Operations"]
  node_supabase_admin["Supabase Admin Client<br/>[client.server.ts]"]
  node_article_store[("Article Store")]
  node_admin_pages["Admin Console<br/>[admin.index.tsx]"]
  node_resource_manager["Resource Manager"]
  node_admin_functions["Admin Functions<br/>[admin.functions.ts]"]
end

subgraph group_backend["FastAPI Backend"]
  node_api_app["FastAPI App<br/>[main.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_auth_service["Auth Service<br/>[auth_service.py]"]
  node_content_api["Content &amp; Media APIs"]
  node_backend_db[("PostgreSQL Session<br/>[database.py]")]
end

node_reader(("Reader"))
node_ai_gateway["Lovable AI"]
node_rss_sources["News Feeds"]
node_editor(("Editor"))

node_reader -->|"opens"| node_web_router
node_web_router -->|"routes to"| node_home
node_home -->|"loads discovery data"| node_public_content
node_reader -->|"opens news"| node_news_routes
node_web_router -->|"routes to"| node_news_routes
node_web_router -->|"routes to"| node_article_page
node_reader -->|"browses profiles"| node_profiles
node_reader -->|"requests datasets"| node_data_api
node_news_ingest -->|"fetches headlines"| node_rss_sources
node_news_ingest -->|"rewrites stories"| node_ai_gateway
node_news_ingest -->|"stores reviewed stories"| node_supabase_admin
node_supabase_admin -->|"writes articles"| node_article_store
node_editor -->|"manages content"| node_admin_pages
node_admin_pages -->|"uses"| node_resource_manager
node_resource_manager -->|"lists and mutates"| node_admin_functions
node_api_app -->|"mounts router"| node_auth_api
node_api_app -->|"mounts routers"| node_content_api
node_auth_api -->|"registers users"| node_auth_service
node_auth_service -->|"persists account"| node_backend_db

click node_web_router "https://github.com/pantr2318/business-compass/blob/main/src/router.tsx"
click node_home "https://github.com/pantr2318/business-compass/blob/main/src/routes/index.tsx"
click node_public_content "https://github.com/pantr2318/business-compass/blob/main/src/lib/public.functions.ts"
click node_profiles "https://github.com/pantr2318/business-compass/tree/main/src/routes"
click node_data_api "https://github.com/pantr2318/business-compass/tree/main/src/routes/api/public/v1"
click node_news_routes "https://github.com/pantr2318/business-compass/blob/main/src/routes/news.index.tsx"
click node_article_page "https://github.com/pantr2318/business-compass/blob/main/src/routes/news.%24slug.tsx"
click node_news_ingest "https://github.com/pantr2318/business-compass/blob/main/src/lib/news-ingest.server.ts"
click node_supabase_admin "https://github.com/pantr2318/business-compass/blob/main/src/integrations/supabase/client.server.ts"
click node_admin_pages "https://github.com/pantr2318/business-compass/blob/main/src/routes/admin.index.tsx"
click node_resource_manager "https://github.com/pantr2318/business-compass/blob/main/src/components/admin/resource-manager.tsx"
click node_admin_functions "https://github.com/pantr2318/business-compass/blob/main/src/lib/admin.functions.ts"
click node_api_app "https://github.com/pantr2318/business-compass/blob/main/backend/app/main.py"
click node_auth_api "https://github.com/pantr2318/business-compass/blob/main/backend/app/api/auth.py"
click node_auth_service "https://github.com/pantr2318/business-compass/blob/main/backend/app/services/auth_service.py"
click node_content_api "https://github.com/pantr2318/business-compass/tree/main/backend/app/api"
click node_backend_db "https://github.com/pantr2318/business-compass/blob/main/backend/app/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_web_router,node_home,node_public_content,node_profiles,node_data_api toneBlue
class node_news_routes,node_article_page,node_news_ingest toneAmber
class node_supabase_admin,node_article_store,node_admin_pages,node_resource_manager,node_admin_functions toneMint
class node_api_app,node_auth_api,node_auth_service,node_content_api,node_backend_db toneRose
class node_reader,node_ai_gateway,node_rss_sources,node_editor toneIndigo
```

## Components

### Reader Discovery

- [Web Router](https://github.com/pantr2318/business-compass/blob/main/src/router.tsx): `src/router.tsx`
- [Home Discovery](https://github.com/pantr2318/business-compass/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Public Content Data](https://github.com/pantr2318/business-compass/blob/main/src/lib/public.functions.ts): `src/lib/public.functions.ts`
- [Profiles & Intelligence](https://github.com/pantr2318/business-compass/tree/main/src/routes): `src/routes`
- [Public Data API](https://github.com/pantr2318/business-compass/tree/main/src/routes/api/public/v1): `src/routes/api/public/v1`

### Newsroom

- [News Pages](https://github.com/pantr2318/business-compass/blob/main/src/routes/news.index.tsx): `src/routes/news.index.tsx`
- [Article Detail](https://github.com/pantr2318/business-compass/blob/main/src/routes/news.%24slug.tsx): `src/routes/news.$slug.tsx`
- [Feed Ingestion](https://github.com/pantr2318/business-compass/blob/main/src/lib/news-ingest.server.ts): `src/lib/news-ingest.server.ts`

### Platform Operations

- [Supabase Admin Client](https://github.com/pantr2318/business-compass/blob/main/src/integrations/supabase/client.server.ts): `src/integrations/supabase/client.server.ts`
- **Article Store**
- [Admin Console](https://github.com/pantr2318/business-compass/blob/main/src/routes/admin.index.tsx): `src/routes/admin.index.tsx`
- [Resource Manager](https://github.com/pantr2318/business-compass/blob/main/src/components/admin/resource-manager.tsx): `src/components/admin/resource-manager.tsx`
- [Admin Functions](https://github.com/pantr2318/business-compass/blob/main/src/lib/admin.functions.ts): `src/lib/admin.functions.ts`

### FastAPI Backend

- [FastAPI App](https://github.com/pantr2318/business-compass/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication API](https://github.com/pantr2318/business-compass/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Auth Service](https://github.com/pantr2318/business-compass/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Content & Media APIs](https://github.com/pantr2318/business-compass/tree/main/backend/app/api): `backend/app/api`
- [PostgreSQL Session](https://github.com/pantr2318/business-compass/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Reader**
- **Lovable AI**
- **News Feeds**
- **Editor**

## Connections

- Reader → Web Router: opens
- Web Router → Home Discovery: routes to
- Home Discovery → Public Content Data: loads discovery data
- Reader → News Pages: opens news
- Web Router → News Pages: routes to
- Web Router → Article Detail: routes to
- Reader → Profiles & Intelligence: browses profiles
- Reader → Public Data API: requests datasets
- Feed Ingestion → News Feeds: fetches headlines
- Feed Ingestion → Lovable AI: rewrites stories
- Feed Ingestion → Supabase Admin Client: stores reviewed stories
- Supabase Admin Client → Article Store: writes articles
- Editor → Admin Console: manages content
- Admin Console → Resource Manager: uses
- Resource Manager → Admin Functions: lists and mutates
- FastAPI App → Authentication API: mounts router
- FastAPI App → Content & Media APIs: mounts routers
- Authentication API → Auth Service: registers users
- Auth Service → PostgreSQL Session: persists account
