How saaqeb/itt-enterprise-sandbox works
1. This is a PHP, Apache-hosted travel commerce monolith rather than a single app. The repository is split into three major runtime surfaces: CoreEngine_ServiceAPI for backend API/services, b2b_application for the partner/admin web portal, and OnlinePaymentGateway for payment processing. A fourth area, AdminAPI, sits inside CoreEngine_ServiceAPI and exposes admin-oriented operations.
2. The core domain is travel booking and fulfillment. The backend supports flights, hotels, cars, tours, transfers, visas, train, insurance, and eSIM. Each domain has its own endpoint set for search, validation, booking creation, booking details, cancellation, update, and ticket/voucher issuance.
3. The code is organized in a classic layered PHP style: thin endpoint scripts call shared domain classes under class/, which then talk to supplier adapters, the database, and notification/payment services. This pattern repeats across the API and portal, so architecture diagrams should show many page/controller entrypoints feeding into shared business logic, not a single central framework router.
4. Supplier integration is a major subsystem. The class/*_supplier_class directories contain adapters for many third-party providers, especially for flights and hotels, plus eSIM, insurance, transfer, train, and tour suppliers. These adapters are used by search and booking flows to translate internal requests into supplier-specific APIs or GDS commands.
5. Booking lifecycle processing is stateful and crosses multiple subsystems. Typical flow is: search or quote → validate availability/price → create booking/order → optionally pay → issue ticket/voucher/confirmation → later cancel/reissue/refund/void if needed. The same lifecycle is reflected in both customer-facing endpoints and management tools.
6. Payments are isolated into OnlinePaymentGateway, which behaves like a standalone gateway host. It contains per-provider handlers and webhooks for providers such as bKash, Nagad, SSLCommerz, Stripe, PayPal, PayFast, and others. The payment layer feeds back into booking and finance status updates through callbacks/IPN/webhook-style entrypoints.
7. The b2b_application directory is the operational portal for partners and internal staff. It is heavily page-based with AJAX endpoints for flight/hotel booking, finance, reports, partner management, supplier configuration, support tickets, and subscription management. The portal also owns a large static UI asset bundle under resources/ for charts, calendars, editors, forms, and booking widgets.
8. Finance is a first-class subsystem and is split between booking records and accounting views. There are ledgers, invoices, payment requests, refunds, partial payments, reconciliation, and balance summaries in both the API and the portal. This suggests a shared financial model backing operational booking events and partner settlement workflows.
9. Reporting and analytics are broad and operationally important. There are dedicated report classes and report pages for sales, top-up, refunds, issue/reissue, booking failure, login activity, supplier activity, and partner performance. Many of these reports are read-only views over the same transactional data used by bookings and finance.
10. Background processing is handled through extensive cron job directories. Scheduled jobs cover hold auto-cancellation, currency rate updates, campaign sending, log uploads, payment verification, accounting corrections, report generation, PNR/booking synchronization, and supplier-specific maintenance. In an architecture diagram, these should be shown as asynchronous workers reading/writing the same core data stores as the web/API layer.
11. Webhooks are another boundary into the system. There are webhook endpoints for suppliers and messaging services, including eSIM notifications and payment-related callbacks. These endpoints update booking state or operational logs without direct user interaction.
12. Authentication and authorization are shared concerns across the portal and APIs. The repo includes login, secure login/OTP, Google Authenticator/2FA, token validation, and user/team/permission management. Partner and admin users are treated as distinct surfaces, with separate login paths and session handling.
13. Content and engagement features are embedded alongside transactional flows. Articles, widgets, banners, marquee messages, newsletters, push messaging, and email templates are managed through both API and portal modules. These features are powered by shared media/config assets and are used to drive marketing and homepage content.
14. Supporting infrastructure is file-based and conventional for legacy PHP hosting: .htaccess routing, includes/dbconfig.php for database access, static JSON/config files for some supplier credentials and lookup data, and bundled third-party libraries such as Google2FA, CKEditor, FullCalendar, ApexCharts, and payment SDKs. The repository also includes GitHub workflow files for deployment, indicating CI/CD around this monolith rather than service-by-service deployment.
Main entry points: class Booking engine · AdminAPI Admin API · finance Finance API · CoreEngine_ServiceAPI API entrypoints
Components 19
CoreEngine API
Backend service surface for booking, finance, admin, cron, and webhooks.
- API entrypoints · Thin HTTP scripts for search, validation, booking, finance, reports, users, widgets, and content APIs.
CoreEngine_ServiceAPI - Admin API · Admin-oriented operations for bookings, finance, suppliers, reports, settings, widgets, and partner management.
CoreEngine_ServiceAPI/AdminAPI - Booking engine · Stateful booking lifecycle handling across search, validate, create, issue, cancel, refund, and sync flows.
CoreEngine_ServiceAPI/class - Finance API · Invoices, payment requests, reconciliation, refunds, partial pay, and balance summaries.
CoreEngine_ServiceAPI/finance - Reports API · Operational sales, purchase, top-up, transaction, supplier, and service-status reporting.
CoreEngine_ServiceAPI/reports - User auth · Login, secure login, OTP, password reset, SSO, profiles, team members, and permissions.
CoreEngine_ServiceAPI/user - Webhooks · Inbound supplier and messaging callbacks that update booking state or logs asynchronously.
CoreEngine_ServiceAPI/webhook - Cron jobs · Scheduled jobs for auto-cancel, payment verification, currency updates, reporting, sync, and maintenance.
CoreEngine_ServiceAPI/cronjobs - Content APIs · Articles, marketing content, widgets, banners, marquee messages, newsletters, and push/email helpers.
CoreEngine_ServiceAPI/widget
B2B Portal
Partner and staff web portal with booking, operations, reporting, and management.
- Portal pages · Partner and internal staff portal pages for booking, finance, reports, suppliers, settings, and management.
b2b_application - Portal AJAX · Page-level AJAX endpoints that drive searches, booking actions, operational edits, and grid updates.
b2b_application/ajax - Management console · Staff console for bookings, suppliers, finance, reports, articles, marketing, support, settings, and user management.
b2b_application/management - Checkout UI · Portal payment pages that hand off to provider-specific checkout and IPN flows.
b2b_application/checkout - Portal finance · Ledger, invoices, payments, refunds, and partner payment slip workflows in the portal.
b2b_application/finance
Payment Gateway
Standalone online payment host with provider handlers and callbacks.
- Gateway entrypoints · Public payment scripts for provider checkout, validation, refund, void, review, and webhooks.
OnlinePaymentGateway - Provider handlers · Provider-specific gateway classes for bKash, Nagad, SSLCommerz, Stripe, PayPal, PayFast, and others.
OnlinePaymentGateway/class
Shared Layer
Common domain logic, supplier adapters, auth, config, and assets used across surfaces.
- Supplier adapters · Per-domain adapters for flight, hotel, car, tour, transfer, train, insurance, activity, and eSIM providers.
CoreEngine_ServiceAPI/class - Auth & config · Shared dbconfig, auth, htaccess routing, and file-based credential/config assets.
CoreEngine_ServiceAPI/includes - Static assets · Bundled UI libraries, charts, editors, calendars, JSON lookup data, and voucher assets.
b2b_application/resources
Connections 31
- API entrypoints → Booking engine: calls · API scripts invoke shared booking logic.
- API entrypoints → Supplier adapters: integrates · Search and booking endpoints translate into supplier APIs.
- API entrypoints → Finance API: uses · Booking and customer APIs read/write financial state.
- API entrypoints → User auth: authenticates · User-facing endpoints share login and access control.
- Admin API → Booking engine: administers · Admin operations manage booking lifecycle state.
- Admin API → Supplier adapters: configures · Supplier setup, firewall, queue, and credential management.
- Admin API → Finance API: operates · Admin finance pages update ledgers, gateways, invoices, and refunds.
- Admin API → Reports API: reads · Admin reporting views are built on transactional data.
- Admin API → User auth: manages · AdminAPI includes staff, partner, and permission management.
- Admin API → Content APIs: publishes · Content, marketing, and widget management endpoints live here.
- Booking engine → Supplier adapters: delegates · Booking flows validate and fulfill through supplier-specific implementations.
- Booking engine → Finance API: posts · Bookings create invoices, payment requests, refunds, and settlement records.
- Booking engine → Webhooks: updates via · Booking state is finalized by inbound payment/webhook callbacks.
- Cron jobs → Booking engine: synchronizes · Scheduled jobs reconcile holds, ticketing, PNR sync, and cancellations.
- Cron jobs → Finance API: reconciles · Async jobs verify payments, correct accounting, and regenerate reports.
- Webhooks → Booking engine: confirms · Supplier and messaging callbacks update operational booking state.
- Webhooks → Finance API: settles · Payment callbacks mark transactions and refunds complete.
- Portal pages → Portal AJAX: drives · Portal pages rely on AJAX endpoints for interactive operations.
- Portal pages → API entrypoints: consumes · Customer-facing portal features call the service API.
- Management console → Admin API: uses · Operations console is largely a UI over AdminAPI.
- Management console → Portal AJAX: interacts via · Management pages use many local AJAX handlers.
- Checkout UI → Gateway entrypoints: redirects to · Checkout pages hand off payment to the gateway host.
- Checkout UI → Finance API: tracks · Portal checkout updates invoice and payment state.
- Gateway entrypoints → Provider handlers: dispatches · Gateway scripts delegate to provider-specific classes.
- Gateway entrypoints → Finance API: notifies · Payment completion feeds back to finance and booking records.
- Gateway entrypoints → Booking engine: updates · Gateway callbacks finalize booking payment and issuance state.
- Auth & config → API entrypoints: supports · Core API scripts share DB, auth, and routing infrastructure.
- Auth & config → Portal pages: supports · Portal pages use shared auth/config conventions.
- Auth & config → Gateway entrypoints: supports · Gateway host also uses shared database configuration.
- Static assets → Portal pages: powers · Portal pages use bundled JS, CSS, JSON, and UI libraries.
- Static assets → Content APIs: feeds · Content and widget APIs populate shared front-end assets.