# fxcircus/frontegg-hosted-login-customization-server architecture

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

- Interactive diagram: https://gitdiagram.com/fxcircus/frontegg-hosted-login-customization-server
- Repository: https://github.com/fxcircus/frontegg-hosted-login-customization-server

## Overview

##### Project type and purpose
- It is typically deployed as a microservice on a hosting platform (Heroku, AWS Lambda, etc.) and sits between the Frontegg login widget and your custom styling configuration.

##### File structure
- Top-level files only:
– server.js – the Express (or plain HTTP) server implementation
– package.json & package-lock.json – npm dependencies (likely express)
– README.md – project description & usage
– .gitignore
- No subdirectories: this is a single Node.js service with a single endpoint.

##### README for additional insights
- No database or complex internal components—just a JSON payload provider.

a. Main components:
2. CI/CD or Manual Deployment – pushes code from Git to hosting (Heroku, Lambda).
3. Node.js service (server.js) – exposes GET /overrides endpoint.
5. Optional: Monitoring/Logging service (e.g., Papertrail, CloudWatch).
b. Relationships and interactions:
- Developer → (Git push) → CI/CD system → (deploy) → Hosting Platform
- Browser → (GET https://your-server/overrides) → Node.js service → (200 OK JSON) → Browser
c. Architectural pattern:
- Simple microservice / API endpoint pattern
- Stateless HTTP service
- Hosted independently of Frontegg application
d. Technologies/Frameworks:
- Node.js & Express (or built-in HTTP module)
- npm
- Hosting platform (Heroku, AWS Lambda, Azure Functions, etc.)
- Frontegg SDK running in the client

##### Detailed call flow to capture
2. Developer deploys server.js to chosen platform.
3. In Frontegg environment settings, set “metadataOverrides.url” to your endpoint.
4. End user visits the Frontegg login URL → browser loads JS widget.
5. Widget calls GET /overrides → Node.js returns override JSON → browser renders customized UI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Services
    subgraph "External Services"
        Portal["Frontegg Builder / Admin Portal"]:::external
        Browser["User Browser / Frontegg Login Widget"]:::external
    end

    %% Developer Workflow
    subgraph "Developer Workflow"
        Dev["Developer"]:::external
        CICD["CI/CD Pipeline"]:::infra
    end

    %% Hosting Infrastructure
    subgraph "Hosting Infrastructure"
        Host["Hosting Platform\n(Heroku Dyno / API Gateway + Lambda)"]:::infra
        Monitor["Monitoring / Logging Service"]:::infra
    end

    %% Microservice
    Service["Node.js / Express Service\n(GET /overrides)"]:::service

    %% Project Files
    subgraph "Project Files"
        PkgJson["package.json"]:::infra
        PkgLock["package-lock.json"]:::infra
        Readme["README.md"]:::infra
        Gitignore[".gitignore"]:::infra
    end

    %% Interactions
    Dev -->|Git Push| CICD
    CICD -->|Deploy| Host
    Host -->|runs| Service
    Service -->|sends logs| Monitor

    Portal -->|Set metadataOverrides.url| Browser
    Browser -->|"GET /overrides (HTTPS)"| Service
    Service -->|"200 OK JSON"| Browser
    Browser -->|renders customized UI| Browser

    %% Click Events
    click Service "https://github.com/fxcircus/frontegg-hosted-login-customization-server/blob/main/server.js"
    click PkgJson "https://github.com/fxcircus/frontegg-hosted-login-customization-server/blob/main/package.json"
    click PkgLock "https://github.com/fxcircus/frontegg-hosted-login-customization-server/blob/main/package-lock.json"
    click Readme "https://github.com/fxcircus/frontegg-hosted-login-customization-server/blob/main/README.md"
    click Gitignore "https://github.com/fxcircus/frontegg-hosted-login-customization-server/blob/main/.gitignore"

    %% Styles
    classDef external fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef service fill:#90EE90,stroke:#333,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#333,stroke-width:1px
```
