How arus-info/projectit works
Project type and purpose
• ProjectIT is a full-stack solution consisting of:
– A Vue-based Progressive Web App (PWA) front end under the “mobile/” folder
– A Frappe Framework Python back end (the “projectit/” Python package) integrated with ERPNext and Frappe HR
– A MariaDB (or compatible) database managed by Frappe
• Purpose: Track field employees’ check-ins, GPS, photos, timesheets and send real-time instructions.
Main components
A. Mobile PWA (Frontend)
– Built with Vue 3, Vite, Tailwind CSS
– Service Worker (mobile/public/sw.js) for offline support
– Core pages (mobile/src/pages/*), components and composables for:
• Authentication (Login.vue)
• Check-In/Out, Camera.vue, GPS
• TimesheetEntry.vue, WorkInstructions.vue, etc.
B. Frappe Backend (ERPNext App)
– Python modules under projectit/ (api.py, hooks.py, doctype definitions)
– Doctypes: employee_allocation_instruction, mobile_module, work_time_settings, etc.
– REST HTTP API endpoints auto-exposed by Frappe + any custom API in api.py
– Fixtures and patches for initial data (projectit/fixtures)
C. ERPNext & Frappe HR
– Existing ERPNext Project and HR modules that this app extends
– Schema linkages between ProjectIT doctypes and ERPNext doctypes
D. Database
– MariaDB (or similar) where Frappe stores doctypes, user sessions, attachments
E. External browser APIs
– Geolocation API
– Camera/File API for photos
F. Network & Security
– HTTPS channel between PWA and Frappe server
– Authentication via Frappe session tokens or JWT
Relationships and data flows
• On app launch, the PWA checks for service worker updates → auth flow via Frappe HTTP API → session cookie/token
• User actions (e.g., Check-In) invoke Vue composable → send JSON payload (GPS, photo) to Frappe API
• Frappe controller (doctype Python code or api.py) validates and writes to MariaDB
• Real-time status updates: PWA polls or uses Frappe real-time events (socket) → updates UI
• Project managers view instructions/allocations via PWA pages backed by Frappe REST endpoints
Architectural patterns and design principles
– MVC in Frappe:
• Model = Doctypes (+ JSON schemas under projectit/projectit/doctype)
• View = Jinja templates (projectit/templates/pages) & PWA UI
• Controller = Python API endpoints (api.py, hooks.py)
– PWA pattern: service worker, web manifest (handled in index.html), offline caching
– Separation of concerns: UI in “mobile/”, business logic and data access in Frappe app
– Extensibility via Frappe hooks and fixtures
Essential elements
• Notes for service-worker caching strategy