# srfrancklo0309/nexus_event architecture

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

- Interactive diagram: https://gitdiagram.com/srfrancklo0309/nexus_event
- Repository: https://github.com/srfrancklo0309/nexus_event

## Overview

##### Project Type and Purpose
– Nexus Event is a full-stack web application (static frontend + mock backend) for managing and publishing events, subscriptions, and contacts.
– Frontend: HTML5 pages, CSS (Bulma + custom), JavaScript (ES6 modules).
– Backend: JSON Server (REST API) with a simple JSON file as the data store.

##### High-Level File Structure Analysis
- Root
– index.html, app.js
– pages/*.html (login, dashboard, events, suscriptions, contacts)
– scripts/*.js (page-specific logic + bulma.js)
– api/*.js (API wrappers: API.js + user, event, subscription, contact modules)
- assets/
– css/*.css (common and per-page styles)
– db/db.json (data store for JSON Server)
– img, videos/ (media assets)
- Config
– package.json (npm scripts to launch Live Server & JSON Server)

a. Frontend (Browser)
– Static Server (Live Server @5500)
– HTML pages + CSS + JS modules (app.js, scripts/, api/)
b. API Layer (Client-side wrappers)
– api/API.js (base fetch logic)
– api/userAPI.js, eventAPI.js, suscriptionAPI.js, contactAPI.js
c. Backend (Mock Server)
– JSON Server @3000 serving REST endpoints (/users, /events, /suscriptions, /contacts)
– Data store: assets/db/db.json
d. External Services
– Google Maps (embedded in contact form)
– (Planned) Email Service for subscriptions

##### Component Relationships and Data Flows
– Browser → Live Server: GET index.html, CSS, JS modules
– JS Modules (app.js + page scripts) → API wrappers → JSON Server REST endpoints
– JSON Server → Reads/Writes assets/db/db.json → Returns JSON payloads
– Browser renders data (events grid, contact form feedback, admin dashboards)
– Browser ↔ Google Maps (script include + API calls)

##### Architectural Patterns & Principles
– Modularization: Separate API logic from UI logic (api/ vs scripts/)
– Single Responsibility: Each JS module handles one page or one resource
– Separation of Concerns: Static assets served separately, data served via REST
– Progressive Enhancement: Plain HTML pages augmented with JS modules

##### Checklist
- Grouped sub-components for pages, scripts, API modules

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend (Browser)"
        subgraph "Static Assets"
            subgraph "HTML Pages"
                idx["index.html"]:::frontend
                pageLogin["pages/login.html"]:::frontend
                pageDashboard["pages/dashboard.html"]:::frontend
                pageEvents["pages/events.html"]:::frontend
                pageSubscriptions["pages/suscriptions.html"]:::frontend
                pageContacts["pages/contacts.html"]:::frontend
            end
            subgraph "CSS Styles"
                commonCss["assets/css/common.css"]:::frontend
                indexCss["assets/css/index.css"]:::frontend
                loginCss["assets/css/login.css"]:::frontend
                dashboardCss["assets/css/dashboard.css"]:::frontend
                eventsCss["assets/css/events.css"]:::frontend
                susCss["assets/css/suscriptions.css"]:::frontend
                contactsCss["assets/css/contacts.css"]:::frontend
            end
        end
        subgraph "JS Modules"
            appJS["app.js"]:::frontend
            bulmaJS["scripts/bulma.js"]:::frontend
            loginJS["scripts/login.js"]:::frontend
            dashboardJS["scripts/dashboard.js"]:::frontend
            eventsJS["scripts/events.js"]:::frontend
            susJS["scripts/suscriptions.js"]:::frontend
        end
    end

    subgraph "API Layer (Client-side wrappers)"
        APIjs["api/API.js"]:::api
        userAPI["api/userAPI.js"]:::api
        eventAPI["api/eventAPI.js"]:::api
        susAPI["api/suscriptionAPI.js"]:::api
        contactAPI["api/contactAPI.js"]:::api
    end

    subgraph "Mock Backend"
        JSONServer["JSON Server @3000"]:::backend
        dbJSON["assets/db/db.json"]:::backend
    end

    subgraph "External Services"
        GoogleMaps["Google Maps"]:::external
        EmailService["Email Service (future)"]:::external
    end

    idx -->|"served by HTTP GET"| Static_Server["Static Server (Live Server @5500)"]:::frontend
    pageLogin --> Static_Server
    pageDashboard --> Static_Server
    pageEvents --> Static_Server
    pageSubscriptions --> Static_Server
    pageContacts --> Static_Server
    commonCss --> Static_Server
    indexCss --> Static_Server
    loginCss --> Static_Server
    dashboardCss --> Static_Server
    eventsCss --> Static_Server
    susCss --> Static_Server
    contactsCss --> Static_Server

    Static_Server -->|"loads"| appJS
    Static_Server --> bulmaJS
    Static_Server --> loginJS
    Static_Server --> dashboardJS
    Static_Server --> eventsJS
    Static_Server --> susJS

    appJS -->|"imports"| APIjs
    loginJS --> APIjs
    dashboardJS --> APIjs
    eventsJS --> APIjs
    susJS --> APIjs

    APIjs --> userAPI
    APIjs --> eventAPI
    APIjs --> susAPI
    APIjs --> contactAPI

    userAPI -->|"HTTP"| JSONServer
    eventAPI -->|"HTTP"| JSONServer
    susAPI -->|"HTTP"| JSONServer
    contactAPI -->|"HTTP"| JSONServer

    JSONServer -->|"reads/writes"| dbJSON
    HTML_Renderer["Browser Renderer"]:::frontend
    HTML_Renderer --> GoogleMaps
    appJS --> GoogleMaps

    Static_Server --> packageJSON["package.json"]:::backend

    classDef frontend fill:#ADD8E6,stroke:#000
    classDef api fill:#90EE90,stroke:#000
    classDef backend fill:#FFA500,stroke:#000
    classDef external fill:#D3D3D3,stroke:#000

    click idx "https://github.com/srfrancklo0309/nexus_event/blob/main/index.html"
    click pageLogin "https://github.com/srfrancklo0309/nexus_event/blob/main/pages/login.html"
    click pageDashboard "https://github.com/srfrancklo0309/nexus_event/blob/main/pages/dashboard.html"
    click pageEvents "https://github.com/srfrancklo0309/nexus_event/blob/main/pages/events.html"
    click pageSubscriptions "https://github.com/srfrancklo0309/nexus_event/blob/main/pages/suscriptions.html"
    click pageContacts "https://github.com/srfrancklo0309/nexus_event/blob/main/pages/contacts.html"

    click commonCss "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/css/common.css"
    click indexCss "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/css/index.css"
    click loginCss "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/css/login.css"
    click dashboardCss "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/css/dashboard.css"
    click eventsCss "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/css/events.css"
    click susCss "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/css/suscriptions.css"
    click contactsCss "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/css/contacts.css"

    click appJS "https://github.com/srfrancklo0309/nexus_event/blob/main/app.js"
    click bulmaJS "https://github.com/srfrancklo0309/nexus_event/blob/main/scripts/bulma.js"
    click loginJS "https://github.com/srfrancklo0309/nexus_event/blob/main/scripts/login.js"
    click dashboardJS "https://github.com/srfrancklo0309/nexus_event/blob/main/scripts/dashboard.js"
    click eventsJS "https://github.com/srfrancklo0309/nexus_event/blob/main/scripts/events.js"
    click susJS "https://github.com/srfrancklo0309/nexus_event/blob/main/scripts/suscriptions.js"

    click APIjs "https://github.com/srfrancklo0309/nexus_event/blob/main/api/API.js"
    click userAPI "https://github.com/srfrancklo0309/nexus_event/blob/main/api/userAPI.js"
    click eventAPI "https://github.com/srfrancklo0309/nexus_event/blob/main/api/eventAPI.js"
    click susAPI "https://github.com/srfrancklo0309/nexus_event/blob/main/api/suscriptionAPI.js"
    click contactAPI "https://github.com/srfrancklo0309/nexus_event/blob/main/api/contactAPI.js"

    click dbJSON "https://github.com/srfrancklo0309/nexus_event/blob/main/assets/db/db.json"
    click packageJSON "https://github.com/srfrancklo0309/nexus_event/blob/main/package.json"
```
