How rolly93/border_crossing works
Project type and purpose
• This is a full-stack, desktop-wrapped web application.
• Backend: Python + Flask REST endpoints, business logic, SQLite.
• Frontend: Jinja2 HTML templates + CSS + JS, rendered inside a pywebview desktop window.
• Purpose: Let carriers generate and send XML event files (AFS, DPU, etc.) over FTP, track statuses via email, and self-update asynchronously from GitHub.
File structure
• Top level:
• app.py (entry point, launches Flask and pywebview)
• Procfile, render.yaml (deployment config)
• requirements.txt (deps)
• backend/
• db/ (SQLite config & wrapper)
• model/ (entities + ORM-like models)
• routes/ (Flask blueprints: api, auth, client, dashboard, empleado, shipment)
• utility/service/ (auth_service.py, email_service.py)
• utility/ (shipment_logic.py, xml_export.py, helpers)
• exception/ (custom exception classes)
• static/ + templates/ (UI layer: JS modules, styles, Jinja2 components)
README for additional insights
• Describes events, file formats (XML), transport (FTP), notifications (email).
• Mentions pywebview desktop wrapper and GitHub-based update checks.
Main components
a. Desktop Shell (pywebview)
b. Frontend UI Layer
– Templates (Jinja2)
– Static assets (JS, CSS)
c. Backend Application Layer
– Flask app & route handlers
d. Business Logic Layer
– ShipmentLogic, XMLExport, AuthService, EmailService
e. Data Layer
– SQLite database (logistica.db) via db/db.py
f. External Services
– FTP Server
– SMTP Server (email)
– GitHub (update checks)
Relationships and data flow
• Desktop Shell ↔ HTTP ↔ Flask Routes
• Flask Routes ↔ Business Logic
• Business Logic ↔ Data Layer (CRUD operations)
• ShipmentLogic ↔ XMLExport → FTP Server
• Business Logic ↔ EmailService → SMTP Server
• Update module (in app.py) polls GitHub → triggers desktop app update
Architectural patterns & principles
• Layered/MVC style separation:
• Models (backend/model)
• Views (templates/static)
• Controllers (Flask routes)
• Service abstractions for cross-cutting concerns (auth, email).
• Single-database, synchronous calls inside desktop wrapper.
Essential elements checklist
• Components: Desktop Shell, UI, Backend, DB, FTP, Email, GitHub
• Clear naming: e.g., ShipmentLogic, xml_export, auth_service
• Grouping and layering to reflect separation of concerns