# hichamoujari/engineer architecture

> Architecture diagram of the GitHub repository hichamoujari/engineer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hichamoujari/engineer
- Repository: https://github.com/hichamoujari/engineer

## Overview

##### Project type and purpose
- From the file-tree and README, this is a Next.js React project that implements a marketing/personal site (“Engineer”) with multiple pages (home, about, services, projects, etc.) and a large component library under “component”.
- There is no separate backend or API folder—this is purely a front-end application (using Next.js for routing + server-side rendering/static generation) with static assets.

##### File structure
- Top-level folders:
- pages – Next.js page components (file-based routing)
- component – reusable React components grouped by feature (About, Project, home, outils, plus nav.js, footer.js)
- styles – CSS modules for each page and globals
- Key configuration scripts: package.json, package-lock.json, .gitignore
- Next.js implicit architecture: SSR/SSG server, static file serving, React hydration

##### README
- Very minimal; only “# Engineer” title. No explicit architecture details.

a. Main components
1) Client (Browser)
2) Next.js web server (Node.js runtime)
3) React rendering layer
4) Pages folder (file-router)
5) Component library (presentational + container components under “component/…”)
6) Static asset store (public/)
7) CSS modules (styles/)
8) Build & Deployment pipeline (Next.js build → Vercel/Netlify or CDN)

b. Relationships & interactions
- The browser issues HTTP requests to the Next.js server
- Next.js server uses file-based routing (pages/) to decide SSR vs SSG
- React components (component/) are composed by pages to build each route
- CSS modules (styles/) provide scoped styling at compile time
- Static assets (public/) served directly or via the CDN edge cache
- Build step bundles JS/CSS, outputs static assets + server bundles → deployed

c. Architectural patterns & design principles
- File-based routing (Next.js pages)
- Component composition (atomic/feature grouping under component/)
- Server-Side Rendering (SSR) / Static Site Generation (SSG) for SEO/performance
- Separation of concerns: UI components vs pages vs styles vs static assets

d. Key technologies/frameworks
- Next.js (React framework)
- React (component model)
- CSS Modules (styles/*.module.css)
- Node.js (runtime for SSR)
- Vercel/Netlify (typical hosting/CDN)

##### Final recommendations
- Be exhaustive: group every folder (“component/About”, “component/Project”, “component/home”, nav/footer) as sub-sections of the “Component Library.”
- SSR vs SSG flows if applicable (e.g., “getStaticProps” -> pre-render at build).
- Which pages consume which component groups.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        Browser["Browser"]:::runtime
    end

    %% Server Layer
    subgraph "Server Layer"
        NextServer["Next.js Server (Node.js)"]:::runtime
        subgraph "Pages (file-based routing)" 
            _app["_app.js"]:::code
            index["index.js"]:::code
            about["about.js"]:::code
            servicesIndex["services/index.js"]:::code
            projectsFilter["services/projects-filter.js"]:::code
            projects["services/projects.js"]:::code
            singleService["services/single-service.js"]:::code
        end
        subgraph "Component Library"
            compHome["Home Components"]:::code
            compAbout["About Components"]:::code
            compProject["Project/Service Components"]:::code
            compOutils["Utility Components"]:::code
            nav["nav.js"]:::code
            footer["footer.js"]:::code
        end
        subgraph "CSS Modules"
            globals["globals.css"]:::code
            homeStyle["Home.module.css"]:::code
            aboutStyle["About.module.css"]:::code
            serviceStyle["Service.module.css"]:::code
            navFootStyle["nav_footer.module.css"]:::code
        end
        subgraph "Static Assets (public/)"
            homeAssets["public/home/"]:::assets
            aboutAssets["public/about/"]:::assets
            serviceAssets["public/service/"]:::assets
        end
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        Source["Source Code"]:::code
        Build["Next.js Build"]:::code
        CDN["CDN / Vercel"]:::infra
    end

    %% Connections
    Browser --> NextServer
    NextServer --> _app
    NextServer --> index
    NextServer --> about
    NextServer --> servicesIndex
    NextServer --> projectsFilter
    NextServer --> projects
    NextServer --> singleService
    NextServer --> compHome
    NextServer --> compAbout
    NextServer --> compProject
    NextServer --> compOutils
    NextServer --> nav
    NextServer --> footer
    NextServer --> globals
    NextServer --> homeStyle
    NextServer --> aboutStyle
    NextServer --> serviceStyle
    NextServer --> navFootStyle
    NextServer --> homeAssets
    NextServer --> aboutAssets
    NextServer --> serviceAssets
    Source --> Build --> CDN --> Browser

    %% Click Events - Pages
    click _app "https://github.com/hichamoujari/engineer/blob/main/pages/_app.js"
    click index "https://github.com/hichamoujari/engineer/blob/main/pages/index.js"
    click about "https://github.com/hichamoujari/engineer/blob/main/pages/about.js"
    click servicesIndex "https://github.com/hichamoujari/engineer/blob/main/pages/services/index.js"
    click projectsFilter "https://github.com/hichamoujari/engineer/blob/main/pages/services/projects-filter.js"
    click projects "https://github.com/hichamoujari/engineer/blob/main/pages/services/projects.js"
    click singleService "https://github.com/hichamoujari/engineer/blob/main/pages/services/single-service.js"

    %% Click Events - Component Library
    click compHome "https://github.com/hichamoujari/engineer/tree/main/component/home/"
    click compAbout "https://github.com/hichamoujari/engineer/tree/main/component/About/"
    click compProject "https://github.com/hichamoujari/engineer/tree/main/component/Project/"
    click compOutils "https://github.com/hichamoujari/engineer/tree/main/component/outils/"
    click nav "https://github.com/hichamoujari/engineer/blob/main/component/nav.js"
    click footer "https://github.com/hichamoujari/engineer/blob/main/component/footer.js"

    %% Click Events - CSS Modules
    click globals "https://github.com/hichamoujari/engineer/blob/main/styles/globals.css"
    click homeStyle "https://github.com/hichamoujari/engineer/blob/main/styles/Home.module.css"
    click aboutStyle "https://github.com/hichamoujari/engineer/blob/main/styles/About.module.css"
    click serviceStyle "https://github.com/hichamoujari/engineer/blob/main/styles/Service.module.css"
    click navFootStyle "https://github.com/hichamoujari/engineer/blob/main/styles/nav_footer.module.css"

    %% Click Events - Static Assets
    click homeAssets "https://github.com/hichamoujari/engineer/tree/main/public/home/"
    click aboutAssets "https://github.com/hichamoujari/engineer/tree/main/public/about/"
    click serviceAssets "https://github.com/hichamoujari/engineer/tree/main/public/service/"

    %% Styles
    classDef runtime fill:#D0E8FF,stroke:#0366d6,color:#0366d6,stroke-width:1px
    classDef code fill:#E6F4EA,stroke:#28a745,color:#28a745,stroke-width:1px
    classDef assets fill:#FFF4E5,stroke:#d9830c,color:#d9830c,stroke-width:1px
    classDef infra fill:#F2F2F2,stroke:#6a737d,color:#6a737d,stroke-width:1px
```
