# oaaj-digitals/nebestfitness architecture

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

- Interactive diagram: https://gitdiagram.com/oaaj-digitals/nebestfitness
- Repository: https://github.com/oaaj-digitals/nebestfitness

## Overview

##### Project type and purpose
- NebestFitness is a full‑stack website built with Next.js (App Router), React TS, Tailwind CSS, and Prisma.
- It serves as the official fitness hub, rendering marketing pages (home, about, services, shop, payment) and managing data via Prisma ORM.

##### File structure
- Top level:
- next.config.mjs, tsconfig.json, package.json – Next.js config & build
- prisma/ – database schema & migrations
- app/ – Next.js App Router: layouts, pages, sub‑folders for home and shop segments
- components/ – reusable React components
- app/lib & utilis – shared constants, helper functions
- Patterns:
- App Router organizes routes and layouts by directory
- CSS modules for component­‑scoped styles
- Prisma client in /prisma/client.ts

##### README
- Confirms a React TS frontend with Axios (for API calls) and Dotenv (env variables).
- Hosting on Hostinger, DNS configured there.
- No separate microservice – Next.js provides both serverless endpoints and SSR.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["Client Browser"]:::frontend
        CDN["CDN / DNS"]:::external
        StaticAssets["Static Asset Store"]:::frontend
    end

    %% Server Layer
    subgraph "Server Layer"
        direction TB
        NextJS["Next.js Server (SSR/SSG/API Routes)"]:::server
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Prisma["Prisma ORM Layer"]:::data
        Database["Database"]:::data
    end

    %% External Services
    subgraph "External Services"
        direction TB
        GoogleAnalytics["Google Analytics"]:::external
        PaymentGateway["Payment Gateway"]:::external
    end

    %% Connections
    Browser -->|"DNS lookup"| CDN
    CDN -->|"HTTP Request"| NextJS
    NextJS -->|"Prisma SQL query"| Prisma
    Prisma -->|"SQL Response"| Database
    Browser -->|"GET Assets"| StaticAssets
    Browser -->|"analytics event"| GoogleAnalytics
    NextJS -->|"server analytics"| GoogleAnalytics
    Browser -->|"POST /payment"| PaymentGateway

    %% Click Events
    click NextJS "https://github.com/oaaj-digitals/nebestfitness/tree/main/app/"
    click Components "https://github.com/oaaj-digitals/nebestfitness/tree/main/app/components/"
    click Styles "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/globals.css"
    click TailwindConfig "https://github.com/oaaj-digitals/nebestfitness/blob/main/tailwind.config.ts"
    click PostCSS "https://github.com/oaaj-digitals/nebestfitness/blob/main/postcss.config.js"
    click PrismaClient "https://github.com/oaaj-digitals/nebestfitness/blob/main/prisma/client.ts"
    click PrismaSchema "https://github.com/oaaj-digitals/nebestfitness/blob/main/prisma/schema.prisma"
    click PrismaMigrations "https://github.com/oaaj-digitals/nebestfitness/tree/main/prisma/migrations/"
    click Assets "https://github.com/oaaj-digitals/nebestfitness/tree/main/public/assets/"
    click Videos "https://github.com/oaaj-digitals/nebestfitness/tree/main/public/assets/videos/"
    click Constants "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/lib/constants.ts"
    click Breakpoints "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/utilis/design-breakpoints.ts"
    click MerchUtil "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/utilis/merch.ts"
    click ServicesUtil "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/utilis/services.ts"
    click AccessToken "https://github.com/oaaj-digitals/nebestfitness/blob/main/utilis/getAccessToken.ts"
    click GoogleAnalytics "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/GoogleAnayticsScript.tsx"
    click PaymentPage "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/(home)/payment/page.tsx"
    click PaymentStyles "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/(home)/payment/PaymentPage.module.css"
    click ServicesSitemap "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/(home)/services/sitemap.ts"
    click ShopSitemap "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/(shop)/shop/sitemap.ts"
    click RootSitemap "https://github.com/oaaj-digitals/nebestfitness/blob/main/app/sitemap.ts"
    click NextConfig "https://github.com/oaaj-digitals/nebestfitness/blob/main/next.config.mjs"
    click TSConfig "https://github.com/oaaj-digitals/nebestfitness/blob/main/tsconfig.json"
    click Package "https://github.com/oaaj-digitals/nebestfitness/blob/main/package.json"
    click Env "https://github.com/oaaj-digitals/nebestfitness/blob/main/.env"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#0366d6,color:#0366d6,stroke-width:2px;
    classDef server fill:#DFFFE0,stroke:#28a745,color:#28a745,stroke-width:2px;
    classDef data fill:#FFF4E5,stroke:#d97706,color:#d97706,stroke-width:2px;
    classDef external fill:#F0E6FF,stroke:#6f42c1,color:#6f42c1,stroke-width:2px;
```
