# gtech29/stelesthetics architecture

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

- Interactive diagram: https://gitdiagram.com/gtech29/stelesthetics
- Repository: https://github.com/gtech29/stelesthetics

## Overview

##### Project type and purpose
- This is a full-stack monolithic web application built with Next.js (App Router).
- It serves as a marketing/site front end (Home, Contact, Services, Products) with user authentication (NextAuth) and some server-side API routes for auth flows.

##### File structure
- Top level: configuration files (next.config.ts, eslint.config.mjs, tsconfig.json), package.json, and public/ for static assets (images).
- src/app – Next.js App-Router pages and API routes organized by path:
- src/app/api/auth/[...nextauth]/route.ts – NextAuth serverless route.
- src/app/auth/signin & signup – pages for user sign-in/up.
- src/app/contact, /products, /services – content pages.
- src/components – reusable React components (Header, Hero, Reviews, ServicesOverview).
- src/lib/auth.ts – helper logic for authentication.

##### README for additional insights
- Confirms a create-next-app bootstrap using Next.js 13+ App Router.
- Uses next/font for optimized font loading.
- No direct mention of a database, but NextAuth adapters imply an external data store (e.g., PostgreSQL, MongoDB).

a. Main components
- Client (Browser)
- Next.js application
– React UI components (src/components)
– App-Router pages (src/app/…)
– API routes (NextAuth handlers in src/app/api/auth)
- External dependencies
– Authentication data store (DB or provider)
– External OAuth providers (if configured)
- Static asset store (public/images)
b. Relationships & interactions
- Browser ↔ Next.js (SSR/SSG calls, client-side hydration)
- Browser → API/auth routes for sign-in, sign-up, session refresh
- Next.js → Authentication data store (read/write user/session)
- Next.js → External OAuth providers (if applicable)
- Next.js → public/ for static asset serving
c. Architectural patterns & principles
- Monolithic serverless functions for backend logic (NextAuth API route)
- Component-based UI (React + Next.js App Router)
- Separation of concerns:
– Pages (routing)
– Components (UI modules)
– Lib (business logic/helpers)
– Public (static assets)
d. Relevant technologies
- Next.js 13+ (App Router, server components)
- React
- NextAuth.js for authentication
- next/font for typography optimization
- TypeScript

## Diagram (Mermaid)

```mermaid
flowchart TB
    Browser["Browser"]:::external

    subgraph "Client Side (Browser)"
        subgraph "UI Pages"
            Home["Home Page"]:::ui
            Contact["Contact Page"]:::ui
            Services["Services Page"]:::ui
            Products["Products Overview Page"]:::ui
            FullProduct["Full Products Page"]:::ui
            SignIn["Sign-In Page"]:::ui
            SignUp["Sign-Up Page"]:::ui
        end
        subgraph "UI Components"
            Header["Header Component"]:::ui
            Hero["Hero Component"]:::ui
            Reviews["Reviews Component"]:::ui
            ServicesOverview["ServicesOverview Component"]:::ui
        end
    end

    subgraph "Server Side (Next.js Runtime)"
        Config["Next.js Config"]:::config
        AppRouter["App Router & Pages"]:::server
        NextAuthAPI["NextAuth API Route"]:::api
        AuthLib["Authentication Helpers"]:::logic
        StaticServe["Static File Serving"]:::static
    end

    subgraph "External Services & Data"
        DB["Database"]:::db
        OAuth["OAuth Providers"]:::external
        StaticAssets["Static Assets (public/images)"]:::static
    end

    Browser -->|"Request Page"| AppRouter
    AppRouter -->|"Serves Page"| Home
    AppRouter -->|"Serves Page"| Contact
    AppRouter -->|"Serves Page"| Services
    AppRouter -->|"Serves Page"| Products
    AppRouter -->|"Serves Page"| FullProduct
    AppRouter -->|"Serves Page"| SignIn
    AppRouter -->|"Serves Page"| SignUp

    Home --> Header
    Home --> Hero
    Home --> Reviews
    Services --> ServicesOverview

    SignIn -->|"Submit Credentials"| NextAuthAPI
    SignUp -->|"Submit Credentials"| NextAuthAPI

    NextAuthAPI -->|"Uses Helpers"| AuthLib
    NextAuthAPI -->|"Reads/Writes"| DB
    NextAuthAPI -->|"OAuth Flow"| OAuth

    AppRouter -->|"Serves Static"| StaticServe
    StaticServe -->|"From"| StaticAssets

    Config -->|"Configures"| AppRouter

    click Header "https://github.com/gtech29/stelesthetics/blob/master/src/components/Header.tsx"
    click Hero "https://github.com/gtech29/stelesthetics/blob/master/src/components/Hero.tsx"
    click Reviews "https://github.com/gtech29/stelesthetics/blob/master/src/components/Reviews.tsx"
    click ServicesOverview "https://github.com/gtech29/stelesthetics/blob/master/src/components/ServicesOverview.tsx"
    click Home "https://github.com/gtech29/stelesthetics/blob/master/src/app/page.tsx"
    click Contact "https://github.com/gtech29/stelesthetics/blob/master/src/app/contact/page.tsx"
    click Services "https://github.com/gtech29/stelesthetics/blob/master/src/app/services/page.tsx"
    click Products "https://github.com/gtech29/stelesthetics/blob/master/src/app/products/page.tsx"
    click FullProduct "https://github.com/gtech29/stelesthetics/blob/master/src/app/products/full/page.tsx"
    click SignIn "https://github.com/gtech29/stelesthetics/blob/master/src/app/auth/signin/page.tsx"
    click SignUp "https://github.com/gtech29/stelesthetics/blob/master/src/app/auth/signup/page.tsx"
    click NextAuthAPI "https://github.com/gtech29/stelesthetics/blob/master/src/app/api/auth/[...nextauth]/route.ts"
    click AuthLib "https://github.com/gtech29/stelesthetics/blob/master/src/lib/auth.ts"
    click StaticAssets "https://github.com/gtech29/stelesthetics/tree/master/public/images/"
    click Config "https://github.com/gtech29/stelesthetics/blob/master/next.config.ts"
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef server fill:#90EE90,stroke:#333,stroke-width:1px
    classDef api fill:#32CD32,stroke:#333,stroke-width:1px
    classDef logic fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef db fill:#FFA500,stroke:#333,stroke-width:1px
    classDef static fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#FFFFFF,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef config fill:#E0E0E0,stroke:#333,stroke-width:1px
```
