How phatnd249/tool_invoice works
Invoice Download Tool is a web application for managing taxpayer companies and retrieving their electronic invoices from Vietnam’s GDT. Users authenticate, register or sign into companies, then download invoice archives and inspect or export invoice data; schedules automate retrieval. The frontend also manages users, roles and permissions, feedback, and Google Drive backups. The graph combines explicit frontend routes and sampled backend calls with capabilities documented in the README; several backend integrations are represented at subsystem level because their implementations were not sampled.
Main entry points: App.tsx Web app routes · prisma.service.ts Application database · auth.service.ts Authentication API · invoices.controller.ts Invoice endpoints
Components 28
Web interface
- Web app routes
frontend/src/App.tsx - Auth context
frontend/src/contexts/AuthContext.tsx - Invoice screens
frontend/src/pages/invoices/InvoicesPage.tsx - Download progress
frontend/src/pages/invoices/DownloadProgress.tsx - Backup screen
frontend/src/pages/backup/BackupPage.tsx - Admin screens
frontend/src/pages/users/UsersPage.tsx
Identity and access
- Authentication API
backend/src/auth/auth.service.ts - User management
backend/src/users/users.service.ts - Permission checks
backend/src/auth/guards/permissions.guard.ts - Application database
backend/src/prisma/prisma.service.ts - Email delivery
backend/src/mail/mail.service.ts
Invoice operations
- Invoice endpoints
backend/src/invoices/invoices.controller.ts - Invoice download
backend/src/invoices/invoice-downloader.service.ts - GDT invoice query
backend/src/invoices/gdt/gdt-query-client.service.ts - Invoice persistence
backend/src/invoices/invoices-persistence.service.ts - Invoice preview
backend/src/invoices/preview.service.ts - PDF and Excel export
backend/src/invoices/excel.service.ts
Business management
- Company management
backend/src/companies/companies.controller.ts - Company operations
backend/src/companies/companies.service.ts - Download schedules
backend/src/schedules/schedules.controller.ts - Schedule runner
backend/src/schedules/scheduler.runner.ts - Feedback endpoint
backend/src/feedback/feedback.controller.ts
Backup and integrations
- Backup endpoints
backend/src/backup/backup.controller.ts - Backup orchestration
backend/src/backup/backup.service.ts - Google Drive
backend/src/backup/google-drive.service.ts
Other components
- User
- GDT services
- Gemini captcha help
Connections 30
- User → Web app routes: uses
frontend/src/App.tsx - Web app routes → Auth context: loads auth
frontend/src/App.tsx - Web app routes → Invoice screens: routes to
frontend/src/App.tsx - Web app routes → Backup screen: routes to
frontend/src/App.tsx - Web app routes → Admin screens: routes to
frontend/src/App.tsx - User → Authentication API: authenticates
README.md - Authentication API → Application database: reads and writes
backend/src/auth/auth.service.ts - Authentication API → Email delivery: sends verification
backend/src/auth/auth.service.ts - Admin screens → User management: manages users
README.md - User management → Application database: persists users
- Company management → Company operations: dispatches
backend/src/companies/companies.controller.ts - Company operations → GDT services: authenticates company
README.md - Invoice screens → Invoice endpoints: requests invoices
README.md - Invoice endpoints → Invoice download: dispatches downloads
README.md - Invoice download → GDT invoice query: queries invoices
README.md - GDT invoice query → GDT services: fetches invoice pages
backend/src/invoices/gdt/gdt-query-client.service.ts - Invoice download → Invoice persistence: stores downloads
README.md - Invoice endpoints → Invoice preview: serves previews
README.md - Invoice preview → Application database: reads invoice data
backend/src/invoices/preview.service.ts - Invoice preview → PDF and Excel export: exports invoice data
README.md - User → Download schedules: configures schedules
README.md - Schedule runner → Download schedules: executes schedules
- Download schedules → Application database: stores schedule data
README.md - Backup screen → Backup endpoints: manages backups
README.md - Backup endpoints → Backup orchestration: dispatches
backend/src/backup/backup.controller.ts - Backup endpoints → Google Drive: manages OAuth
backend/src/backup/backup.controller.ts - Backup orchestration → Google Drive: backs up to
backend/src/backup/backup.service.ts - Backup orchestration → Application database: reads backup state
backend/src/backup/backup.service.ts - Company operations → Gemini captcha help: solves captcha
README.md - User → Feedback endpoint: submits feedback
README.md