# arka-nexus-eiei/arka-nexus architecture

> Architecture diagram of the GitHub repository arka-nexus-eiei/arka-nexus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arka-nexus-eiei/arka-nexus
- Repository: https://github.com/arka-nexus-eiei/arka-nexus

## Overview

#### Purpose and runtime
ARKA NEXUS is a React/TypeScript corporate-site frontend. It renders a client-side SPA, reads managed content from Sanity, and sends contact submissions through EmailJS. Vite produces a static `dist/` build for Apache/GoDaddy-style hosting; there is no backend, database, authentication, SSR, or CMS schema code.

Entry points: `src/main.tsx`, `src/app/App.tsx`, `src/app/routes.tsx`.

#### Application shell and navigation
The app bootstraps shared providers and route definitions, then renders feature pages within a reusable site layout. Global navigation, footer, contact interaction, background decoration, and not-found handling are shared rather than owned by individual modules.

Paths: `src/app/providers.tsx`, `src/shared/layout/MainLayout.tsx`, `src/shared/components/header/Header.tsx`, `src/shared/components/footer/Footer.tsx`, `src/core/routing/ScrollToTop.tsx`.

#### Feature-module boundary
Domain features are organized under `src/modules`, with pages composing presentational sections. Modules include home, about, research, SDG, instruments, publications, snapshots, and services. Static copy/assets may live in module `content` or `config`; CMS-backed modules use hooks/providers rather than fetching in sections.

Representative paths: `src/modules/home/pages/HomePage.tsx`, `src/modules/about/pages/AboutPage.tsx`, `src/modules/research/pages/ResearchPage.tsx`.

#### CMS data pipeline
Sanity access is isolated in core configuration, client setup, GROQ queries, and resource-specific service files. Feature hooks/providers consume those services and provide loading-ready data to pages and sections. The frontend is read-only; schemas and CMS deployment are intentionally external.

Paths: `src/core/config/sanity.config.ts`, `src/core/services/client.ts`, `src/core/services/sanity/queries/serviceRegistry.query.ts`, `src/core/services/sanity/publications.service.ts`.

#### Service catalog rendering
Services are data-driven: a registry and service data hook select service definitions, asset mappings, and a template map. Landing and detail pages render specialized audit or training templates while preserving a common section model.

Paths: `src/modules/services/pages/ServiceLandingPage.tsx`, `src/modules/services/pages/ServicePage.tsx`, `src/modules/services/hooks/useServiceData.ts`, `src/modules/services/config/serviceTemplateMap.ts`, `src/modules/services/templates/AuditServiceTemplate.tsx`.

#### Data-heavy content views
Instruments, publications, and snapshots each encapsulate retrieval and display behavior. Publications adds client-side filtering; snapshots uses a masonry presentation; instruments uses a page hook and gallery/grid sections. Skeleton components define loading boundaries for asynchronous CMS content.

Paths: `src/modules/publications/hooks/usePublications.ts`, `src/modules/publications/hooks/usePublicationFilters.ts`, `src/modules/snapshots/hooks/useSnapshots.ts`, `src/modules/snapshots/sections/Masonry.tsx`, `src/modules/instruments/hooks/useInstrumentsPage.ts`.

#### Contact and external delivery boundary
The reusable contact modal/form owns validation and user feedback. Its hook delegates email submission to the EmailJS service, configured through Vite environment variables. EmailJS public credentials and Sanity project settings must be supplied at build/runtime via `.env`, not committed.

Paths: `src/shared/components/contact/ContactModal.tsx`, `src/shared/components/contact/hooks/useContactForm.ts`, `src/core/services/email/email.service.ts`, `src/core/config/email.config.ts`.

#### Deployment and static assets
Vite/Tailwind/PostCSS build the browser bundle and styles. Public hosting files implement SPA fallback and crawler metadata; local images, video, and brochure material are bundled from source assets.

Paths: `vite.config.ts`, `tailwind.config.ts`, `public/.htaccess`, `public/_redirects`, `src/assets`.

