How aloxvim/gestion-gastos works
Gestión de Gastos is a personal-finance application with a React web client, PHP REST backend, MySQL persistence, and a Telegram bot client. Users authenticate (including optional email 2FA), manage accounts and income, expenses, and transfers, then review balances, history, and AI-assisted analysis. Administrators manage users and audit-related functions. The README documents the major capabilities and the bot’s API integration; edges between unsampled feature pages and backend routes are omitted where source excerpts do not establish the specific calls.
Main entry points: index.php REST API router · App.jsx Web routes · api_client.py Bot API client · bot.py Bot dispatcher
Components 34
Web application
- Web routes
frontend/src/App.jsx - Web authentication
frontend/src/contexts/AuthContext.jsx - Web API client
frontend/src/services/api.js - Accounts
frontend/src/pages/AccountsPage.jsx - Movements
frontend/src/pages/MovementsPage.jsx - Dashboard
frontend/src/pages/DashboardPage.jsx - AI analysis page
frontend/src/pages/AnalysisPage.jsx - Settings
frontend/src/pages/SettingsPage.jsx - Administration
frontend/src/pages/AdminPage.jsx - Common controls
frontend/src/components/common/Button.jsx - Input control
frontend/src/components/common/Input.jsx
Backend services
- REST API router
backend/public/api/index.php - Authentication
backend/app/controllers/AuthController.php - User services
backend/app/controllers/UserController.php - Account services
backend/app/controllers/AccountController.php - Movement services
backend/app/controllers/MovementController.php - Analysis services
backend/app/controllers/AnalysisController.php - Admin services
backend/app/controllers/AdminController.php - Tag services
backend/app/controllers/TagController.php
Finance domain
- Account domain
backend/app/models/Cuenta.php - Movement domain
backend/app/models/Movimiento.php - Tag domain
backend/app/models/Etiqueta.php - User domain
backend/app/models/Usuario.php - Session domain
backend/app/models/Sesion.php - AI configuration
backend/app/models/ConfiguracionIA.php
Telegram bot
- Bot dispatcher
telegram_bot/bot.py - Bot authentication
telegram_bot/handlers/auth_handlers.py - Bot queries
telegram_bot/handlers/query_handlers.py - Bot movements
telegram_bot/handlers/movement_handlers.py - Bot transfers
telegram_bot/handlers/transfer_handlers.py - Bot sessions
telegram_bot/services/session_manager.py - Bot API client
telegram_bot/services/api_client.py
Other components
- User
- Telegram user
Connections 48
- User → Web routes: uses
- Web routes → Web authentication: reads auth
frontend/src/App.jsx - Web routes → Accounts: routes to
frontend/src/App.jsx - Web routes → Movements: routes to
frontend/src/App.jsx - Web routes → Dashboard: routes to
frontend/src/App.jsx - Web routes → AI analysis page: routes to
frontend/src/App.jsx - Web routes → Settings: routes to
frontend/src/App.jsx - Web routes → Administration: routes to
frontend/src/App.jsx - Web authentication → Web API client: calls
frontend/src/contexts/AuthContext.jsx - Accounts → Web API client: calls
frontend/src/pages/AccountsPage.jsx - Settings → Web API client: calls
frontend/src/pages/SettingsPage.jsx - Accounts → Common controls: renders
frontend/src/pages/AccountsPage.jsx - Accounts → Input control: renders
frontend/src/pages/AccountsPage.jsx - Settings → Common controls: renders
frontend/src/pages/SettingsPage.jsx - Settings → Input control: renders
frontend/src/pages/SettingsPage.jsx - Web API client → REST API router: HTTP requests
- Telegram user → Bot dispatcher: messages
- Bot dispatcher → Bot authentication: dispatches
telegram_bot/bot.py - Bot dispatcher → Bot queries: dispatches
telegram_bot/bot.py - Bot dispatcher → Bot movements: dispatches
telegram_bot/bot.py - Bot dispatcher → Bot transfers: dispatches
telegram_bot/bot.py - Bot authentication → Bot sessions: creates session
telegram_bot/handlers/auth_handlers.py - Bot queries → Bot sessions: checks session
telegram_bot/handlers/query_handlers.py - Bot movements → Bot sessions: uses session
telegram_bot/handlers/movement_handlers.py - Bot transfers → Bot sessions: uses session
telegram_bot/handlers/transfer_handlers.py - Bot sessions → Bot API client: creates client
telegram_bot/services/session_manager.py - Bot authentication → Bot API client: authenticates
telegram_bot/handlers/auth_handlers.py - Bot queries → Bot API client: queries
telegram_bot/handlers/query_handlers.py - Bot movements → Bot API client: submits actions
telegram_bot/handlers/movement_handlers.py - Bot transfers → Bot API client: submits transfers
telegram_bot/handlers/transfer_handlers.py - Bot API client → REST API router: HTTP requests
- REST API router → Authentication: routes to
backend/public/api/index.php - REST API router → User services: routes to
backend/public/api/index.php - REST API router → Account services: routes to
backend/public/api/index.php - REST API router → Movement services: routes to
backend/public/api/index.php - REST API router → Analysis services: routes to
backend/public/api/index.php - REST API router → Admin services: routes to
backend/public/api/index.php - REST API router → Tag services: routes to
backend/public/api/index.php - Authentication → User domain: uses
backend/app/controllers/AuthController.php - Authentication → Session domain: uses
backend/app/controllers/AuthController.php - User services → User domain: uses
backend/app/controllers/UserController.php - User services → Session domain: uses
backend/app/controllers/UserController.php - User services → Account domain: uses
backend/app/controllers/UserController.php - Account services → Account domain: uses
backend/app/controllers/AccountController.php - Account services → Tag domain: uses
backend/app/controllers/AccountController.php - Movement services → Movement domain: uses
backend/app/controllers/MovementController.php - Movement services → Account domain: validates accounts
backend/app/controllers/MovementController.php - Analysis services → Movement domain: loads analysis data
backend/app/controllers/AnalysisController.php