How josuemrosario/nodefaturas works
Sistema Faturas is an Express/MVC web app for registering users, managing their clients and invoices, and viewing billing summaries. The main workflow is a signed-in user creating clients and invoices, then reviewing invoice status and totals on the dashboard. The graph includes the documented MongoDB-backed workflow and sampled authentication logic; route wiring for invoices and dashboard is represented only at the route-module level because those route sources were not sampled.
Main entry points: index.js Express app · dashboard.controller.js Dashboard summaries · fatura.controller.js Invoice management · usuario.controller.js Account logic
Components 19
Web entry
- Express app
index.js
User access
- Account routes
routes/usuario.route.js - Account logic
controllers/usuario.controller.js - Access guards
libs/middleware.js - Session state
index.js
Billing domain
- Dashboard routes
routes/dashboard.route.js - Dashboard summaries
controllers/dashboard.controller.js - Client routes
routes/cliente.route.js - Client management
controllers/cliente.controller.js - Invoice routes
routes/fatura.route.js - Invoice management
controllers/fatura.controller.js
Data and views
- User model
models/usuario.model.js - Client model
models/cliente.model.js - Invoice model
models/fatura.model.js - Mongo connection
libs/dbConnect.js - EJS pages
views - Real formatter
libs/formatter.js
Other components
- User
- MongoDB
Connections 25
- User → Express app: sends requests
- Express app → Account routes: mounts routes
- Express app → Dashboard routes: mounts routes
- Express app → Access guards: guards dashboard
- Express app → Session state: configures sessions
- Account routes → Account logic: dispatches auth
- Account routes → Access guards: checks access
- Account logic → User model: reads/writes users
- Account logic → Session state: sets user ID
- Account logic → EJS pages: renders pages
- Dashboard routes → Dashboard summaries: dispatches summaries
- Dashboard summaries → Client model: counts clients
- Dashboard summaries → Invoice model: reads invoices
- Dashboard summaries → Real formatter: formats totals
- Dashboard summaries → EJS pages: renders dashboard
- Client routes → Client management: dispatches clients
- Client management → Client model: manages clients
- Client management → Invoice model: deletes related invoices
- Client management → EJS pages: renders client pages
- Invoice routes → Invoice management: dispatches invoices
- Invoice management → Invoice model: manages invoices
- Invoice management → Client model: loads clients
- Invoice management → Real formatter: formats totals
- Invoice management → EJS pages: renders invoice pages
- Mongo connection → MongoDB: connects to