How tikajhq/tiket works
1. Overall shape
This is a PHP 7.x helpdesk application built on CodeIgniter, with a custom in-house layer called “Scone” on top of the framework. It follows a classic server-rendered MVC architecture: HTTP requests enter index.php, route through CodeIgniter, hit controllers, which coordinate models and render views.
2. Main user-facing domains
The application is organized around four core business areas:
- Authentication / access control
- Ticketing / thread conversations
- User management and KYC/profile data
- SMS / notification handling
The README confirms the key product behavior: separate roles for Admin, Agent, and User; ticket creation/reply by email; attachments; and dashboard reporting.
3. Role and boundary model
Role separation is a major architectural boundary. Admin and agent workflows are distinct from end-user workflows, and the views reflect that split:
- views/admin/* for operational and reporting screens
- views/user/* for customer/user self-service
- views/auth/* for login, OTP, password reset, etc.
- views/limited and views/deactivated for restricted access states
This suggests authorization is enforced both at controller level and in the layout/menu layer.
4. Controller layer
Controllers are grouped by responsibility:
- Auth, User, Tickets, Sms, Tabler are the main web controllers
- controllers/API/* exposes programmatic endpoints
- controllers/API/sms/Sms.php indicates a dedicated SMS API surface
- controllers/API/Pub.php, Ticket.php, User.php suggest API access to public or external integrations
The controllers are the orchestration layer: they read request input, apply auth rules, invoke models, and select the appropriate view or API response.
5. Model layer and domain decomposition
Models are split into domain-oriented folders:
- models/user/* for auth, profile, bank, documents, KYC, locations, FA2/2FA, flow logic
- models/ticket/* for tickets, messages, and threads
- models/notification/* for email and SMS notifications
- models/sms/* for SMS-specific user and sender/provider logic
- models/storage/Storage_model.php for file/asset persistence
- models/language/Language_model.php and models/core/* for shared platform services
This is the main business logic boundary. Ticketing, identity/KYC, notifications, and storage are clearly separated rather than being lumped into generic CRUD models.
6. Core framework extensions
The repository includes custom framework extensions in application/core:
- MY_Controller.php
- MY_Model.php
These are the shared base classes used to standardize behavior across the app, likely adding common auth/session handling, helper loading, response formatting, and model utilities.
7. Shared platform services
The models/core folder contains reusable service-style components:
- Session_model, Token_model for session and token handling
- Settings_model for app configuration stored in the database
- Template_model and QuickTemplate for rendering/view composition
- DataHandler and Utils for common data transformations
- BaseApi_model for shared API mechanics
This indicates the app has a platform layer beneath the feature models, handling cross-cutting concerns like sessions, tokens, template rendering, and utility work.
8. Ticket lifecycle and conversation flow
Ticketing is the central business workflow. The ticket models separate:
- ticket records
- message history
- thread handling
Views like ticket/create_new, ticket/view_ticket, ticket/list, ticket/my_tickets, and ticket/close_ticket show the user journey. The README’s “reply to ticket thread by replying on associated email thread” feature implies a bi-directional flow between email and ticket threads, with the system mapping incoming mail back into ticket messages.
9. Notification and integration flow
Notifications are first-class subsystems:
- notification/Email_model.php
- notification/Sms_model.php
- SMS controller/API endpoints
- README mentions automatic ticket creation from email
The architecture likely uses email as both an outbound notification channel and an inbound ticket-ingestion channel. SMS appears to be another outbound notification and operational channel, with dedicated views for sending and inspecting SMS activity.
10. Authentication, security, and identity
Authentication is not just login/password; the repository includes:
- OTP login flow in views/auth/otp.php
- password reset and forgot password screens
- FA2Auth_model.php for second-factor support
- Token_model for token-based security actions
- permissions constants in configuration
This suggests the app enforces a fairly rich identity boundary with multi-step login and privileged operations.
11. Storage and attachments
Attachments are an explicit feature, and the repo has a storage model plus upload-capable CodeIgniter infrastructure. File handling is therefore a distinct subsystem, likely used by ticket attachments, user documents, and KYC uploads. The Documents_model, Storage_model, and various ticket/user views point to shared document persistence across domains.
12. Rendering and templating
The app is primarily server-rendered with PHP views, but it also includes a bundled Mustache library under application/libraries/mustache. There are also template-related models and shared view helpers. This indicates mixed presentation support: standard CodeIgniter views for most pages, with templated rendering available for email/notifications or dynamic content generation.
13. Database and persistence
Persistence is MySQL-oriented by default, configured through application/config/database.php, with a demo SQL dump in tiket_demo.sql. The repository includes a full CodeIgniter database layer and common cache/session drivers, so the app can persist application state in the DB and potentially use file/memcached/redis-backed session/cache mechanisms depending on configuration.
14. Frontend assets and admin UI
assets/ contains a substantial prebuilt frontend stack: CSS themes, jQuery-based scripts, charts, datatables, select2, date pickers, rich text/UI plugins, and fullcalendar. This is an admin-heavy interface with dashboards, reports, forms, and interactive tables. The frontend is bundled as static assets served by the PHP app, not as a separate SPA.
15. Deployment and environment boundaries
The project expects a traditional PHP deployment with a web server or built-in PHP server, .htaccess rewrite support, and a configurable client/product settings split:
- application/config/client.config.sample.php for environment-specific integration details
- application/config/config.product.php for product naming/branding
- composer.json for PHP dependency installation
External services that materially affect architecture are email, SMS, and the relational database; the rest of the application is self-contained within the CodeIgniter runtime.
Main entry points: MY_Controller.php MY_Controller · app.js Assets · CodeIgniter.php CodeIgniter · Auth_model.php Identity
Components 25
Framework
CodeIgniter core plus app-specific base classes and shared helpers.
- index.php · Entry point that boots the application and hands requests to CodeIgniter.
index.php - CodeIgniter · The underlying MVC framework runtime, router, loader, session, database, and HTTP handling.
system/core/CodeIgniter.php - MY_Controller · Project-specific controller base class for shared request, auth, and rendering behavior.
application/core/MY_Controller.php - MY_Model · Project-specific model base class for shared data access behavior.
application/core/MY_Model.php - Helpers · Common helper functions used across controllers, views, and models.
application/helpers/core_helper.php - Templates · Shared template composition and quick rendering support.
application/models/core/Template_model.php - Mustache · Bundled Mustache renderer for template-driven output such as messages or emails.
application/libraries/mustache/src/Mustache/Engine.php
Domain
Feature controllers and models for auth, users, tickets, notifications, storage, and SMS.
- Auth · Login, OTP, password reset, and access-control entry points.
application/controllers/Auth.php - User · User profile, dashboard, and account management orchestration.
application/controllers/User.php - Tickets · Ticket creation, listing, viewing, and lifecycle actions.
application/controllers/Tickets.php - Sms · Administrative SMS sending and inspection screens.
application/controllers/Sms.php - API · Programmatic endpoints for users, tickets, public access, and SMS integrations.
application/controllers/API/Pub.php - Identity · Authentication, 2FA, user details, KYC, documents, banking, locations, and flow logic.
application/models/user/Auth_model.php - Ticketing · Ticket records, threads, and message history.
application/models/ticket/Ticket_model.php - Notifications · Outbound email and SMS notification logic plus notification coordination.
application/models/notification/Notification_model.php - SMS Models · SMS-specific data models for users and sender/provider behavior.
application/models/sms/Smsmodel_model.php - Storage · Attachment and document storage handling.
application/models/storage/Storage_model.php
Presentation
Server-rendered views and shared UI shells.
- Admin UI · Operational dashboards, reports, KYC, withdrawals, and member management screens.
application/views/admin/dashboard.php - Auth UI · Login, OTP, registration, password reset, and unauthorized screens.
application/views/auth/login.php - Ticket UI · Create, list, view, close, and my-ticket pages.
application/views/ticket/list.php - User UI · User dashboards, profile, list, and password management screens.
application/views/user/dashboard.php - SMS UI · Screens for sending and reviewing SMS activity.
application/views/sms/send_sms.php
Platform
Environment, config, persistence, and bundled frontend assets.
- Config · Routing, permissions, database, environment, and product settings.
application/config/config.php - Assets · Bundled CSS, JS, charting, tables, forms, and UI plugins for the server-rendered interface.
assets/js/app.js - MySQL DB · Primary relational persistence backed by CodeIgniter database configuration and SQL dump.
application/config/database.php
Connections 28
- index.php → CodeIgniter: boots · The entry script initializes the CodeIgniter runtime.
- CodeIgniter → Config: loads · Framework startup reads app configuration and routing.
- CodeIgniter → MY_Controller: extends · Controllers inherit shared application behavior.
- CodeIgniter → MY_Model: extends · Models inherit shared application behavior.
- MY_Controller → Helpers: uses · Controllers rely on shared helper functions.
- MY_Controller → Auth: hosts · Authentication flows are handled by the auth controller.
- MY_Controller → User: hosts · User workflows are handled by the user controller.
- MY_Controller → Tickets: hosts · Ticket workflows are handled by the tickets controller.
- MY_Controller → Sms: hosts · SMS admin workflows are handled by the SMS controller.
- MY_Controller → API: hosts · API controllers expose integration endpoints.
- Auth → Identity: orchestrates · Login and access control delegate into identity models.
- User → Identity: orchestrates · Profile and account management use user identity data.
- Tickets → Ticketing: orchestrates · Ticket actions read and write ticket domain state.
- Tickets → Notifications: triggers · Ticket events can emit email or SMS notifications.
- Sms → SMS Models: orchestrates · SMS screens use SMS domain models.
- API → Ticketing: exposes · External endpoints can interact with ticket data.
- API → Identity: exposes · External endpoints can interact with user data.
- Notifications → Mustache: renders · Template rendering supports generated messages and email content.
- Identity → Storage: stores · Identity flows use document and attachment persistence.
- Ticketing → Storage: stores · Ticket attachments and related files are persisted through storage.
- Storage → MySQL DB: persists · Metadata and file references are stored in the database.
- Ticket UI → Assets: styled by · Ticket screens are driven by bundled frontend assets.
- Admin UI → Assets: styled by · Admin dashboards and reports depend on the frontend bundle.
- Auth UI → Assets: styled by · Authentication screens depend on the frontend bundle.
- User UI → Assets: styled by · User dashboards and profile screens depend on the frontend bundle.
- SMS UI → Assets: styled by · SMS management screens depend on the frontend bundle.
- Templates → Mustache: uses · Template services can use the bundled Mustache engine.
- Config → MySQL DB: configures · Database connection settings define the persistence backend.