Amandla Leaf is a modern, content‑driven web application built on the Next.js App Router. The app/ structure organizes route groups for content and features—e.g., insights/ (articles, guides, advisories), services/ (including a community transport booking area), things/prayer-time/ (a calculator), and API endpoints for contact, subscribe, site-search, events, and on‑demand revalidation. Shared UI and SEO primitives live under components/, while lib/ centralizes integrations (DatoCMS client/queries, Google/Meta analytics helpers, and db.ts).
Content is modeled in DatoCMS and fetched via GraphQL. The schema includes core types—Post, Category, Author—with structured content, preview metadata (cover image, excerpt), taxonomy (keywords, cultural/location tags), and rich SEO fields (title/description constraints, social previews, Yoast-based readability analysis). Modular blocks (Image, Callout, FAQ, Subscribe Section, Event List) allow editors to compose pages like Home, Service, Sector, and Solutions dynamically. Domain-specific models—Prayer City (lat/long, timezone, juristic/method defaults) and Ramadan Config (hijri windows, banner CTA, FAQ, visibility toggles)—power the prayer-time experience..
Runtime and data: Next.js APIs run on Google Cloud Run, enabling stateless, horizontally scalable endpoints for forms (contact/subscribe), analytics events, and search. Persistent data (e.g., newsletter subscribers, bookings, or cached search indices) is stored in Google Cloud SQL, initialized via lib/db.ts. Transactional and lifecycle emails (form receipts, confirmations) are sent through Resend API. Tailwind CSS provides utility-first styling across shared components/ui/.
Finally, on-demand ISR hooks (/api/revalidate) ensure that editor publishes in DatoCMS propagate to cached pages with minimal latency, preserving static performance while retaining CMS agility.