# gonzalo002855/nexax-solicitudes architecture

> Architecture diagram of the GitHub repository gonzalo002855/nexax-solicitudes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gonzalo002855/nexax-solicitudes
- Repository: https://github.com/gonzalo002855/nexax-solicitudes

## Overview

1. **Overall shape**
   - This is a small Vercel-deployed application with two major parts: static frontend pages under `public/` and a single serverless API function under `api/`.
   - The app is centered on collecting “submissions” through a form and then reviewing them in admin/view pages.

2. **Frontend delivery boundary**
   - `public/index.html` is the main public entry point for users submitting requests.
   - `public/admin.html` is a protected browser-side admin interface.
   - `public/view.html` is a read-only detail view for an individual submission.
   - These are served as static assets, not rendered by a backend framework.

3. **API boundary**
   - `api/submissions.js` is the only backend execution unit.
   - It exposes the submissions endpoint used by the browser to create new entries and list existing entries.
   - Because it is under `api/`, Vercel treats it as a serverless function rather than a long-running server.

4. **Data flow: submission creation**
   - The main form in `index.html` sends form data to `/api/submissions` with a `POST`.
   - The API function validates/transforms the incoming payload, assigns an identifier, and persists it.
   - The user-facing result is then available to the admin and view pages.

5. **Data flow: submission retrieval**
   - `admin.html` and `view.html` read submission data from the same API.
   - The admin page likely loads the full collection for overview/statistics.
   - The view page likely loads one record by ID from the query string (`view.html?id=...`).

6. **Storage model**
   - The repository uses `public/submissions.json` as local JSON storage for submissions.
   - This is a file-based persistence layer, which is simple but not a durable multi-instance database.
   - Architecturally, this means the API is stateful through filesystem writes, even though the runtime is serverless.

7. **Administrative subsystem**
   - `admin.html` contains client-side credential checking with hardcoded admin credentials.
   - It functions as a lightweight access gate rather than real authentication.
   - The admin UI provides a list of submissions, summary stats, and direct links into the view page.

8. **Read-only viewer subsystem**
   - `view.html` is isolated from editing workflow and serves as a presentation layer for a single submission.
   - It depends on the same submission data source but does not appear to mutate state.
   - This keeps inspection separate from creation and administration.

9. **Deployment/runtime model**
   - `vercel.json` configures routing and deployment behavior for Vercel.
   - `npm run dev` is intended to run the project locally through Vercel’s dev environment.
   - There is no separate app server; request handling is split between static hosting and serverless function execution.

10. **External dependencies and operational constraints**
   - `package.json` and `package-lock.json` indicate a Node.js-based deployment/runtime.
   - The architecture is intentionally minimal, but the README notes that email sending is simulated and that a real database is recommended for production.
   - The main operational limitation is that file-based JSON storage and client-side admin auth are suitable only for lightweight or demo use.

11. **Key architectural boundary to diagram**
   - Draw a clear split between browser pages (`index.html`, `admin.html`, `view.html`) and the backend function (`api/submissions.js`).
   - Show the API writing to/reading from `public/submissions.json`.
   - Show `admin.html` and `view.html` as consumers of the same submission data, with `index.html` as the primary producer.

12. **In short**
   - This repository is a small submission-collection system: static frontend pages + one Vercel serverless API + JSON-file persistence.
   - Its design is optimized for simple deployment and low complexity, not for strong authentication or scalable storage.

