How engdawood/portfolio-website-arabic-english works
Project type and purpose
• This is a full-stack, React-based portfolio website built with Next.js 15.
• Purpose: present personal information, projects, blog, services, with bilingual support, dynamic theming, animations, and optimal performance (SSR/SSG).
File structure
• src/app/ – Next.js App Router pages (home, about, blog, contact, projects, services).
• src/components/ – reusable UI components (layout, sidebar, theme toggle, animations, error boundary).
• src/context/ – React Context providers (language, theme, sidebar state).
• src/data/ & src/translations/ – static content and translations for bilingual support.
• src/hooks/ & src/utils/ – custom hooks (e.g., useColorScheme, useTranslatedData) and utility functions.
• Configuration/build files: next.config.*, tsconfig.json, eslint.config.mjs, postcss.config.mjs.
Key architectural patterns
• Next.js App Router with hybrid rendering: SSR (server-rendered pages), SSG (static pages generated at build time), and client components for interactivity.
• Context API for global state (language, theme, sidebar).
• Component-driven UI pattern: each feature (search, newsletter, sidebar) encapsulated in a component.
• Data-driven pages: page routes import static data and translation files.
Main components
a. Client (Browser)
• Renders React components, triggers client-side routing (Next.js Link).
• Switches themes and languages via Context providers.
b. Next.js Server (Node.js runtime on Vercel or custom host)
• Handles incoming HTTP requests.
• App Router logic: decides SSR vs SSG.
• Serves pre-rendered HTML, JSON for client components, and static assets.
c. Static Data Layer
• src/data/* and src/translations/* imported by server at build/run time.
d. Public/CDN Layer
• Static assets (images, CSS, fonts) served from public/ via CDN (Vercel edge).
• Next.js Image optimization and caching.
e. Deployment/Hosting
• Vercel platform (GitHub integration or CLI) manages build, cache, CDN, and edge functions.
Relationships and interactions
• Browser → HTTPS → Next.js Server
• Initial page request → SSR or SSG HTML
• Hydration: client-side React takes over
• Browser (client components) ↔ Next.js Data Fetching (app router)
• fetch static content or inline JSON
• Next.js Server ↔ File system
• Reads page components, static data, translations, utilities
• Next.js Server ↔ CDN/Public
• Uploads public assets during build → served to clients directly
Elements
• Clear component labels: Browser, Next.js Server (App Router), Data Files, CDN/Public Assets, Vercel.
• Browser → Server (request)
• Server → Browser (HTML/JSON)
• Server → File System (data lookup)
• Browser ↔ Client components (hydration/interactivity)