# gajukharche1/local-business-directory architecture

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

- Interactive diagram: https://gitdiagram.com/gajukharche1/local-business-directory
- Repository: https://github.com/gajukharche1/local-business-directory

## Overview

This is a local-business directory for discovering, contacting, reviewing, and managing businesses. The main user journey is search or browse → inspect a business profile → send an enquiry or review; owners can submit and manage listings, while administrators moderate and maintain directory data. The graph includes documented SEO, analytics, media, billing, and import capabilities. Relationships are based on README statements and SOURCE INDEX references; unsampled implementations are represented only at supported paths.

Main entry points: [`app/(public)/search/page.tsx`](https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/search/page.tsx) (Search results), [`lib/db/client.ts`](https://github.com/gajukharche1/local-business-directory/blob/main/lib/db/client.ts) (PostgreSQL data access), [`lib/services/listing.service.ts`](https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/listing.service.ts) (Listing service), [`app/page.tsx`](https://github.com/gajukharche1/local-business-directory/blob/main/app/page.tsx) (Directory home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Public directory"]
  node_home["Directory home<br/>[page.tsx]"]
  node_searchpage["Search results<br/>[page.tsx]"]
  node_filters["Search filters<br/>[search-filters.tsx]"]
  node_listingcard["Listing cards<br/>[listing-card.tsx]"]
  node_map["Map view<br/>[map-view.tsx]"]
  node_taxonomy["Category and location pages<br/>[page.tsx]"]
  node_profile["Business profile<br/>[page.tsx]"]
  node_enquiry["Customer enquiries<br/>[enquiry.ts]"]
  node_reviewform["Review submission<br/>[review-form.tsx]"]
end

subgraph group_merchant["Merchant tools"]
  node_submission["Business submission<br/>[page.tsx]"]
  node_dashboard["Merchant dashboard<br/>[page.tsx]"]
  node_analytics["Listing analytics"]
  node_media["Media management<br/>[media-manager.tsx]"]
  node_billing["Billing and plans<br/>[page.tsx]"]
end

subgraph group_admin["Administration"]
  node_adminmoderation["Admin moderation<br/>[page.tsx]"]
  node_taxonomyadmin["Taxonomy management<br/>[taxonomy.ts]"]
  node_csvimport["CSV import<br/>[page.tsx]"]
end

subgraph group_services["Domain services"]
  node_searchservice["Search service<br/>[search.service.ts]"]
  node_reviewaction["Review actions<br/>[review.ts]"]
  node_reviewservice["Review service<br/>[review.service.ts]"]
  node_paymentwebhook["Payment webhook<br/>[route.ts]"]
  node_listingservice["Listing service<br/>[listing.service.ts]"]
  node_plans["Plan service<br/>[plan.service.ts]"]
  node_seo["SEO and metadata<br/>[seo.service.ts]"]
end

subgraph group_platform["Platform foundation"]
  node_auth["Session and access<br/>[session.ts]"]
  node_database[("PostgreSQL data access<br/>[client.ts]")]
  node_storage["Media storage<br/>[driver.ts]"]
end

node_visitor(("Directory visitor"))

node_visitor -->|"browses"| node_home
node_visitor -->|"searches"| node_searchpage
node_home -->|"opens search"| node_searchpage
node_home -->|"browses categories"| node_taxonomy
node_searchpage -->|"queries"| node_searchservice
node_searchpage -->|"renders filters"| node_filters
node_searchpage -->|"renders results"| node_listingcard
node_searchpage -->|"renders map"| node_map
node_visitor -->|"opens listing"| node_profile
node_profile -->|"starts enquiry"| node_enquiry
node_profile -->|"submits review"| node_reviewform
node_reviewform -->|"calls action"| node_reviewaction
node_reviewaction -->|"submits review"| node_reviewservice
node_reviewservice -->|"reads and writes"| node_database
node_visitor -->|"submits business"| node_submission
node_submission -.->|"creates listing"| node_listingservice
node_dashboard -->|"loads listings"| node_listingservice
node_dashboard -->|"views analytics"| node_analytics
node_dashboard -.->|"manages media"| node_media
node_media -.->|"stores assets"| node_storage
node_media -.->|"records media"| node_database
node_adminmoderation -.->|"moderates listings"| node_listingservice
node_taxonomyadmin -->|"manages taxonomy"| node_database
node_csvimport -.->|"imports listings"| node_listingservice
node_billing -->|"shows plans"| node_plans
node_paymentwebhook -.->|"updates records"| node_database
node_auth -->|"reads sessions"| node_database
node_listingservice -->|"reads listings"| node_database
node_home -.->|"provides metadata"| node_seo
node_profile -.->|"generates structured data"| node_seo

click node_home "https://github.com/gajukharche1/local-business-directory/blob/main/app/page.tsx"
click node_searchpage "https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/search/page.tsx"
click node_searchservice "https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/search.service.ts"
click node_filters "https://github.com/gajukharche1/local-business-directory/blob/main/components/search/search-filters.tsx"
click node_listingcard "https://github.com/gajukharche1/local-business-directory/blob/main/components/listing/listing-card.tsx"
click node_map "https://github.com/gajukharche1/local-business-directory/blob/main/components/map/map-view.tsx"
click node_taxonomy "https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/category/%5B...slug%5D/page.tsx"
click node_profile "https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/listing/%5Bslug%5D/page.tsx"
click node_enquiry "https://github.com/gajukharche1/local-business-directory/blob/main/actions/enquiry.ts"
click node_reviewform "https://github.com/gajukharche1/local-business-directory/blob/main/components/reviews/review-form.tsx"
click node_reviewaction "https://github.com/gajukharche1/local-business-directory/blob/main/actions/review.ts"
click node_reviewservice "https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/review.service.ts"
click node_submission "https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/submit/page.tsx"
click node_dashboard "https://github.com/gajukharche1/local-business-directory/blob/main/app/(account)/dashboard/page.tsx"
click node_analytics "https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/analytics.service.ts"
click node_media "https://github.com/gajukharche1/local-business-directory/blob/main/components/media/media-manager.tsx"
click node_adminmoderation "https://github.com/gajukharche1/local-business-directory/blob/main/app/(admin)/admin/moderation/page.tsx"
click node_taxonomyadmin "https://github.com/gajukharche1/local-business-directory/blob/main/actions/taxonomy.ts"
click node_csvimport "https://github.com/gajukharche1/local-business-directory/blob/main/app/(admin)/admin/imports/page.tsx"
click node_billing "https://github.com/gajukharche1/local-business-directory/blob/main/app/(account)/dashboard/billing/page.tsx"
click node_paymentwebhook "https://github.com/gajukharche1/local-business-directory/blob/main/app/api/webhooks/payments/route.ts"
click node_listingservice "https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/listing.service.ts"
click node_auth "https://github.com/gajukharche1/local-business-directory/blob/main/lib/auth/session.ts"
click node_database "https://github.com/gajukharche1/local-business-directory/blob/main/lib/db/client.ts"
click node_storage "https://github.com/gajukharche1/local-business-directory/blob/main/lib/storage/driver.ts"
click node_plans "https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/plan.service.ts"
click node_seo "https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/seo.service.ts"

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_searchpage,node_filters,node_listingcard,node_map,node_taxonomy,node_profile,node_enquiry,node_reviewform toneBlue
class node_submission,node_dashboard,node_analytics,node_media,node_billing toneAmber
class node_adminmoderation,node_taxonomyadmin,node_csvimport toneMint
class node_searchservice,node_reviewaction,node_reviewservice,node_paymentwebhook,node_listingservice,node_plans,node_seo toneRose
class node_auth,node_database,node_storage,node_visitor toneIndigo
```

## Components

### Public directory

- [Directory home](https://github.com/gajukharche1/local-business-directory/blob/main/app/page.tsx): `app/page.tsx`
- [Search results](https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/search/page.tsx): `app/(public)/search/page.tsx`
- [Search filters](https://github.com/gajukharche1/local-business-directory/blob/main/components/search/search-filters.tsx): `components/search/search-filters.tsx`
- [Listing cards](https://github.com/gajukharche1/local-business-directory/blob/main/components/listing/listing-card.tsx): `components/listing/listing-card.tsx`
- [Map view](https://github.com/gajukharche1/local-business-directory/blob/main/components/map/map-view.tsx): `components/map/map-view.tsx`
- [Category and location pages](https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/category/%5B...slug%5D/page.tsx): `app/(public)/category/[...slug]/page.tsx`
- [Business profile](https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/listing/%5Bslug%5D/page.tsx): `app/(public)/listing/[slug]/page.tsx`
- [Customer enquiries](https://github.com/gajukharche1/local-business-directory/blob/main/actions/enquiry.ts): `actions/enquiry.ts`
- [Review submission](https://github.com/gajukharche1/local-business-directory/blob/main/components/reviews/review-form.tsx): `components/reviews/review-form.tsx`

### Merchant tools

- [Business submission](https://github.com/gajukharche1/local-business-directory/blob/main/app/(public)/submit/page.tsx): `app/(public)/submit/page.tsx`
- [Merchant dashboard](https://github.com/gajukharche1/local-business-directory/blob/main/app/(account)/dashboard/page.tsx): `app/(account)/dashboard/page.tsx`
- [Listing analytics](https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/analytics.service.ts): `lib/services/analytics.service.ts`
- [Media management](https://github.com/gajukharche1/local-business-directory/blob/main/components/media/media-manager.tsx): `components/media/media-manager.tsx`
- [Billing and plans](https://github.com/gajukharche1/local-business-directory/blob/main/app/(account)/dashboard/billing/page.tsx): `app/(account)/dashboard/billing/page.tsx`

### Administration

- [Admin moderation](https://github.com/gajukharche1/local-business-directory/blob/main/app/(admin)/admin/moderation/page.tsx): `app/(admin)/admin/moderation/page.tsx`
- [Taxonomy management](https://github.com/gajukharche1/local-business-directory/blob/main/actions/taxonomy.ts): `actions/taxonomy.ts`
- [CSV import](https://github.com/gajukharche1/local-business-directory/blob/main/app/(admin)/admin/imports/page.tsx): `app/(admin)/admin/imports/page.tsx`

### Domain services

- [Search service](https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/search.service.ts): `lib/services/search.service.ts`
- [Review actions](https://github.com/gajukharche1/local-business-directory/blob/main/actions/review.ts): `actions/review.ts`
- [Review service](https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/review.service.ts): `lib/services/review.service.ts`
- [Payment webhook](https://github.com/gajukharche1/local-business-directory/blob/main/app/api/webhooks/payments/route.ts): `app/api/webhooks/payments/route.ts`
- [Listing service](https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/listing.service.ts): `lib/services/listing.service.ts`
- [Plan service](https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/plan.service.ts): `lib/services/plan.service.ts`
- [SEO and metadata](https://github.com/gajukharche1/local-business-directory/blob/main/lib/services/seo.service.ts): `lib/services/seo.service.ts`

### Platform foundation

- [Session and access](https://github.com/gajukharche1/local-business-directory/blob/main/lib/auth/session.ts): `lib/auth/session.ts`
- [PostgreSQL data access](https://github.com/gajukharche1/local-business-directory/blob/main/lib/db/client.ts): `lib/db/client.ts`
- [Media storage](https://github.com/gajukharche1/local-business-directory/blob/main/lib/storage/driver.ts): `lib/storage/driver.ts`

### Other components

- **Directory visitor**

## Connections

- Directory visitor → Directory home: browses (evidence: `README.md`)
- Directory visitor → Search results: searches (evidence: `README.md`)
- Directory home → Search results: opens search (evidence: `README.md`)
- Directory home → Category and location pages: browses categories (evidence: `README.md`)
- Search results → Search service: queries (evidence: `app/(public)/search/page.tsx`)
- Search results → Search filters: renders filters (evidence: `app/(public)/search/page.tsx`)
- Search results → Listing cards: renders results (evidence: `app/(public)/search/page.tsx`)
- Search results → Map view: renders map (evidence: `app/(public)/search/page.tsx`)
- Directory visitor → Business profile: opens listing (evidence: `README.md`)
- Business profile → Customer enquiries: starts enquiry (evidence: `README.md`)
- Business profile → Review submission: submits review (evidence: `README.md`)
- Review submission → Review actions: calls action (evidence: `components/reviews/review-form.tsx`)
- Review actions → Review service: submits review (evidence: `actions/review.ts`)
- Review service → PostgreSQL data access: reads and writes (evidence: `lib/services/review.service.ts`)
- Directory visitor → Business submission: submits business (evidence: `README.md`)
- Business submission → Listing service: creates listing
- Merchant dashboard → Listing service: loads listings (evidence: `app/(account)/dashboard/page.tsx`)
- Merchant dashboard → Listing analytics: views analytics
- Merchant dashboard → Media management: manages media (evidence: `README.md`)
- Media management → Media storage: stores assets (evidence: `README.md`)
- Media management → PostgreSQL data access: records media
- Admin moderation → Listing service: moderates listings (evidence: `README.md`)
- Taxonomy management → PostgreSQL data access: manages taxonomy (evidence: `actions/taxonomy.ts`)
- CSV import → Listing service: imports listings (evidence: `README.md`)
- Billing and plans → Plan service: shows plans
- Payment webhook → PostgreSQL data access: updates records
- Session and access → PostgreSQL data access: reads sessions (evidence: `lib/auth/session.ts`)
- Listing service → PostgreSQL data access: reads listings (evidence: `lib/services/listing.service.ts`)
- Directory home → SEO and metadata: provides metadata (evidence: `README.md`)
- Business profile → SEO and metadata: generates structured data (evidence: `README.md`)
