How sebastian-acha/chatarreria-app works
This is a scrap-metal purchasing and price-management application: staff sign in, record purchases, and review transaction history and daily reports; administrators also manage metals, branches, users, settings, and published prices. The React dashboard calls an Express API, whose controllers use PostgreSQL. A separate WordPress price plugin is present, but the sampled files do not show its connection to the API, so that relationship is left unverified. The README is empty; the map uses the source index and excerpts, and omits uncertain wiring for unsampled features.
Main entry points: axios.js API client · Dashboard.jsx Dashboard · App.jsx App routing · index.js API server
Components 26
Web client
- App routing
frontend/src/App.jsx - Sign in
frontend/src/components/Login.jsx - Dashboard
frontend/src/components/Dashboard.jsx - New purchase
frontend/src/components/NuevaCompra.jsx - Transaction history
frontend/src/components/HistorialTransacciones.jsx - Daily report
frontend/src/components/ReporteDiario.jsx - Metal management
frontend/src/components/GestionMetales.jsx - Branch management
frontend/src/components/GestionSucursales.jsx - User management
frontend/src/components/GestionUsuarios.jsx - Configuration
frontend/src/components/Configuracion.jsx - Web prices
frontend/src/components/PreciosWeb.jsx - API client
frontend/src/api/axios.js - Settings context
frontend/src/context/ConfiguracionContext.jsx
API and access
- API server
backend/index.js - Auth routes
backend/routes/authRoutes.js - Transaction routes
backend/routes/transaccionRoutes.js - Web price routes
backend/routes/precioWebRoutes.js - Authentication
backend/controllers/authController.js - Token validation
backend/middleware/authMiddleware.js - Admin authorization
backend/middleware/adminMiddleware.js - PostgreSQL
backend/config/db.js
Purchasing and reporting
- Transactions and reports
backend/controllers/transaccionController.js
Business administration
- Published prices
backend/controllers/precioWebController.js - Business data controllers
backend/controllers
Other components
- Staff
- WordPress price plugin
wp/metal-prices/metal-prices.php
Connections 37
- Staff → App routing: opens
frontend/src/App.jsx - App routing → Sign in: routes to
frontend/src/App.jsx - App routing → Dashboard: routes to
frontend/src/App.jsx - Dashboard → New purchase: renders
frontend/src/components/Dashboard.jsx - Dashboard → Transaction history: renders
frontend/src/components/Dashboard.jsx - Dashboard → Daily report: renders
frontend/src/components/Dashboard.jsx - Dashboard → Metal management: renders
frontend/src/components/Dashboard.jsx - Dashboard → Branch management: renders
frontend/src/components/Dashboard.jsx - Dashboard → User management: renders
frontend/src/components/Dashboard.jsx - Dashboard → Configuration: renders
frontend/src/components/Dashboard.jsx - Dashboard → Web prices: renders
frontend/src/components/Dashboard.jsx - App routing → Settings context: provides settings
frontend/src/App.jsx - Sign in → API client: calls
frontend/src/components/Login.jsx - New purchase → API client: calls
frontend/src/components/NuevaCompra.jsx - Transaction history → API client: calls
frontend/src/components/HistorialTransacciones.jsx - Daily report → API client: calls
- Metal management → API client: calls
frontend/src/components/GestionMetales.jsx - Configuration → API client: calls
frontend/src/components/Configuracion.jsx - Branch management → API client: calls
- User management → API client: calls
- Web prices → API client: calls
- Settings context → API client: fetches settings
frontend/src/context/ConfiguracionContext.jsx - API client → API server: sends API requests
- API server → Auth routes: mounts
backend/index.js - API server → Transaction routes: mounts
backend/index.js - API server → Web price routes: mounts
backend/index.js - Auth routes → Authentication: dispatches
backend/routes/authRoutes.js - Transaction routes → Token validation: validates token
backend/routes/transaccionRoutes.js - Transaction routes → Transactions and reports: dispatches
backend/routes/transaccionRoutes.js - Web price routes → Token validation: guards admin routes
backend/routes/precioWebRoutes.js - Web price routes → Admin authorization: guards admin routes
backend/routes/precioWebRoutes.js - Web price routes → Published prices: dispatches
backend/routes/precioWebRoutes.js - Authentication → PostgreSQL: queries
backend/controllers/authController.js - Transactions and reports → PostgreSQL: queries and writes
backend/controllers/transaccionController.js - Published prices → PostgreSQL: queries and writes
backend/controllers/precioWebController.js - Business data controllers → PostgreSQL: uses
backend/controllers/transaccionController.js - WordPress price plugin → Published prices: may consume prices