# baitc-hacks/hack-dddbf484-netrix architecture

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

- Interactive diagram: https://gitdiagram.com/baitc-hacks/hack-dddbf484-netrix
- Repository: https://github.com/baitc-hacks/hack-dddbf484-netrix

## Overview

HackAlem is a demonstration service for finding event contractors by city, category, date, format, and budget. The main workflow is: a user submits search criteria in the React UI, the UI calls the FastAPI match endpoint, and the backend returns up to three recommendations with exclusion counts and reasons for the interface to display. The repository also includes catalog preparation and a development-only preview using fixed mock scenarios. Relationships are limited to those shown in excerpts or documented in the README; unsampled matching internals are kept together.

Main entry points: [`frontend/src/pages/SearchPage.tsx`](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/pages/SearchPage.tsx) (Search page), [`frontend/src/hooks/useVendorSearch.ts`](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/hooks/useVendorSearch.ts) (Search state), [`frontend/src/services/vendorService.ts`](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/vendorService.ts) (Service selector), [`frontend/src/services/apiVendorService.ts`](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/apiVendorService.ts) (HTTP adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Search interface"]
  node_app_entry["App entry<br/>[main.tsx]"]
  node_search_page["Search page<br/>[SearchPage.tsx]"]
  node_search_form["Search form<br/>[SearchForm.tsx]"]
  node_results_view["Results view<br/>[SearchResults.tsx]"]
  node_vendor_card["Vendor card<br/>[VendorCard.tsx]"]
  node_page_layout["Page layout<br/>[PageLayout.tsx]"]
  node_preview_page["Preview page<br/>[PreviewPage.tsx]"]
end

subgraph group_frontend_services["Frontend services"]
  node_search_hook["Search state<br/>[useVendorSearch.ts]"]
  node_service_entry["Service selector<br/>[vendorService.ts]"]
  node_api_adapter["HTTP adapter"]
  node_mock_adapter["Mock adapter"]
  node_ui_contract["Search contract<br/>[contracts.ts]"]
  node_ui_profiles["UI profile data<br/>[profiles.json]"]
end

subgraph group_backend["Matching API"]
  node_api["FastAPI routes<br/>[app.py]"]
  node_matcher["Validation and matching<br/>[matching.py]"]
end

subgraph group_catalog["Profile catalog"]
  node_profile_prep["Profile preparation"]
  node_source_data["Anonymized dataset"]
  node_profiles["Backend catalog<br/>[profiles.json]"]
end

node_user(("Event organizer"))

node_user -->|"opens search"| node_search_page
node_app_entry -->|"renders"| node_search_page
node_app_entry -.->|"loads preview"| node_preview_page
node_search_page -->|"renders"| node_page_layout
node_search_page -->|"renders"| node_search_form
node_search_page -->|"renders"| node_results_view
node_search_page -->|"uses state"| node_search_hook
node_search_form -->|"submits request"| node_search_hook
node_search_hook -->|"requests options and matches"| node_service_entry
node_service_entry -->|"selects live adapter"| node_api_adapter
node_api_adapter -->|"posts match request"| node_api
node_api -->|"dispatches matching"| node_matcher
node_matcher -->|"uses catalog"| node_profiles
node_api_adapter -->|"reads profile details"| node_ui_profiles
node_search_hook -->|"returns response"| node_results_view
node_results_view -->|"renders cards"| node_vendor_card
node_preview_page -->|"creates preview service"| node_service_entry
node_service_entry -->|"creates mock adapter"| node_mock_adapter
node_profile_prep -->|"prepares from"| node_source_data
node_profile_prep -->|"prepares catalog"| node_profiles

click node_app_entry "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/main.tsx"
click node_search_page "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/pages/SearchPage.tsx"
click node_search_form "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/SearchForm.tsx"
click node_results_view "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/SearchResults.tsx"
click node_vendor_card "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/VendorCard.tsx"
click node_page_layout "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/PageLayout.tsx"
click node_preview_page "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/pages/PreviewPage.tsx"
click node_search_hook "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/hooks/useVendorSearch.ts"
click node_service_entry "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/vendorService.ts"
click node_api_adapter "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/apiVendorService.ts"
click node_mock_adapter "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/mockVendorService.ts"
click node_ui_contract "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/contracts.ts"
click node_ui_profiles "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/mocks/profiles.json"
click node_api "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/app.py"
click node_matcher "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/matching.py"
click node_profile_prep "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/prepare_profiles.py"
click node_source_data "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/data/hackathon_dataset_anonymized.csv"
click node_profiles "https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/profiles.json"

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_entry,node_search_page,node_search_form,node_results_view,node_vendor_card,node_page_layout,node_preview_page toneBlue
class node_search_hook,node_service_entry,node_api_adapter,node_mock_adapter,node_ui_contract,node_ui_profiles toneAmber
class node_api,node_matcher toneMint
class node_profile_prep,node_source_data,node_profiles toneRose
class node_user toneIndigo
```

## Components

### Search interface

- [App entry](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Search page](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/pages/SearchPage.tsx): `frontend/src/pages/SearchPage.tsx`
- [Search form](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/SearchForm.tsx): `frontend/src/components/SearchForm.tsx`
- [Results view](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/SearchResults.tsx): `frontend/src/components/SearchResults.tsx`
- [Vendor card](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/VendorCard.tsx): `frontend/src/components/VendorCard.tsx`
- [Page layout](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/components/PageLayout.tsx): `frontend/src/components/PageLayout.tsx`
- [Preview page](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/pages/PreviewPage.tsx): `frontend/src/pages/PreviewPage.tsx`

### Frontend services

- [Search state](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/hooks/useVendorSearch.ts): `frontend/src/hooks/useVendorSearch.ts`
- [Service selector](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/vendorService.ts): `frontend/src/services/vendorService.ts`
- [HTTP adapter](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/apiVendorService.ts): `frontend/src/services/apiVendorService.ts`
- [Mock adapter](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/mockVendorService.ts): `frontend/src/services/mockVendorService.ts`
- [Search contract](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/services/contracts.ts): `frontend/src/services/contracts.ts`
- [UI profile data](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/frontend/src/mocks/profiles.json): `frontend/src/mocks/profiles.json`

### Matching API

- [FastAPI routes](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/app.py): `app.py`
- [Validation and matching](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/matching.py): `matching.py`

### Profile catalog

- [Profile preparation](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/prepare_profiles.py): `prepare_profiles.py`
- [Anonymized dataset](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/data/hackathon_dataset_anonymized.csv): `data/hackathon_dataset_anonymized.csv`
- [Backend catalog](https://github.com/baitc-hacks/hack-dddbf484-netrix/blob/main/profiles.json): `profiles.json`

### Other components

- **Event organizer**

## Connections

- Event organizer → Search page: opens search (evidence: `README.md`)
- App entry → Search page: renders (evidence: `frontend/src/main.tsx`)
- App entry → Preview page: loads preview (evidence: `frontend/src/main.tsx`)
- Search page → Page layout: renders (evidence: `frontend/src/pages/SearchPage.tsx`)
- Search page → Search form: renders (evidence: `frontend/src/pages/SearchPage.tsx`)
- Search page → Results view: renders (evidence: `frontend/src/pages/SearchPage.tsx`)
- Search page → Search state: uses state (evidence: `frontend/src/pages/SearchPage.tsx`)
- Search form → Search state: submits request (evidence: `frontend/src/pages/SearchPage.tsx`)
- Search state → Service selector: requests options and matches (evidence: `frontend/src/hooks/useVendorSearch.ts`)
- Service selector → HTTP adapter: selects live adapter (evidence: `frontend/src/services/vendorService.ts`)
- HTTP adapter → FastAPI routes: posts match request (evidence: `frontend/src/services/apiVendorService.ts`)
- FastAPI routes → Validation and matching: dispatches matching (evidence: `app.py`)
- Validation and matching → Backend catalog: uses catalog (evidence: `README.md`)
- HTTP adapter → UI profile data: reads profile details (evidence: `frontend/src/services/apiVendorService.ts`)
- Search state → Results view: returns response (evidence: `frontend/src/pages/SearchPage.tsx`)
- Results view → Vendor card: renders cards (evidence: `frontend/src/components/SearchResults.tsx`)
- Preview page → Service selector: creates preview service (evidence: `frontend/src/pages/PreviewPage.tsx`)
- Service selector → Mock adapter: creates mock adapter (evidence: `frontend/src/services/vendorService.ts`)
- Profile preparation → Anonymized dataset: prepares from (evidence: `README.md`)
- Profile preparation → Backend catalog: prepares catalog (evidence: `README.md`)