Main entry points: [`vercel.json`](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/vercel.json) (Vercel config), [`api/submissions.js`](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/api/submissions.js) (Submissions API), [`public/admin.html`](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/admin.html) (Admin panel), [`README.md`](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/README.md) (Project notes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser UI"]
  node_index["Submit form<br/>static page<br/>[index.html]"]
  node_admin["Admin panel<br/>static page<br/>[admin.html]"]
  node_view["Detail view<br/>static page<br/>[view.html]"]
end

subgraph group_backend["Serverless API"]
  node_api_submissions["Submissions API<br/>serverless fn<br/>[submissions.js]"]
end

subgraph group_storage["File Storage"]
  node_submission_json[("Submissions data<br/>json store<br/>[submissions.json]")]
end

subgraph group_deploy["Deployment"]
  node_vercel_config["Vercel config<br/>routing config<br/>[vercel.json]"]
  node_package_meta["Node package<br/>runtime config<br/>[package.json]"]
  node_readme["Project notes<br/>documentation<br/>[README.md]"]
end

node_index -->|"POST /api/submissions"| node_api_submissions
node_admin -->|"list submissions"| node_api_submissions
node_view -->|"load by id"| node_api_submissions
node_api_submissions -->|"read/write"| node_submission_json
node_admin -->|"open record"| node_view
node_vercel_config -->|"routes function"| node_api_submissions
node_vercel_config -->|"serve static"| node_index
node_vercel_config -->|"serve static"| node_admin
node_vercel_config -->|"serve static"| node_view
node_package_meta -.->|"dev/runtime"| node_vercel_config
node_readme -.->|"describes"| node_index
node_readme -.->|"describes"| node_admin
node_readme -.->|"notes storage"| node_submission_json

click node_index "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/index.html"
click node_admin "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/admin.html"
click node_view "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/view.html"
click node_api_submissions "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/api/submissions.js"
click node_submission_json "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/submissions.json"
click node_vercel_config "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/vercel.json"
click node_package_meta "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/package.json"
click node_readme "https://github.com/gonzalo002855/nexax-solicitudes/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_index,node_admin,node_view toneBlue
class node_api_submissions toneAmber
class node_submission_json toneMint
class node_vercel_config,node_package_meta,node_readme toneRose
```

## Components

### Browser UI

Static pages served directly to the browser.

- [Submit form](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/index.html): static page · Main public entry point for creating submissions. · `public/index.html`
- [Admin panel](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/admin.html): static page · Browser-side admin interface with lightweight access gate. · `public/admin.html`
- [Detail view](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/view.html): static page · Read-only page for inspecting one submission. · `public/view.html`

### Serverless API

Vercel function that handles submission data.

- [Submissions API](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/api/submissions.js): serverless fn · Single backend endpoint for creating and listing submissions. · `api/submissions.js`

### File Storage

JSON-backed persistence used by the API.

- [Submissions data](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/public/submissions.json): json store · File-based persistence for submission records. · `public/submissions.json`

### Deployment

Project and routing configuration for Vercel/Node.

- [Vercel config](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/vercel.json): routing config · Deployment and routing behavior for Vercel. · `vercel.json`
- [Node package](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/package.json): runtime config · Node.js project metadata and scripts for local and deployed execution. · `package.json`
- [Project notes](https://github.com/gonzalo002855/nexax-solicitudes/blob/main/README.md): documentation · Explains the app purpose, limitations, and setup. · `README.md`

## Connections

- Submit form → Submissions API: POST /api/submissions · Creates a new submission from the public form.
- Admin panel → Submissions API: list submissions · Loads the submission collection for admin review.
- Detail view → Submissions API: load by id · Fetches a single submission for display.
- Submissions API → Submissions data: read/write · Persists and retrieves submission records.
- Admin panel → Detail view: open record · Links from the admin list into the read-only detail page.
- Vercel config → Submissions API: routes function · Maps API requests to the serverless handler.
- Vercel config → Submit form: serve static · Serves the public pages as static assets.
- Vercel config → Admin panel: serve static · Serves the admin page as static asset.
- Vercel config → Detail view: serve static · Serves the detail view as static asset.
- Node package → Vercel config: dev/runtime · Supports local and deployment execution through Node/Vercel tooling.
- Project notes → Submit form: describes · Documents the public submission flow.
- Project notes → Admin panel: describes · Documents the admin workflow and constraints.
- Project notes → Submissions data: notes storage · Explains the file-based persistence model.
