How ivan-ssa/hidropag_front works
HidroPag is a React frontend for managing branches, users, works, invoices, and invoice approvals. The user enters through login; the app checks for a stored token, then presents protected routes within a sidebar-and-header layout. Domain screens load and submit data to an external API, and branch forms also use ViaCEP to look up address details. The excerpts show several API interactions, but do not expose the full route table or all component behavior; unverified links are omitted.
Main entry points: App.jsx Routes and layout · FiliaisList.jsx Branch list · FilialForm.jsx Branch form · UsuariosList.jsx User list
Components 19
Application shell
- React entry
src/main.jsx - Routes and layout
src/App.jsx
Access and navigation
- Login
src/components/Login.jsx - Private route
src/components/PrivateRoute.jsx - Sidebar
src/components/Sidebar.jsx - Header
src/components/Header.jsx
Administration
- Branch list
src/components/FiliaisList.jsx - Branch form
src/components/FilialForm.jsx - User list
src/components/UsuariosList.jsx - User form
src/components/UsuariosCadastro.jsx - Work list
src/components/ObrasList.jsx - Work form
src/components/ObrasCadastro.jsx
Invoices and approvals
- Invoice list
src/components/NotasList.jsx - Invoice form
src/components/NotasCadastro.jsx - Approval list
src/components/AprovacoesList.jsx - Approval form
src/components/AprovacoesCadastro.jsx
Other components
- User
- HidroPag API
- ViaCEP
Connections 27
- User → React entry: opens app
src/main.jsx - React entry → Routes and layout: renders
src/main.jsx - Routes and layout → Login: routes to
src/App.jsx - Routes and layout → Private route: checks access
src/App.jsx - Routes and layout → Sidebar: renders
src/App.jsx - Routes and layout → Header: renders
src/App.jsx - Routes and layout → Branch list: routes to
src/App.jsx - Routes and layout → Branch form: routes to
src/App.jsx - Routes and layout → User list: routes to
src/App.jsx - Routes and layout → User form: routes to
src/App.jsx - Routes and layout → Work list: routes to
src/App.jsx - Routes and layout → Work form: routes to
src/App.jsx - Routes and layout → Invoice list: routes to
src/App.jsx - Routes and layout → Invoice form: routes to
src/App.jsx - Routes and layout → Approval list: routes to
src/App.jsx - Routes and layout → Approval form: routes to
src/App.jsx - Branch list → HidroPag API: fetches branches
src/components/FiliaisList.jsx - Branch list → ViaCEP: looks up address
src/components/FiliaisList.jsx - Branch form → HidroPag API: creates branch
src/components/FilialForm.jsx - Branch form → ViaCEP: looks up address
src/components/FilialForm.jsx - User list → HidroPag API: loads and updates
src/components/UsuariosList.jsx - User list → Branch list: loads branch data
src/components/UsuariosList.jsx - User form → HidroPag API: loads and creates
src/components/UsuariosCadastro.jsx - Work form → HidroPag API: loads branches; creates work
src/components/ObrasCadastro.jsx - Invoice form → HidroPag API: loads works; submits invoice
src/components/NotasCadastro.jsx - Invoice list → HidroPag API: loads and updates
src/components/NotasList.jsx - Approval list → HidroPag API: records decision
src/components/AprovacoesList.jsx