How babar88sgd/hr_vfg works
Project type and purpose
• This is a Frappe/ERPNext “app” (Python package) named hr_vfg that plugs into the Frappe framework to provide a full HR management module (“HR VentureForce Global”).
• It defines custom DocTypes (models), client-side scripts (JS), server‐side controllers (Python), report generators, event hooks, templates, and integration connectors (e.g. attendance machines, e-mail).
Main components
• Frappe Application Server (Python + WSGI)
• HTTP request router, ORM, scheduler, background workers
• Frappe Web Frontend (JS, HTML templates, Jinja)
• Browser‐based UI, form views, list views, reports
• hr_vfg App Module
• hooks.py – event hooks, scheduler tasks
• hr_ventureforce_global – customizations
– custom/*.json – custom data fixtures
– doctype/* – DocType definitions (JSON), Python controllers, JS client scripts, tests
– report/* – report definitions (JSON), Python report scripts, JS frontends, HTML templates
– workspace/ – workspace definitions
– override scripts (*_override.py)
• templates/ – page templates
• www/ – website pages
• Database (MariaDB/MySQL)
• Cache / Queue (Redis)
• External Services
• Attendance machine APIs (via attendance_connector.py)
• SMTP email server (via Frappe mail integration)
Relationships & data flows
• Browser ↔ HTTP ↔ Frappe Server
• User actions (forms, report requests) go to the server
• Frappe Server ↔ DB
• Reads/Writes DocType tables defined by hr_vfg
• Frappe Scheduler & Workers ↔ hr_vfg hooks
• Periodic tasks (attendance backups, report generation)
• Event hooks trigger on document events
• Frappe Server ↔ Redis
• Job queue for background processing
• hr_vfg ↔ External Attendance Machine
• Poll or push data via connector
• hr_vfg ↔ SMTP
• Send notifications, payslip emails
Architectural patterns & design principles
• Modular plugin architecture: hr_vfg sits on top of Frappe core via hooks.py.
• Model‐View‐Controller (via DocType JSON = model; Python & JS controllers; Jinja/UI views).
• Event-driven: custom logic tied to document lifecycle events and scheduler.
• Separation of concerns:
• Data (DocType JSON + database)
• Business logic (Python controllers, schedulers)
• Presentation (JS, HTML templates)