How omkar-murala/flash works
Project type and purpose
• This is a full-stack, server-rendered React web application built with Next.js (App Router).
• It exposes static/SSG pages (home, contact), dynamic client-side interactions (scroll effects, brand carousel), and a single serverless API endpoint (/api/form) to process contact-form submissions via an email utility.
File structure
• Top-level configuration and build files:
– next.config.mjs, tsconfig.json, tailwind.config.ts, postcss.config.mjs
• Public/static assets:
– public/
• Source code under src/:
– app/: Next.js “app” directory with page.tsx (home), contactus/page.tsx, layout.tsx, globals.css, and nested API route at app/api/form/route.ts
– components/: UI building blocks (Navbar, Brandscroll, Scroll effect)
– util/: helper function mail.ts used by the API route
Key insights from README
• Bootstrapped with Create-Next-App
• Uses next/font for custom fonts
• Deployed on Vercel (serverless functions for API routes + static page hosting)
Main components & interactions
a. Browser (Client)
b. CDN / Edge Cache (e.g., Vercel’s global CDN)
c. Next.js Application
– Static/SSG pages served from edge cache
– SSR/Serverless functions for dynamic page rendering (if any)
– API Route serverless function at /api/form
– React components in the “app/” and “components/” folders
d. Styling Pipeline
– Tailwind CSS + PostCSS during build
e. Utility Layer
– mail.ts: encapsulates email-provider integration (SMTP/SendGrid/etc.)
f. External Service
– Email Service Provider
Architectural patterns & design principles
• Separation of concerns: UI components (components/), page layouts (app/), business logic (util/)
• Next.js App Router pattern: file-based routing for pages and API routes
• Serverless architecture for backend/API logic
• CDN caching for static assets and SSG pages