How galsendev221/website works
Project Type & Purpose
• This is a full-stack (mostly frontend) web application built on Next.js with Tailwind CSS for styling.
• It serves static and dynamic pages (home, about, events, gallery, legal, error pages) and provides a minimal backend via Next.js API routes for event data.
Main Architectural Components
a. Client Browser
• Sends HTTP(S) requests; renders HTML/CSS/JS.
b. Next.js Server (SSR/SSG)
• Renders pages server-side or at build time.
• Hosts pages (src/pages) and API routes (src/pages/api).
c. Data Layer
• Static JSON or TypeScript modules under src/pages/api/events (data.ts, type.ts).
d. UI Components Library
• Reusable React components in src/components (layout, navbar, footer, sections).
e. Styling Engine
• Tailwind CSS config (tailwind.config.cjs) + PostCSS (postcss.config.cjs).
f. Localization Module
• JSON files under locales/{en,fr} and i18n.json drive multi-language support.
g. Build & CI/CD
• GitHub Actions (.github/workflows/test.yml), Husky hooks, ESLint, Prettier, lint-staged.
h. Static Assets
Relationships & Data Flow
• Browser → Next.js Server: requests for pages or API endpoints.
• Next.js Server
– ∙ Pages → uses getStaticProps/getServerSideProps to fetch from Data Layer.
– ∙ API Routes → serve JSON from Data Layer to client or SSR functions.
• Next.js → serves rendered HTML + bundled JS/CSS to Browser.
• UI Components consume props/data and render markup.
• Styling Engine processes Tailwind classes into CSS.
• Localization Module supplies text resources to pages/components.
• CI/CD pipeline builds, lints, tests, and deploys to hosting (e.g., Vercel).
Architectural Patterns & Design Principles
• Component-based UI (React) with clear separation of concerns.
• File-system-based routing (Next.js).
• Mix of Static-Site Generation (SSG) and Server-Side Rendering (SSR).
• API layer co-located with frontend for light backend needs.
• Localization separated into external JSON files.
• CI/CD enforces code quality and automates deploy.