Main entry points: [`src/app/routes.tsx`](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/routes.tsx) (Route definitions), [`src/modules/services/hooks/useServiceData.ts`](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/hooks/useServiceData.ts) (Service data hook), [`src/app/App.tsx`](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/App.tsx) (App root), [`src/shared/layout/MainLayout.tsx`](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/layout/MainLayout.tsx) (Main layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["SPA Shell"]
  node_main(("Browser entry<br/>React bootstrap<br/>[main.tsx]"))
  node_app["App root<br/>application shell<br/>[App.tsx]"]
  node_providers["Shared providers<br/>provider composition<br/>[providers.tsx]"]
  node_routes["Route definitions<br/>client routing<br/>[routes.tsx]"]
  node_layout["Main layout<br/>shared layout<br/>[MainLayout.tsx]"]
  node_header["Header navigation<br/>shared component<br/>[Header.tsx]"]
  node_scroll["Scroll restoration<br/>routing behavior<br/>[ScrollToTop.tsx]"]
end

subgraph group_features["Feature Modules"]
  node_feature_pages["Feature pages<br/>page composition<br/>[HomePage.tsx]"]
  node_service_landing["Service catalog landing<br/>service page"]
  node_service_detail["Service detail<br/>service page<br/>[ServicePage.tsx]"]
  node_service_data["Service data hook<br/>feature data hook<br/>[useServiceData.ts]"]
  node_service_templates["Service templates<br/>template map"]
  node_content_views["Content view hooks<br/>async feature data<br/>[usePublications.ts]"]
end

subgraph group_cms["Sanity Content"]
  node_sanity_config["Sanity configuration<br/>CMS config<br/>[sanity.config.ts]"]
  node_sanity_client["Sanity client<br/>CMS client<br/>[client.ts]"]
  node_sanity_queries["GROQ queries<br/>query definitions"]
  node_sanity_services["Content services<br/>CMS resource services"]
end

subgraph group_contact["Contact Delivery"]
  node_contact_modal["Contact modal<br/>shared form UI<br/>[ContactModal.tsx]"]
  node_contact_hook["Contact form hook<br/>form submission hook<br/>[useContactForm.ts]"]
  node_email_service{{"EmailJS service<br/>external delivery adapter<br/>[email.service.ts]"}}
end

subgraph group_delivery["Static Delivery"]
  node_static_build["Static build and hosting<br/>Vite deployment<br/>[vite.config.ts]"]
  node_spa_fallback["SPA fallback<br/>hosting rewrite<br/>[.htaccess]"]
  node_assets["Bundled assets<br/>local media"]
end

node_main -->|"mounts"| node_app
node_app -->|"wraps with"| node_providers
node_app -->|"renders"| node_routes
node_routes -->|"places pages in"| node_layout
node_layout -->|"includes"| node_header
node_routes -->|"applies"| node_scroll
node_routes -->|"selects"| node_feature_pages
node_feature_pages -.->|"includes"| node_service_landing
node_service_landing -->|"uses"| node_service_data
node_service_detail -->|"uses"| node_service_data
node_service_data -->|"selects template"| node_service_templates
node_feature_pages -->|"uses"| node_content_views
node_service_data -->|"loads catalog data"| node_sanity_services
node_content_views -->|"loads content"| node_sanity_services
node_sanity_services -->|"executes"| node_sanity_queries
node_sanity_queries -->|"runs through"| node_sanity_client
node_sanity_client -->|"configured by"| node_sanity_config
node_layout -->|"opens"| node_contact_modal
node_contact_modal -->|"submits via"| node_contact_hook
node_contact_hook -->|"delegates delivery"| node_email_service
node_static_build -->|"deployed with"| node_spa_fallback
node_static_build -->|"bundles"| node_assets

click node_main "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/main.tsx"
click node_app "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/App.tsx"
click node_providers "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/providers.tsx"
click node_routes "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/routes.tsx"
click node_layout "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/layout/MainLayout.tsx"
click node_header "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/components/header/Header.tsx"
click node_scroll "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/routing/ScrollToTop.tsx"
click node_feature_pages "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/home/pages/HomePage.tsx"
click node_service_landing "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/pages/ServiceLandingPage.tsx"
click node_service_detail "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/pages/ServicePage.tsx"
click node_service_data "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/hooks/useServiceData.ts"
click node_service_templates "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/config/serviceTemplateMap.ts"
click node_content_views "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/publications/hooks/usePublications.ts"
click node_sanity_config "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/config/sanity.config.ts"
click node_sanity_client "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/client.ts"
click node_sanity_queries "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/sanity/queries/serviceRegistry.query.ts"
click node_sanity_services "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/sanity/publications.service.ts"
click node_contact_modal "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/components/contact/ContactModal.tsx"
click node_contact_hook "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/components/contact/hooks/useContactForm.ts"
click node_email_service "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/email/email.service.ts"
click node_static_build "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/vite.config.ts"
click node_spa_fallback "https://github.com/arka-nexus-eiei/arka-nexus/blob/main/public/.htaccess"
click node_assets "https://github.com/arka-nexus-eiei/arka-nexus/tree/main/src/assets"

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_main,node_app,node_providers,node_routes,node_layout,node_header,node_scroll toneBlue
class node_feature_pages,node_service_landing,node_service_detail,node_service_data,node_service_templates,node_content_views toneAmber
class node_sanity_config,node_sanity_client,node_sanity_queries,node_sanity_services toneMint
class node_contact_modal,node_contact_hook,node_email_service toneRose
class node_static_build,node_spa_fallback,node_assets toneIndigo
```

## Components

### SPA Shell

- [Browser entry](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/main.tsx): React bootstrap · `src/main.tsx`
- [App root](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/App.tsx): application shell · `src/app/App.tsx`
- [Shared providers](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/providers.tsx): provider composition · `src/app/providers.tsx`
- [Route definitions](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/app/routes.tsx): client routing · `src/app/routes.tsx`
- [Main layout](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/layout/MainLayout.tsx): shared layout · Hosts navigation, footer, and shared page chrome. · `src/shared/layout/MainLayout.tsx`
- [Header navigation](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/components/header/Header.tsx): shared component · `src/shared/components/header/Header.tsx`
- [Scroll restoration](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/routing/ScrollToTop.tsx): routing behavior · `src/core/routing/ScrollToTop.tsx`

### Feature Modules

- [Feature pages](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/home/pages/HomePage.tsx): page composition · Home, about, research, SDG, instruments, publications, snapshots, and services. · `src/modules/home/pages/HomePage.tsx`
- [Service catalog landing](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/pages/ServiceLandingPage.tsx): service page · `src/modules/services/pages/ServiceLandingPage.tsx`
- [Service detail](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/pages/ServicePage.tsx): service page · `src/modules/services/pages/ServicePage.tsx`
- [Service data hook](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/hooks/useServiceData.ts): feature data hook · Selects definitions, assets, and templates. · `src/modules/services/hooks/useServiceData.ts`
- [Service templates](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/services/config/serviceTemplateMap.ts): template map · Maps services to audit or training renderers. · `src/modules/services/config/serviceTemplateMap.ts`
- [Content view hooks](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/modules/publications/hooks/usePublications.ts): async feature data · Publications filtering, snapshots masonry, and instruments gallery data. · `src/modules/publications/hooks/usePublications.ts`

### Sanity Content

Read-only external CMS integration.

- [Sanity configuration](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/config/sanity.config.ts): CMS config · Project settings come from environment variables. · `src/core/config/sanity.config.ts`
- [Sanity client](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/client.ts): CMS client · `src/core/services/client.ts`
- [GROQ queries](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/sanity/queries/serviceRegistry.query.ts): query definitions · `src/core/services/sanity/queries/serviceRegistry.query.ts`
- [Content services](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/sanity/publications.service.ts): CMS resource services · `src/core/services/sanity/publications.service.ts`

### Contact Delivery

- [Contact modal](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/components/contact/ContactModal.tsx): shared form UI · Owns validation and submission feedback. · `src/shared/components/contact/ContactModal.tsx`
- [Contact form hook](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/shared/components/contact/hooks/useContactForm.ts): form submission hook · `src/shared/components/contact/hooks/useContactForm.ts`
- [EmailJS service](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/src/core/services/email/email.service.ts): external delivery adapter · Uses Vite environment credentials. · `src/core/services/email/email.service.ts`

### Static Delivery

- [Static build and hosting](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/vite.config.ts): Vite deployment · Builds dist/ for Apache-style SPA hosting. · `vite.config.ts`
- [SPA fallback](https://github.com/arka-nexus-eiei/arka-nexus/blob/main/public/.htaccess): hosting rewrite · `public/.htaccess`
- [Bundled assets](https://github.com/arka-nexus-eiei/arka-nexus/tree/main/src/assets): local media · `src/assets`

## Connections

- Browser entry → App root: mounts
- App root → Shared providers: wraps with
- App root → Route definitions: renders
- Route definitions → Main layout: places pages in
- Main layout → Header navigation: includes
- Route definitions → Scroll restoration: applies
- Route definitions → Feature pages: selects
- Feature pages → Service catalog landing: includes
- Service catalog landing → Service data hook: uses
- Service detail → Service data hook: uses
- Service data hook → Service templates: selects template
- Feature pages → Content view hooks: uses
- Service data hook → Content services: loads catalog data
- Content view hooks → Content services: loads content
- Content services → GROQ queries: executes
- GROQ queries → Sanity client: runs through
- Sanity client → Sanity configuration: configured by
- Main layout → Contact modal: opens
- Contact modal → Contact form hook: submits via
- Contact form hook → EmailJS service: delegates delivery
- Static build and hosting → SPA fallback: deployed with
- Static build and hosting → Bundled assets: bundles
