How umerqureshi409/al-quran-kanzul-iman works
Project type and purpose
• This is a full-stack SSR (server-side rendered) web application built with Next.js.
• Purpose: Provide a browsable Quran reading experience with Urdu translation (Kanzul Iman), plus features such as personalized reading schedules and an AI-powered helper via a Next.js API route.
File structure
• Top-level files:
• next.config.js, tsconfig.json, tailwind.config.js → build and framework configuration
• .env.local → environment variables for API keys or runtime flags
• src/app → Next.js App Router structure:
• page.tsx, layout.tsx, globals.scss → root layout and styles
• /api/ai/route.ts → serverless API endpoint for AI assistance
• /list, /read/surah/[surahID], /schedule, /developers, /terms, /ai → page routes
• src/components → reusable React components (UI library, navigation, cards, modals)
• src/app/rtk → Redux Toolkit store, slices, hooks for client-side state (reading list, schedule)
• public → static assets
• package.json → dependencies: next, react, tailwindcss, @reduxjs/toolkit, etc.
README
• Confirms Next.js (SSR), Tailwind CSS, Vercel deployment
• Features: full Quran text, translation, reading schedule, developer resources, responsive design
• No external database is mentioned—likely static JSON or client-side storage for schedules
a. Main components:
1. Client (Browser)
2. Next.js Server (SSR + API routes)
3. React Component Layer (Pages, UI components)
4. State Management Layer (Redux Toolkit store & slices)
5. Serverless Function (/api/ai) → AI Service
6. Static Data Source (Quran text + translation files under public or fetched externally)
7. Deployment Platform (Vercel)
b. Relationships & Interactions:
• Browser ↔ Next.js Server for initial page renders (SSR)
• Client → React components → RTK store for UI state
• Client → fetch calls to /api/ai → AI Service (e.g., OpenAI) → back to Client
• Pages (e.g., /read) read static data or call fetch endpoints to retrieve Quran text
• Schedule pages interact with RTK store, persisted to localStorage (or a lightweight backend if added later)
c. Architectural patterns & design principles:
• SSR (Next.js App Router) for performance & SEO
• Component-based design (separation of concerns: UI → components, business logic → RTK slices)
• Serverless architecture (API route isolated in /app/api)
• Single codebase deployment (monorepo on Vercel)
d. Key technologies/frameworks/libraries:
• Next.js (App Router, SSR, serverless functions)
• React (functional components, hooks)
• Redux Toolkit (store.ts, slices: listSlice, scheduleSlice, hooks.ts)
• Tailwind CSS (utility classes via tailwind.config.js)
• Vercel (hosting, serverless runtime)