How codewithwan/imphnen-landing works
Project type and purpose
• This is a full‑stack Next.js (version 13+) landing page application
using the new /app directory structure.
• Purpose: a marketing site for the “IMPHNEN” community, featuring quote submission and gallery, with Firebase (Firestore) as the backend.
File structure
• Top‑level:
• app/ – Next.js routes and layouts (React Server Components + Client Components)
• components/ – reusable UI and animation components
• lib/ – shared utilities and Firebase configuration/service wrappers
• hooks/ – custom React hooks (useMobile, useToast)
• public/ – static assets
• styles/ & tailwind.config.ts – global CSS and Tailwind setup
• next.config.mjs, tsconfig.json, package.json – build and type configurations
• No custom Node‑API routes: client and server components communicate directly with Firebase via the Firebase SDK.
• Configuration: .env.example for environment vars, firebase.rules for Firestore security rules, PostCSS and Tailwind config.
README insights
• Uses environment variables exposing NEXT_PUBLIC_FIREBASE_*
• Firebase Firestore is the quotes store
• UI is fully static or server‑rendered pages, enriched with client‑side Firebase interactions
• Animations and responsive design are core features
Main components and their relationships
a. Frontend (Next.js Application)
• app/layout.tsx – global layout, ThemeProvider (components/theme-provider.tsx)
• app/page.tsx and app/debug-firebase/page.tsx – entry point pages
• components/… – UI primitives, section components, feature cards, forms
• hooks/use-toast.ts, hooks/use-mobile.ts – UI state hooks
b. Firebase Layer
• lib/firebase-config.ts – environment‑driven config
• lib/firebase-service.ts – wrapper functions for Firestore CRUD
• components/firebase-provider.tsx – React Context to expose Firebase app and user feedback
c. Static Assets & Styling
• public/site.webmanifest – PWA manifest
• styles/globals.css, app/globals.css + Tailwind config
d. External Services
• Google Firebase (Firestore) for data persistence
• Hosting (e.g., Vercel or Netlify) serving the Next.js build
Architectural patterns and design principles
• Server Components vs. Client Components in Next.js 13
• Context Provider pattern (FirebaseProvider) for dependency injection
• Separation of concerns:
• UI (components/)
• Business logic & service calls (lib/)
• Application routes (app/)
• CSS-in-JS & utility-first styling (Tailwind + global CSS)