How gonzalo002855/nexax-solicitudes works
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 Vercel config · submissions.js Submissions API · admin.html Admin panel · README.md Project notes
Components 8
Browser UI
Static pages served directly to the browser.
- Submit form · Main public entry point for creating submissions.
public/index.html - Admin panel · Browser-side admin interface with lightweight access gate.
public/admin.html - Detail view · Read-only page for inspecting one submission.
public/view.html
Serverless API
Vercel function that handles submission data.
- Submissions API · Single backend endpoint for creating and listing submissions.
api/submissions.js
File Storage
JSON-backed persistence used by the API.
- Submissions data · File-based persistence for submission records.
public/submissions.json
Deployment
Project and routing configuration for Vercel/Node.
- Vercel config · Deployment and routing behavior for Vercel.
vercel.json - Node package · Node.js project metadata and scripts for local and deployed execution.
package.json - Project notes · Explains the app purpose, limitations, and setup.
README.md
Connections 13
- 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.