# mohithbs-stack/bentoiq architecture

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

- Interactive diagram: https://gitdiagram.com/mohithbs-stack/bentoiq
- Repository: https://github.com/mohithbs-stack/bentoiq

## Overview

BentoIQ is a prediction-market decision-intelligence web app. Its main user journey is browsing and searching markets, opening an executive-style report, and using community forecasts and AI analysis to inform decisions. Separate product areas cover market creation, wallet authentication, and the user ecosystem (portfolio, profiles, leaderboards, notifications, and insights). The graph includes documented capabilities even where their page-level wiring was not sampled; those uncertain connections are omitted.

Main entry points: [`bentoiq/src/app/markets/[id]/page.tsx`](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/%5Bid%5D/page.tsx) (Market report), [`bentoiq/src/contexts/auth-context.tsx`](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/contexts/auth-context.tsx) (Wallet authentication), [`bentoiq/src/lib/api-client.ts`](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/lib/api-client.ts) (HTTP client), [`bentoiq/src/app/markets/create/page.tsx`](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/create/page.tsx) (Market creation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Market experience"]
  node_home["Market feed<br/>[page.tsx]"]
  node_market_list["Market listing<br/>[page.tsx]"]
  node_search["Market search"]
  node_market_detail["Market report<br/>[page.tsx]"]
  node_create_market["Market creation<br/>[page.tsx]"]
end

subgraph group_intelligence["Decision intelligence"]
  node_report_components["Report sections"]
  node_prediction["Community forecasts"]
  node_decision_dna["Decision DNA<br/>[decision-dna.tsx]"]
  node_scenarios["Scenario analysis"]
  node_insights["AI insights<br/>[page.tsx]"]
end

subgraph group_identity["Identity and community"]
  node_auth["Wallet authentication<br/>[auth-context.tsx]"]
  node_auth_store[("Auth state<br/>[auth.store.ts]")]
  node_portfolio["Portfolio<br/>[page.tsx]"]
  node_profile["User profiles<br/>[page.tsx]"]
  node_leaderboard["Leaderboard<br/>[page.tsx]"]
  node_notifications["Notifications<br/>[page.tsx]"]
end

subgraph group_integration["Services and integrations"]
  node_ai_service["AI service<br/>[ai-service.ts]"]
  node_markets_service["Markets API<br/>[markets.service.ts]"]
  node_portfolio_service["Portfolio API"]
  node_api_client["HTTP client<br/>[api-client.ts]"]
end

node_user(("User"))
node_backend_api{{"Application API"}}
node_bento_sdk{{"Bento SDK"}}
node_wallet(("Web3 wallet"))

node_user -->|"browses"| node_home
node_user -->|"browses"| node_market_list
node_user -->|"searches"| node_search
node_user -->|"opens"| node_market_detail
node_user -->|"creates"| node_create_market
node_market_detail -->|"presents"| node_report_components
node_market_detail -->|"presents"| node_prediction
node_market_detail -->|"presents"| node_decision_dna
node_market_detail -->|"presents"| node_scenarios
node_user -->|"views"| node_insights
node_create_market -->|"requests suggestions"| node_ai_service
node_ai_service -.->|"requests insights"| node_backend_api
node_markets_service -->|"sends requests"| node_api_client
node_portfolio_service -->|"sends requests"| node_api_client
node_api_client -->|"calls"| node_backend_api
node_user -->|"connects wallet"| node_auth
node_auth -->|"requests signature"| node_wallet
node_auth -->|"creates SDK"| node_bento_sdk
node_auth -->|"updates state"| node_auth_store
node_user -->|"views"| node_portfolio
node_user -->|"views"| node_profile
node_user -->|"views"| node_leaderboard
node_user -->|"views"| node_notifications

click node_home "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/page.tsx"
click node_market_list "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/page.tsx"
click node_search "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/feed/floating-search.tsx"
click node_market_detail "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/%5Bid%5D/page.tsx"
click node_create_market "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/create/page.tsx"
click node_report_components "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/executive-brief.tsx"
click node_prediction "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/prediction-panel.tsx"
click node_decision_dna "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/decision-dna.tsx"
click node_scenarios "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/key-drivers-scenarios.tsx"
click node_insights "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/insights/page.tsx"
click node_ai_service "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/lib/ai-service.ts"
click node_markets_service "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/services/markets.service.ts"
click node_portfolio_service "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/services/portfolio.service.ts"
click node_api_client "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/lib/api-client.ts"
click node_auth "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/contexts/auth-context.tsx"
click node_auth_store "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/store/auth.store.ts"
click node_portfolio "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/portfolio/page.tsx"
click node_profile "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/profile/%5Busername%5D/page.tsx"
click node_leaderboard "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/leaderboard/page.tsx"
click node_notifications "https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/notifications/page.tsx"

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_home,node_market_list,node_search,node_market_detail,node_create_market,node_user toneBlue
class node_report_components,node_prediction,node_decision_dna,node_scenarios,node_insights toneAmber
class node_auth,node_auth_store,node_portfolio,node_profile,node_leaderboard,node_notifications,node_backend_api toneMint
class node_ai_service,node_markets_service,node_portfolio_service,node_api_client toneRose
class node_bento_sdk,node_wallet toneIndigo
```

## Components

### Market experience

- [Market feed](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/page.tsx): `bentoiq/src/app/page.tsx`
- [Market listing](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/page.tsx): `bentoiq/src/app/markets/page.tsx`
- [Market search](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/feed/floating-search.tsx): `bentoiq/src/components/feed/floating-search.tsx`
- [Market report](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/%5Bid%5D/page.tsx): `bentoiq/src/app/markets/[id]/page.tsx`
- [Market creation](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/markets/create/page.tsx): `bentoiq/src/app/markets/create/page.tsx`

### Decision intelligence

- [Report sections](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/executive-brief.tsx): `bentoiq/src/components/market-detail/executive-brief.tsx`
- [Community forecasts](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/prediction-panel.tsx): `bentoiq/src/components/market-detail/prediction-panel.tsx`
- [Decision DNA](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/decision-dna.tsx): `bentoiq/src/components/market-detail/decision-dna.tsx`
- [Scenario analysis](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/components/market-detail/key-drivers-scenarios.tsx): `bentoiq/src/components/market-detail/key-drivers-scenarios.tsx`
- [AI insights](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/insights/page.tsx): `bentoiq/src/app/insights/page.tsx`

### Identity and community

- [Wallet authentication](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/contexts/auth-context.tsx): `bentoiq/src/contexts/auth-context.tsx`
- [Auth state](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/store/auth.store.ts): `bentoiq/src/store/auth.store.ts`
- [Portfolio](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/portfolio/page.tsx): `bentoiq/src/app/portfolio/page.tsx`
- [User profiles](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/profile/%5Busername%5D/page.tsx): `bentoiq/src/app/profile/[username]/page.tsx`
- [Leaderboard](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/leaderboard/page.tsx): `bentoiq/src/app/leaderboard/page.tsx`
- [Notifications](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/app/notifications/page.tsx): `bentoiq/src/app/notifications/page.tsx`

### Services and integrations

- [AI service](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/lib/ai-service.ts): `bentoiq/src/lib/ai-service.ts`
- [Markets API](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/services/markets.service.ts): `bentoiq/src/services/markets.service.ts`
- [Portfolio API](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/services/portfolio.service.ts): `bentoiq/src/services/portfolio.service.ts`
- [HTTP client](https://github.com/mohithbs-stack/bentoiq/blob/main/bentoiq/src/lib/api-client.ts): `bentoiq/src/lib/api-client.ts`

### Other components

- **User**
- **Application API**
- **Bento SDK**
- **Web3 wallet**

## Connections

- User → Market feed: browses
- User → Market listing: browses
- User → Market search: searches
- User → Market report: opens
- User → Market creation: creates
- Market report → Report sections: presents
- Market report → Community forecasts: presents
- Market report → Decision DNA: presents
- Market report → Scenario analysis: presents
- User → AI insights: views
- Market creation → AI service: requests suggestions
- AI service → Application API: requests insights
- Markets API → HTTP client: sends requests
- Portfolio API → HTTP client: sends requests
- HTTP client → Application API: calls
- User → Wallet authentication: connects wallet
- Wallet authentication → Web3 wallet: requests signature
- Wallet authentication → Bento SDK: creates SDK
- Wallet authentication → Auth state: updates state
- User → Portfolio: views
- User → User profiles: views
- User → Leaderboard: views
- User → Notifications: views
