How satish-0001/project works
Project Type and Purpose
• Nextproject is a Frappe/ERPNext add-on (a full-stack plugin) that extends ERPNext’s Project module into a full PMIS.
• It lives within the Frappe framework, providing new DocTypes, server-side logic (Python), client UIs (JavaScript & Jinja templates), background schedulers, REST APIs, reports, and GitHub/ICS integrations.
File Structure Analysis
• Top-level: standard Frappe app files (setup.py, hooks.py, api.py, config/, patches/, fixtures/).
• nextproject/nextproject: core Python modules defining DocTypes, dashboards, reports, patches, print formats.
• public/: client-side JS assets.
• templates/ and www/: Jinja HTML templates for pages and public website (e.g., book_appointment).
• patches/: migration scripts run on bench update.
• fixtures/: JSON for initial custom fields/data.
• hooks.py: registration of document events, scheduled jobs, REST endpoints.
Key README Insights
• The app offers billing, resource planning, timesheets, scrum, Github integration, performance modules, risk management, reporting.
• Installable via bench; runs under Frappe’s HTTP/WSGI server, communicates with MariaDB, Redis, background worker processes.
Main Components
a. Frontend Layer
• Browser clients (ERPNext desk & public pages).
• Static assets (public/js/*.js, public/images, www/* HTML/CSS/JS).
• Jinja templates (/templates/pages, /templates/emails).
b. Backend Layer
• Frappe Framework Core (HTTP router, ORM, DocType engine, scheduler, job queue).
• ERPNext Core App (core Project module, base doctypes).
• Nextproject App modules:
• DocType definitions (nextproject/nextproject/doctype/*).
• Server scripts (Python controllers, hooks.py, api.py).
• Scheduled tasks (config/desktop.py, custom_scheduler.py).
• Patch scripts (patches/v13_0/*.py).
• Fixtures loader.
c. Data Layer
• MariaDB (tables auto-generated from DocTypes).
• Redis (cache, job queue).
• File store (for attachments, ICS generation).
d. External Integrations
• GitHub REST API (commit history, webhooks).
• Email/ICS API (SMTP or external calendar invites).
Relationships & Data Flows
• Client → HTTP(S) → Nginx/Bench → Frappe Router
• Routes to ERPNext or Nextproject REST endpoints/API (api.py) or desk views.
• Serves static JS/CSS from public/.
• Frappe → ORM → MariaDB (CRUD on DocType tables).
• Hooks → Business Logic → Reports/PDF/Print Formats.
• Scheduled Jobs (cron via bench scheduler) → run custom_scheduler.py, patches.
• Background Workers (Redis queue) → long-running tasks (email sending, billing runs).
• Nextproject → GitHub API calls (commit retrieval).
• Nextproject → ICS file creation → email dispatch.
Architectural Patterns & Principles
• MVC via Frappe’s DocType (Model), server scripts (Controller), JS/Jinja views (View).
• Plugin architecture: Nextproject registers via hooks, decoupled from core ERPNext.
• Event-driven: use of document event hooks (on_update, validate).
• Batch processing: scheduler + worker queue.
• Modular: each PMIS feature as its own DocType/report module.
Execution Steps
1. Sketch high-level layers (Client / Frappe / Data / External).
2. Within Frappe layer, show “ERPNext Core” and “Nextproject Plug-in” side by side.
3. Drill into Nextproject: sub-modules (DocTypes, Hooks, Scheduler, API, UI templates).
5. Important modules (e.g., custom_scheduler.py runs nightly billing, patches/v13_0 for migration).