How nabilahzaid/sedekah-je works
Project type and purpose
• This is a Next.js-based, static content-driven web application (a “full-stack” front-end with no external server-side API).
• Purpose: Display a curated, searchable list of donation (QR) codes for mosques, suraus, and institutions.
File structure
• Top-level:
• app/ → Next.js App Router (layout.tsx, page.tsx, globals.css)
• components/ → React UI components (map, filters, cards, popovers, etc.)
• hooks/ → Custom React hooks (e.g., useOutsideClick)
• lib/ → Utility functions
• app/data/ → institutions.ts (static data source)
• app/types/ → TypeScript definitions
• config files → next.config.mjs, tailwind.config.ts, postcss.config.mjs, tsconfig.json, ESLint/biome configs, package.json
README for additional insights
• Data is maintained in app/data/institutions.ts; contributors add entries here.
• Future scope includes an admin panel (Filament PHP), dynamic data extraction, and filtering by state.
• No existing back-end database—data is shipped at build time.
Main components and their interactions
a. Next.js App Router
• layout.tsx: global wrappers (fonts, headers, toasts)
• page.tsx: root page—renders filters, map, and institution list
b. Data Layer
• institutions.ts: static JSON-like data
• lib/utils.ts: helpers (e.g., search, filter functions)
c. UI Layer
• components/ui: building blocks (Button, Card, Dialog, Toast, etc.)
• components/sections: page sections (filters.tsx, states-dropdown.tsx)
• components/map.tsx: map rendering with marker and QR overlays
d. Static Assets
e. Styling & Config
• globals.css + Tailwind
• Sonner (toast notifications)
Interactions:
• On page load, Next.js reads institutions.ts → passes data into page.tsx
• page.tsx renders Sections and Map, wiring filter hook callbacks
• User input (filter dropdown, search) triggers state updates → filtered list + highlighted map markers
• Components invoke lib/utils and use-toast for side effects
Architectural patterns & design principles
• Component-based UI (React + Next.js) with separation by domain (ui vs. sections)
• Data-driven rendering: static data → hydration → client-side interactivity
• Single page root with client routing via Next.js, no custom server or API routes
• Future potential: a service layer (REST or GraphQL) for admin panel