How arka-nexus-eiei/arka-nexus works
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: routes.tsx Route definitions · useServiceData.ts Service data hook · App.tsx App root · MainLayout.tsx Main layout
Components 23
SPA Shell
- Browser entry
src/main.tsx - App root
src/app/App.tsx - Shared providers
src/app/providers.tsx - Route definitions
src/app/routes.tsx - Main layout · Hosts navigation, footer, and shared page chrome.
src/shared/layout/MainLayout.tsx - Header navigation
src/shared/components/header/Header.tsx - Scroll restoration
src/core/routing/ScrollToTop.tsx
Feature Modules
- Feature pages · Home, about, research, SDG, instruments, publications, snapshots, and services.
src/modules/home/pages/HomePage.tsx - Service catalog landing
src/modules/services/pages/ServiceLandingPage.tsx - Service detail
src/modules/services/pages/ServicePage.tsx - Service data hook · Selects definitions, assets, and templates.
src/modules/services/hooks/useServiceData.ts - Service templates · Maps services to audit or training renderers.
src/modules/services/config/serviceTemplateMap.ts - Content view hooks · Publications filtering, snapshots masonry, and instruments gallery data.
src/modules/publications/hooks/usePublications.ts
Sanity Content
Read-only external CMS integration.
- Sanity configuration · Project settings come from environment variables.
src/core/config/sanity.config.ts - Sanity client
src/core/services/client.ts - GROQ queries
src/core/services/sanity/queries/serviceRegistry.query.ts - Content services
src/core/services/sanity/publications.service.ts
Contact Delivery
- Contact modal · Owns validation and submission feedback.
src/shared/components/contact/ContactModal.tsx - Contact form hook
src/shared/components/contact/hooks/useContactForm.ts - EmailJS service · Uses Vite environment credentials.
src/core/services/email/email.service.ts
Static Delivery
- Static build and hosting · Builds dist/ for Apache-style SPA hosting.
vite.config.ts - SPA fallback
public/.htaccess - Bundled assets
src/assets
Connections 22
- 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