# gajukharche1/directory-local architecture

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

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

## Overview

This is a SvelteKit local-business directory. Visitors discover published businesses through search, category/location browsing, and listing profiles; they can send enquiries and reviews. Owners manage listings and billing, while moderators administer listings, imports, and review moderation. The graph includes the documented capabilities and the sampled search, review, authentication, import, and enquiry paths. Several subsystems are represented from README descriptions or the route tree; unsampled implementation links are omitted rather than inferred.

Main entry points: [`src/lib/db/client.ts`](https://github.com/gajukharche1/directory-local/blob/main/src/lib/db/client.ts) (Directory database), [`src/routes/(auth)/register/+page.server.ts`](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(auth)/register/%2Bpage.server.ts) (Account registration), [`src/lib/services/search.service.ts`](https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/search.service.ts) (Search service), [`src/routes/(public)/reviews/new/+page.server.ts`](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/reviews/new/%2Bpage.server.ts) (Review submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Directory discovery"]
  node_home["Home discovery<br/>[+page.server.ts]"]
  node_search["Directory search<br/>[+page.server.ts]"]
  node_searchsvc["Search service<br/>[search.service.ts]"]
  node_taxonomy["Category and location pages<br/>[+page.server.ts]"]
  node_listing["Business profiles<br/>[+page.server.ts]"]
  node_map["Map display<br/>[MapView.svelte]"]
end

subgraph group_engagement["Customer engagement"]
  node_review["Review submission<br/>[+page.server.ts]"]
  node_reviewform["Review form<br/>[ReviewForm.svelte]"]
  node_reviewservice["Review service<br/>[review.service.ts]"]
  node_enquiry["Enquiry endpoint<br/>[+server.ts]"]
  node_enquiryservice["Enquiry service<br/>[enquiry.service.ts]"]
end

subgraph group_management["Business management"]
  node_account["Account access<br/>[+page.server.ts]"]
  node_registration["Account registration<br/>[+page.server.ts]"]
  node_dashboard["Owner dashboard<br/>[+page.server.ts]"]
  node_billing["Billing and plans<br/>[+page.server.ts]"]
  node_claim["Listing claims<br/>[+page.server.ts]"]
  node_admin["Administration<br/>[+page.server.ts]"]
  node_imports["Listing imports<br/>[+page.server.ts]"]
  node_moderation["Review moderation<br/>[+page.server.ts]"]
end

subgraph group_platform["Platform services"]
  node_sessions["Session management<br/>[session.ts]"]
  node_email["Email service<br/>[email.service.ts]"]
  node_database[("Directory database<br/>[client.ts]")]
  node_seed["Initial data seeding<br/>[seed.ts]"]
  node_seo["Search indexing routes<br/>[+server.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_visitor -->|"searches"| node_search
node_home -->|"loads featured taxonomy"| node_searchsvc
node_search -->|"runs query"| node_searchsvc
node_searchsvc -->|"queries listings"| node_database
node_visitor -->|"browses categories"| node_taxonomy
node_visitor -->|"views profile"| node_listing
node_visitor -->|"signs in"| node_account
node_visitor -->|"registers"| node_registration
node_account -->|"creates session"| node_sessions
node_registration -->|"creates session"| node_sessions
node_registration -->|"sends welcome email"| node_email
node_visitor -->|"manages business"| node_dashboard
node_visitor -->|"manages subscription"| node_billing
node_visitor -->|"claims listing"| node_claim
node_visitor -->|"moderates directory"| node_admin
node_admin -->|"imports listings"| node_imports
node_visitor -->|"submits review"| node_review
node_review -->|"submits review"| node_reviewservice
node_reviewform -->|"collects review"| node_review
node_moderation -->|"updates status"| node_reviewservice
node_reviewservice -->|"stores review"| node_database
node_visitor -->|"sends enquiry"| node_enquiry
node_enquiry -->|"submits enquiry"| node_enquiryservice
node_imports -->|"creates listings"| node_database
node_seo -->|"reads published content"| node_database

click node_home "https://github.com/gajukharche1/directory-local/blob/main/src/routes/%2Bpage.server.ts"
click node_search "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/search/%2Bpage.server.ts"
click node_searchsvc "https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/search.service.ts"
click node_taxonomy "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/category/%5B...slug%5D/%2Bpage.server.ts"
click node_listing "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/listing/%5Bslug%5D/%2Bpage.server.ts"
click node_map "https://github.com/gajukharche1/directory-local/blob/main/src/lib/components/map/MapView.svelte"
click node_account "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(auth)/login/%2Bpage.server.ts"
click node_registration "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(auth)/register/%2Bpage.server.ts"
click node_sessions "https://github.com/gajukharche1/directory-local/blob/main/src/lib/auth/session.ts"
click node_dashboard "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(account)/dashboard/%2Bpage.server.ts"
click node_billing "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(account)/dashboard/billing/%2Bpage.server.ts"
click node_claim "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/claim/%5Bslug%5D/%2Bpage.server.ts"
click node_admin "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(admin)/admin/%2Bpage.server.ts"
click node_imports "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(admin)/admin/imports/%2Bpage.server.ts"
click node_review "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/reviews/new/%2Bpage.server.ts"
click node_reviewform "https://github.com/gajukharche1/directory-local/blob/main/src/lib/components/reviews/ReviewForm.svelte"
click node_reviewservice "https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/review.service.ts"
click node_moderation "https://github.com/gajukharche1/directory-local/blob/main/src/routes/(admin)/admin/moderation/%2Bpage.server.ts"
click node_enquiry "https://github.com/gajukharche1/directory-local/blob/main/src/routes/api/enquiry/%2Bserver.ts"
click node_enquiryservice "https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/enquiry.service.ts"
click node_email "https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/email.service.ts"
click node_database "https://github.com/gajukharche1/directory-local/blob/main/src/lib/db/client.ts"
click node_seed "https://github.com/gajukharche1/directory-local/blob/main/scripts/seed.ts"
click node_seo "https://github.com/gajukharche1/directory-local/blob/main/src/routes/sitemap.xml/%2Bserver.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_search,node_searchsvc,node_taxonomy,node_listing,node_map toneBlue
class node_review,node_reviewform,node_reviewservice,node_enquiry,node_enquiryservice toneAmber
class node_account,node_registration,node_dashboard,node_billing,node_claim,node_admin,node_imports,node_moderation toneMint
class node_sessions,node_email,node_database,node_seed,node_seo toneRose
class node_visitor toneIndigo
```

## Components

### Directory discovery

- [Home discovery](https://github.com/gajukharche1/directory-local/blob/main/src/routes/%2Bpage.server.ts): `src/routes/+page.server.ts`
- [Directory search](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/search/%2Bpage.server.ts): `src/routes/(public)/search/+page.server.ts`
- [Search service](https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/search.service.ts): `src/lib/services/search.service.ts`
- [Category and location pages](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/category/%5B...slug%5D/%2Bpage.server.ts): `src/routes/(public)/category/[...slug]/+page.server.ts`
- [Business profiles](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/listing/%5Bslug%5D/%2Bpage.server.ts): `src/routes/(public)/listing/[slug]/+page.server.ts`
- [Map display](https://github.com/gajukharche1/directory-local/blob/main/src/lib/components/map/MapView.svelte): `src/lib/components/map/MapView.svelte`

### Customer engagement

- [Review submission](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/reviews/new/%2Bpage.server.ts): `src/routes/(public)/reviews/new/+page.server.ts`
- [Review form](https://github.com/gajukharche1/directory-local/blob/main/src/lib/components/reviews/ReviewForm.svelte): `src/lib/components/reviews/ReviewForm.svelte`
- [Review service](https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/review.service.ts): `src/lib/services/review.service.ts`
- [Enquiry endpoint](https://github.com/gajukharche1/directory-local/blob/main/src/routes/api/enquiry/%2Bserver.ts): `src/routes/api/enquiry/+server.ts`
- [Enquiry service](https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/enquiry.service.ts): `src/lib/services/enquiry.service.ts`

### Business management

- [Account access](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(auth)/login/%2Bpage.server.ts): `src/routes/(auth)/login/+page.server.ts`
- [Account registration](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(auth)/register/%2Bpage.server.ts): `src/routes/(auth)/register/+page.server.ts`
- [Owner dashboard](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(account)/dashboard/%2Bpage.server.ts): `src/routes/(account)/dashboard/+page.server.ts`
- [Billing and plans](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(account)/dashboard/billing/%2Bpage.server.ts): `src/routes/(account)/dashboard/billing/+page.server.ts`
- [Listing claims](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(public)/claim/%5Bslug%5D/%2Bpage.server.ts): `src/routes/(public)/claim/[slug]/+page.server.ts`
- [Administration](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(admin)/admin/%2Bpage.server.ts): `src/routes/(admin)/admin/+page.server.ts`
- [Listing imports](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(admin)/admin/imports/%2Bpage.server.ts): `src/routes/(admin)/admin/imports/+page.server.ts`
- [Review moderation](https://github.com/gajukharche1/directory-local/blob/main/src/routes/(admin)/admin/moderation/%2Bpage.server.ts): `src/routes/(admin)/admin/moderation/+page.server.ts`

### Platform services

- [Session management](https://github.com/gajukharche1/directory-local/blob/main/src/lib/auth/session.ts): `src/lib/auth/session.ts`
- [Email service](https://github.com/gajukharche1/directory-local/blob/main/src/lib/services/email.service.ts): `src/lib/services/email.service.ts`
- [Directory database](https://github.com/gajukharche1/directory-local/blob/main/src/lib/db/client.ts): `src/lib/db/client.ts`
- [Initial data seeding](https://github.com/gajukharche1/directory-local/blob/main/scripts/seed.ts): `scripts/seed.ts`
- [Search indexing routes](https://github.com/gajukharche1/directory-local/blob/main/src/routes/sitemap.xml/%2Bserver.ts): `src/routes/sitemap.xml/+server.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Home discovery: browses
- Visitor → Directory search: searches
- Home discovery → Search service: loads featured taxonomy (evidence: `src/routes/+page.server.ts`)
- Directory search → Search service: runs query (evidence: `src/routes/(public)/search/+page.server.ts`)
- Search service → Directory database: queries listings (evidence: `src/lib/services/search.service.ts`)
- Visitor → Category and location pages: browses categories
- Visitor → Business profiles: views profile
- Visitor → Account access: signs in
- Visitor → Account registration: registers
- Account access → Session management: creates session (evidence: `src/routes/(auth)/login/+page.server.ts`)
- Account registration → Session management: creates session (evidence: `src/routes/(auth)/register/+page.server.ts`)
- Account registration → Email service: sends welcome email (evidence: `src/routes/(auth)/register/+page.server.ts`)
- Visitor → Owner dashboard: manages business
- Visitor → Billing and plans: manages subscription
- Visitor → Listing claims: claims listing
- Visitor → Administration: moderates directory
- Administration → Listing imports: imports listings
- Visitor → Review submission: submits review
- Review submission → Review service: submits review (evidence: `src/lib/services/review.service.ts`)
- Review form → Review submission: collects review
- Review moderation → Review service: updates status
- Review service → Directory database: stores review (evidence: `src/lib/services/review.service.ts`)
- Visitor → Enquiry endpoint: sends enquiry
- Enquiry endpoint → Enquiry service: submits enquiry (evidence: `src/routes/api/enquiry/+server.ts`)
- Listing imports → Directory database: creates listings (evidence: `src/routes/(admin)/admin/imports/+page.server.ts`)
- Search indexing routes → Directory database: reads published content (evidence: `src/routes/sitemap.xml/+server.ts`)
