# shreya0119/fantamcode-2026-jass architecture

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

- Interactive diagram: https://gitdiagram.com/shreya0119/fantamcode-2026-jass
- Repository: https://github.com/shreya0119/fantamcode-2026-jass

## Overview

#### Purpose and Entry Points
ARIA is a deal-hunting application: a Python backend interprets shopping intent, retrieves and evaluates offers, then exposes signals for a Next.js frontend. Backend execution begins in `aria-backend/main.py`; the UI enters through `aria-frontend/src/app/page.tsx` and the hunt workflow at `aria-frontend/src/app/hunt/page.tsx`.

#### Frontend Application Shell
The frontend is a Next.js/TypeScript application with global layout, styling, and theme integration. `aria-frontend/src/app/layout.tsx` establishes the application shell; `aria-frontend/src/app/globals.css` defines shared presentation; `aria-frontend/src/components/ThemeProvider.tsx` manages theme context. `aria-frontend/src/components/Navbar.tsx` provides shared navigation.

#### Hunt Interaction and Results Presentation
The hunt page is the primary user-facing query surface and likely orchestrates request submission and deal display. `aria-frontend/src/app/hunt/page.tsx` is supported by reusable result-focused components: `aria-frontend/src/components/DealCard.tsx`, `aria-frontend/src/components/PriceChart.tsx`, and `aria-frontend/src/components/ActivityFeed.tsx`. Store and category context are represented by `aria-frontend/src/components/StoreTicker.tsx` and `aria-frontend/src/components/CategoryIcons.tsx`.

#### Intent-to-Query Pipeline
The backend converts a natural-language shopping request into retrieval-ready criteria. `aria-backend/intent_parser.py` extracts or structures user intent, while `aria-backend/query_builder.py` turns that structure into source queries. Shared domain records likely live in `aria-backend/models.py`; runtime settings and credentials boundaries are centralized in `aria-backend/config.py`.

#### Offer Acquisition Boundary
External deal/product acquisition is isolated behind retrieval and scraping modules. `aria-backend/retriever.py` coordinates finding candidate offers, and `aria-backend/scraper.py` handles source-specific web extraction. This boundary is where external retailer/search services, network reliability, normalization, and source variability should remain contained.

#### Evaluation, Historical Context, and Signals
Candidate offers are enriched and ranked before presentation. `aria-backend/price_history.py` supplies prior-price context; `aria-backend/incentives.py` accounts for promotions or incentive value; and `aria-backend/scorer.py` computes comparative quality. `aria-backend/signal_engine.py` consolidates these inputs into actionable deal signals for the API/UI layer.

#### Runtime and Integration Shape
The system has two independently runnable runtimes: Python backend dependencies are declared in `aria-backend/requirements.txt`, and the frontend’s Node/Next.js dependencies and scripts are in `aria-frontend/package.json`. The principal cross-runtime contract should be an HTTP/API boundary initiated by the hunt UI and served from `aria-backend/main.py`; no explicit API client, persistence layer, or deployed infrastructure is visible in the provided tree.

