How codeforpakistan/pharma-license works
This repository combines the CodeIgniter PHP framework with a pharmacy and drug-control application built on it. The main workflow is a browser request routed to an application controller, which handles authentication and domain operations through models, persists data, and renders a view. The tree documents license forms, inspections, reference data, reporting, and REST endpoints. The sampled excerpts confirm framework routing and database-query behavior, but do not show most application controller/model call sites, so those links are kept at supported architectural boundaries.
Main entry points: MY_Controller.php Application controller · Router.php Request router · REST_Controller.php REST controller · index.php Front controller
Components 22
Framework runtime
- Front controller
index.php - Framework bootstrap
system/core/CodeIgniter.php - Request router
system/core/Router.php - Application routes
application/config/routes.php
Application workflows
- Application controller
application/core/MY_Controller.php - Authentication
application/controllers/Auth.php - License forms
application/controllers/Form_8a.php - Inspections
application/controllers/Inspection.php - Registry data
application/controllers/Institute.php - Reports
application/controllers/Common.php - Application views
application/views
Persistence and output
- Domain models
application/models - Query builder
system/database/DB_query_builder.php - Application database
application/config/database.php - Database sessions
system/libraries/Session/drivers/Session_database_driver.php - SMTP email
application/core/MY_Controller.php
REST API
- REST endpoints
application/controllers/Api.php - REST controller
application/libraries/REST_Controller.php - REST settings
application/config/rest.php
Other components
- Web user
- SMTP service
- API client
Connections 22
- Web user → Front controller: sends request
- Front controller → Framework bootstrap: loads runtime
- Framework bootstrap → Request router: dispatches routing
- Request router → Application routes: loads mappings
- Request router → Application controller: selects controller
- Application controller → Authentication: handles auth
- Application controller → License forms: handles applications
- Application controller → Inspections: handles inspections
- Application controller → Registry data: maintains registry
- Application controller → Reports: serves reports
- Application controller → Domain models: uses models
- Application controller → Application views: renders pages
- Domain models → Query builder: builds queries
- Query builder → Application database: reads and writes
- Application controller → Database sessions: uses session
- Application controller → SMTP email: sends mail
- SMTP email → SMTP service: delivers email
- API client → Front controller: sends request
- Request router → REST endpoints: routes API
- REST endpoints → REST controller: extends handling
- REST controller → REST settings: reads settings
- REST controller → Application database: checks API keys