v1.0.0-production

Architecture & Infrastructure.

A deep dive into the modern stack powering Param Khajana. Built for scale, security, and developer ergonomics.

The Core Stack

React Server Components meet robust relational data.

N Next.js 16 (App Router)

Full utilization of React Server Components (RSC) and Server Actions. This eliminates thick client bundles. Data mutation happens directly via Server Actions, bypassing traditional API routes entirely for internal state.

export const dynamic = 'force-dynamic';

P Prisma 6 ORM

Type-safe database access to a remote MySQL instance. The entire 13-module schema is strictly typed. All relations (Orders -> OrderItems, Products -> Variants) are handled via Prisma's robust relational querying engine.

await prisma.order.create({ data: {...} })

Infrastructure & Security

Enterprise-grade cloud services powering the backend.

Cloudflare R2 Storage

All product and banner images are hosted on Cloudflare R2 (S3-compatible). Ensures incredibly fast global CDN delivery without the egress costs of AWS, perfectly handling high-traffic festive seasons.

Secure JWT Admin Auth

Admin authentication uses stateless JWT tokens stored in httpOnly, secure cookies. It completely separates the customer session context from the elevated admin dashboard context, preventing privilege escalation.

Axiom Observability

Structured server-side logging using Axiom. Every WhatsApp message fired, email dispatched, and Razorpay webhook received is logged with metadata to trace full execution paths in production.

API Integrations

Connecting Param Khajana to the ecosystem.

Razorpay Webhooks & Crypto

All Razorpay orders are created server-side to prevent tampering. Payment success hits a dedicated webhook endpoint that uses `crypto` to verify the HMAC-SHA256 signature before modifying the database.

crypto.createHmac('sha256', secret).update(body).digest('hex')

Meta (WhatsApp) & Resend APIs

The communication engine dynamically parses database templates (replacing `{{name}}`, `{{total}}`) and fires concurrent POST requests to Meta's Business API and Resend's Email API on order state changes.