How rickykusriana/codeigniter-api-server works
This repository is a CodeIgniter REST API example, with a small web client that fetches MetaWeather data and renders it. The API’s principal path is an HTTP request through framework dispatch to a profile endpoint, with REST request handling and response formatting; the excerpt also shows request-method parsing and database-backed rate/access checks. The tree includes CodeIgniter’s general runtime, database drivers, session handlers, and libraries. Relationships involving unsampled routes, endpoint internals, and framework services are omitted rather than inferred.
Main entry points: CodeIgniter.php Request runtime · REST_Controller.php REST controller · Client.php Weather client · index.php Front controller
Components 16
REST API
- REST configuration
application/config/rest.php - REST controller
application/modules/api/libraries/REST_Controller.php - Profile endpoint
application/modules/api/controllers/Profile.php - Response formats
application/modules/api/libraries/Format.php
Example Client
- Weather client
application/controllers/Client.php - MetaWeather API
- Weather results view
application/views/welcome_message.php
Framework Runtime
- Front controller
index.php - Request runtime
system/core/CodeIgniter.php - Core support
system/core - URI router
system/core/Router.php
Framework Services
- Database configuration
application/config/database.php - Database drivers
system/database - Session handling
system/libraries/Session - Core libraries
system/libraries
Other components
- API caller
Connections 12
- API caller → Front controller: sends request
- Front controller → Request runtime: starts runtime
index.php - Request runtime → URI router: loads router
system/core/CodeIgniter.php - Request runtime → Core support: loads core services
system/core/CodeIgniter.php - URI router → Profile endpoint: dispatches endpoint
- API caller → REST controller: uses REST API
- REST controller → REST configuration: reads settings
- REST controller → Database drivers: checks limits
application/modules/api/libraries/REST_Controller.php - Database drivers → Database configuration: uses connection settings
- Weather client → MetaWeather API: fetches weather
application/controllers/Client.php - Weather client → Weather results view: renders results
application/controllers/Client.php - Request runtime → Weather client: dispatches controller