How luke2905/projeto-portaria-backend works
This is an Express backend for a gatehouse/portaria system. A client sends requests to the server, which mounts public login, transportadora, collaborator, and user routes; those handlers return JSON and use Prisma for persistence. Login verifies stored credentials and issues a JWT, while the server applies authentication middleware to user-management routes. The route excerpts also show collaborator attendance records and transportadora entry, exit, active-list, alert, and report operations. The Prisma schema is present but unsampled, so its model details are not inferred.
Main entry points: server.js Express server · public.js Login · schema.prisma Application database · UsuariosRoute.js User management
Components 10
HTTP entry
- Express server
server.js
Identity and access
- Login
routes/public.js - JWT middleware
middlewares/auth.js - User management
routes/UsuariosRoute.js
Gatehouse operations
- Collaborator records
routes/ColaboradoresRoutes.js - Transportadora records
routes/TransportadorasRoutes.js
Persistence
- Application database
prisma/schema.prisma
Other components
- HTTP client
- Password hashing
- JWT library
Connections 14
- HTTP client → Express server: sends requests
server.js - Express server → Login: mounts routes
server.js - Express server → Transportadora records: mounts routes
server.js - Express server → Collaborator records: mounts routes
server.js - Express server → JWT middleware: applies middleware
server.js - Express server → User management: mounts protected routes
server.js - Login → Application database: looks up users
routes/public.js - Login → Password hashing: checks password
routes/public.js - Login → JWT library: signs token
routes/public.js - JWT middleware → JWT library: verifies token
middlewares/auth.js - User management → Password hashing: hashes password
routes/UsuariosRoute.js - User management → Application database: creates and lists users
routes/UsuariosRoute.js - Collaborator records → Application database: reads and writes records
routes/ColaboradoresRoutes.js - Transportadora records → Application database: reads and writes records
routes/TransportadorasRoutes.js