Main entry points: [`aria-frontend/src/app/hunt/page.tsx`](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/app/hunt/page.tsx) (Hunt workflow), [`aria-backend/retriever.py`](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/retriever.py) (Offer retriever), [`aria-backend/main.py`](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/main.py) (Backend API), [`aria-backend/intent_parser.py`](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/intent_parser.py) (Intent parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Next.js Frontend"]
  node_home["Home page<br/>Next.js route<br/>[page.tsx]"]
  node_app_shell["App shell<br/>layout<br/>[layout.tsx]"]
  node_theme["Theme provider<br/>React context<br/>[ThemeProvider.tsx]"]
  node_navbar["Navigation<br/>shared component<br/>[Navbar.tsx]"]
  node_hunt_ui["Hunt workflow<br/>Next.js route<br/>[page.tsx]"]
  node_deal_views["Deal results<br/>UI components<br/>[DealCard.tsx]"]
  node_market_context["Store &amp; category context<br/>UI components<br/>[StoreTicker.tsx]"]
end

subgraph group_backend["Python Backend"]
  node_backend_api{{"Backend API<br/>Python entry point<br/>[main.py]"}}
  node_intent_parser["Intent parser<br/>intent processing<br/>[intent_parser.py]"]
  node_query_builder["Query builder<br/>retrieval planning<br/>[query_builder.py]"]
  node_retriever["Offer retriever<br/>acquisition coordinator<br/>[retriever.py]"]
  node_scraper["Source scraper<br/>web extraction<br/>[scraper.py]"]
  node_price_history["Price history<br/>historical evaluation<br/>[price_history.py]"]
  node_incentives["Incentives<br/>promotion evaluation<br/>[incentives.py]"]
  node_scorer["Offer scorer<br/>ranking<br/>[scorer.py]"]
  node_signal_engine["Signal engine<br/>deal signal synthesis<br/>[signal_engine.py]"]
  node_domain_models["Domain models<br/>shared records<br/>[models.py]"]
end

subgraph group_external["Offer Sources"]
  node_retailer_sources(("Retailer &amp; search sources<br/>external services"))
end

node_app_shell -->|"provides theme"| node_theme
node_app_shell -->|"includes"| node_navbar
node_home -->|"navigates to"| node_hunt_ui
node_hunt_ui -->|"renders"| node_deal_views
node_hunt_ui -->|"shows context"| node_market_context
node_hunt_ui -->|"hunt request / signals"| node_backend_api
node_backend_api -->|"interprets intent"| node_intent_parser
node_intent_parser -->|"structured criteria"| node_query_builder
node_query_builder -->|"source queries"| node_retriever
node_retriever -->|"candidate acquisition"| node_scraper
node_scraper -->|"extracts offers"| node_retailer_sources
node_retriever -->|"candidate offers"| node_price_history
node_retriever -->|"candidate offers"| node_incentives
node_price_history -->|"prior-price context"| node_scorer
node_incentives -->|"promotion value"| node_scorer
node_scorer -->|"ranked offers"| node_signal_engine
node_signal_engine -->|"deal signals"| node_backend_api
node_domain_models -.->|"shared records"| node_intent_parser
node_domain_models -.->|"shared records"| node_signal_engine

click node_home "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/app/page.tsx"
click node_app_shell "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/app/layout.tsx"
click node_theme "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/ThemeProvider.tsx"
click node_navbar "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/Navbar.tsx"
click node_hunt_ui "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/app/hunt/page.tsx"
click node_deal_views "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/DealCard.tsx"
click node_market_context "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/StoreTicker.tsx"
click node_backend_api "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/main.py"
click node_intent_parser "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/intent_parser.py"
click node_query_builder "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/query_builder.py"
click node_retriever "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/retriever.py"
click node_scraper "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/scraper.py"
click node_price_history "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/price_history.py"
click node_incentives "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/incentives.py"
click node_scorer "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/scorer.py"
click node_signal_engine "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/signal_engine.py"
click node_domain_models "https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/models.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_home,node_app_shell,node_theme,node_navbar,node_hunt_ui,node_deal_views,node_market_context toneBlue
class node_backend_api,node_intent_parser,node_query_builder,node_retriever,node_scraper,node_price_history,node_incentives,node_scorer,node_signal_engine,node_domain_models toneAmber
class node_retailer_sources toneMint
```

## Components

### Next.js Frontend

- [Home page](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/app/page.tsx): Next.js route · `aria-frontend/src/app/page.tsx`
- [App shell](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/app/layout.tsx): layout · `aria-frontend/src/app/layout.tsx`
- [Theme provider](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/ThemeProvider.tsx): React context · `aria-frontend/src/components/ThemeProvider.tsx`
- [Navigation](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/Navbar.tsx): shared component · `aria-frontend/src/components/Navbar.tsx`
- [Hunt workflow](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/app/hunt/page.tsx): Next.js route · Submits shopping intent and presents deal signals. · `aria-frontend/src/app/hunt/page.tsx`
- [Deal results](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/DealCard.tsx): UI components · Cards, price charts, and activity feed render hunt output. · `aria-frontend/src/components/DealCard.tsx`
- [Store & category context](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-frontend/src/components/StoreTicker.tsx): UI components · `aria-frontend/src/components/StoreTicker.tsx`

### Python Backend

- [Backend API](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/main.py): Python entry point · Serves the cross-runtime hunt contract. · `aria-backend/main.py`
- [Intent parser](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/intent_parser.py): intent processing · `aria-backend/intent_parser.py`
- [Query builder](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/query_builder.py): retrieval planning · `aria-backend/query_builder.py`
- [Offer retriever](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/retriever.py): acquisition coordinator · `aria-backend/retriever.py`
- [Source scraper](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/scraper.py): web extraction · Contains source-specific extraction and normalization. · `aria-backend/scraper.py`
- [Price history](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/price_history.py): historical evaluation · `aria-backend/price_history.py`
- [Incentives](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/incentives.py): promotion evaluation · `aria-backend/incentives.py`
- [Offer scorer](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/scorer.py): ranking · `aria-backend/scorer.py`
- [Signal engine](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/signal_engine.py): deal signal synthesis · `aria-backend/signal_engine.py`
- [Domain models](https://github.com/shreya0119/fantamcode-2026-jass/blob/main/aria-backend/models.py): shared records · `aria-backend/models.py`

### Offer Sources

- **Retailer & search sources**: external services

## Connections

- App shell → Theme provider: provides theme
- App shell → Navigation: includes
- Home page → Hunt workflow: navigates to
- Hunt workflow → Deal results: renders
- Hunt workflow → Store & category context: shows context
- Hunt workflow → Backend API: hunt request / signals · HTTP/API boundary.
- Backend API → Intent parser: interprets intent
- Intent parser → Query builder: structured criteria
- Query builder → Offer retriever: source queries
- Offer retriever → Source scraper: candidate acquisition
- Source scraper → Retailer & search sources: extracts offers
- Offer retriever → Price history: candidate offers
- Offer retriever → Incentives: candidate offers
- Price history → Offer scorer: prior-price context
- Incentives → Offer scorer: promotion value
- Offer scorer → Signal engine: ranked offers
- Signal engine → Backend API: deal signals
- Domain models → Intent parser: shared records
- Domain models → Signal engine: shared records
