How joaoliveira6704/voltaic-app works
1. Repository shape
- This is a monorepo with three main runtime areas: frontend/ (Nuxt app), api/ (Node backend), and data-gen/ (Python data generator).
- compose.yaml and per-service Dockerfiles indicate the system is meant to run as multiple containers with clear service boundaries.
2. Frontend boundary
- The frontend/ package is a Nuxt-based UI focused on user-facing screens.
- The visible pages are mostly authentication and onboarding: login, signup, recover-password, plus a landing page.
- UI is built from reusable components under app/components/ui/* and landing-page/*, with Tailwind CSS providing styling.
3. Frontend role in the system
- The frontend appears to be the presentation layer only: it renders forms and views, but the repo structure does not show any backend logic there.
- Its main data dependency is the API; architecture-wise it should be drawn as a client consuming backend endpoints rather than owning business logic.
4. Backend entry points
- The api/ service has server.js and app.js, which are the Node application bootstrap points.
- The presence of package.json, bun.lock, and Dockerfile suggests the backend can run in a Node/Bun-oriented runtime.
5. API structure
- The backend is organized in a classic controller / route / model layout:
- src/routes/* exposes HTTP endpoints
- src/controllers/* handles request logic
- src/models/* defines the domain entities
- This is a strong indicator of a layered REST API rather than a monolithic server-rendered app.
6. Domain subsystems
- The main backend domains are:
- auth for login/session flows
- users
- companies
- stations
- tickets
- logs
- These are separate vertical slices, likely mapped to distinct API resource groups and corresponding database collections/tables.
7. Request/data flow
- Typical flow is: frontend UI → route → controller → model/db service → response.
- src/middleware/authMiddleware.js sits in front of protected routes, while src/middleware/errorHandler.js centralizes failure handling.
- src/services/db.service.js is the key persistence boundary; it likely abstracts the actual database connection and query operations away from controllers.
8. Session and audit behavior
- UserSessions.js indicates the backend tracks active sessions or login state rather than relying on stateless auth alone.
- Logs.js suggests an audit trail / activity log subsystem, which is important for tracing user or system actions across tickets, stations, and company operations.
9. Data bootstrap / ingestion
- api/src/data/dataInjection.js and api/src/data/userTest.json suggest the API includes seed or import logic for test/demo data.
- data-gen/ is a separate Python toolchain with main.py and users.csv, likely used to generate or transform user data before importing it into the API/database layer.
10. Infrastructure and deployment
- The repo is container-ready:
- api/Dockerfile
- data-gen/Dockerfile
- compose.yaml
- For an architecture diagram, show these as deployable services coordinated by Compose, with the frontend, API, and data-generation pipeline separated by runtime boundary.
11. Important architectural boundary
- The cleanest system boundary is between presentation (frontend) and business/data services (api).
- A second boundary exists between runtime application code and offline data generation/seeding (data-gen + api/src/data), which should be shown as an auxiliary pipeline rather than part of request handling.
12. What to emphasize in a diagram
- Draw the frontend as the user entry point.
- Draw the API as the central business layer with modules for auth, users, companies, stations, tickets, and logs.
- Draw persistence behind db.service.js and the models.
- Draw data-gen and dataInjection as supporting ingestion/seed tooling, not live request handlers.
Main entry points: app Nuxt app · routes Routes · compose.yaml Compose stack · app.js App setup
Components 16
Frontend
Nuxt presentation layer
- Nuxt app · Presentation layer and routed screens
frontend/app - Auth pages · Landing, login, signup, and recovery views
frontend/app/pages - UI kit · Reusable landing and form components
frontend/app/components - Tailwind · Utility CSS theme and styling layer
frontend/app/assets/css/tailwind.css
API
Node backend and domain modules
- API entry · Application bootstrap and server startup
api/server.js - App setup · Backend composition and middleware wiring
api/app.js - Routes · HTTP endpoint definitions for each domain
api/src/routes - Controllers · Per-domain request handling and orchestration
api/src/controllers - Models · Persistent entities and collections
api/src/models - DB service · Shared database access and query abstraction
api/src/services/db.service.js - Middleware · Auth and centralized error handling
api/src/middleware - Domain modules · Auth, users, companies, stations, tickets, and logs
api/src/controllers/authController.js - Seed data · Built-in test data injection and fixtures
api/src/data/dataInjection.js
Data tooling
Offline generation and seed/import helpers
- Data gen · Offline user-data generation pipeline
data-gen/main.py
Deployment
Containerized multi-service runtime
- Compose stack · Multi-container orchestration for the services
compose.yaml
Other components
- Users · End users of the app
Connections 19
- Users → Nuxt app: uses · Users interact with the UI
- Nuxt app → Auth pages: renders · Routes page-level auth and landing views
- Nuxt app → UI kit: composes · Pages are built from shared UI components
- Nuxt app → Tailwind: styles with · Tailwind provides presentation styling
- Nuxt app → Routes: calls · UI consumes backend endpoints
- API entry → App setup: starts · Server bootstraps the application
- App setup → Routes: mounts · App wires in HTTP routes
- App setup → Middleware: applies · Auth and error handling are registered globally
- Routes → Controllers: dispatches to · Routes delegate request handling
- Controllers → Domain modules: implements · Controllers cover the main business domains
- Domain modules → Models: reads/writes · Domain logic operates on persistent entities
- Models → DB service: uses · Models rely on shared persistence access
- Controllers → DB service: queries · Controllers may coordinate database operations through the service layer
- Middleware → Routes: guards · Protected routes run through auth middleware
- Seed data → DB service: loads · Seed and import code populates the datastore
- Data gen → Seed data: feeds · Generated data is prepared for API import
- Compose stack → Nuxt app: runs · Compose starts the frontend container
- Compose stack → API entry: runs · Compose starts the API container
- Compose stack → Data gen: runs · Compose can include the data-generation container