1. phases
Itinera API
  • ✈ Itinera API Documentation
  • Docs
    • legacy
      • Itinera — System Overview
      • Technology Stack & Architecture
      • Getting Started Guide
      • Infrastructure
      • Frontend Application
      • Architecture Overview
      • API Reference
      • Backend Services
      • Development Guidelines
    • phases
      • 01. Architecture Overview & Checkout Idempotency
      • Phase 2: Commerce & Checkout Engine
      • Phase 3: Webhooks & Asynchronous Fulfillment
      • Phase 4: Security Perimeter & Authentication
      • Phase 5: Database Schema & Entity Relationships
      • Phase 6: AI Quota & Telemetry Subsystems
      • Phase 7: API Route Matrix & FormRequests
      • Phase 8: Global Exception & Error Handling
      • Phase 9: Frontend Ecosystem & State Management
      • Phase 10: Design System & Component Library
      • Phase 11: Interactive GSAP Animations
      • Phase 12: Deployment & CI/CD Pipeline
      • Phase 13: Testing Strategies
      • Phase 14: Performance & Optimization
      • Phase 15: Developer Onboarding & Runbooks
      • 15-Phase Comprehensive Wiki & Documentation Plan
  • APIs
    • Auth
      • Register a new user
      • Log in a user
      • Log out user
      • Refresh JWT token
      • Forgot password request
      • Reset password verification
      • Get current user profile
      • Update user profile
      • Redirect to Google OAuth
      • Google OAuth Callback
      • Verify email via signed URL
    • Catalog
      • List all countries
      • Get country details
      • List all cities
      • List all regions
      • List all destinations
      • Get destination details
      • Get hotels by destination
      • List all hotels
      • Get hotel details
      • Get reviews for a hotel
      • List all flights
      • Get flight details
      • List all restaurants
      • Get restaurant details
      • List all attractions
      • Get current weather
      • Submit review for an entity
      • Delete review
      • Toggle favourite status for entity
      • List my submitted reviews
    • Bookings
      • Book a tour destination
    • V1 Aliases
      • V1 List all countries
      • V1 Get country details
      • V1 List all cities
      • V1 List all destinations
      • V1 Get destination details
      • V1 Get hotels by destination
      • V1 List all hotels
      • V1 Get hotel details
      • V1 Get reviews for a hotel
      • V1 List all flights
      • V1 Get flight details
      • V1 List all restaurants
      • V1 Get restaurant details
      • V1 List all attractions
      • V1 Get attraction details
      • V1 List all regions
      • V1 Get weather details
    • Trips
      • List user trips
      • Create a new trip
      • Get trip details
      • Update trip details
      • Delete a trip
      • Get creation metadata
      • Attach items to a trip
      • Update trip item
      • Detach items from a trip
      • Fork a trip
    • Conversations
      • List user conversations
      • Start a new conversation
      • Get conversation details
      • List messages in conversation
      • Send message to conversation
      • Mark conversation as read
    • Commerce Plans
      • List public plans
      • Get public plan details
    • Commerce Subscriptions
      • Subscribe to a plan
      • Upgrade active plan
      • Get active subscription info
      • Cancel active subscription
    • Commerce Checkout
      • Initiate Paymob payment checkout
    • Integrations
      • Paymob status webhook callback
      • Paymob redirect return callback
    • System Settings & Support
      • Submit public contact message
      • Subscribe to system newsletter
      • Get list of my reports
      • List all notifications
      • Mark single notification as read
      • List available surveys
      • Submit answers for survey
      • Get survey details
      • Update survey details
      • Delete survey response
    • AI Tools
      • Enhance itinerary details using AI
      • Request AI review of itinerary
      • Plan route using AI assistance
      • Get AI quota remaining details
      • Chat with AI Concierge assistant
      • Get AI Review progress by ID
    • Agency Integration
      • Request agency assignment
      • List agency active tasks
      • List agency managed trips
      • Get agency total earnings
      • Get agency profile details
      • Update agency profile details
    • Admin User Management
      • List users inside admin dashboard
      • Get user profile
      • Set user active status
      • Block user profile
    • Admin Catalog Moderation
      • Create new catalog category
      • Create new catalog destination
      • Create new hotel catalog record
      • Create new flight catalog record
      • Create new restaurant catalog record
      • Create new attraction catalog record
  • Schemas
    • User
    • ErrorResponse
    • Trip
    • Destination
    • Hotel
    • Flight
    • Restaurant
    • Attraction
    • Booking
    • Review
    • Agency
    • Survey
  1. phases

Phase 15: Developer Onboarding & Runbooks

This document is the single entry point for new contributors. It consolidates the README.md quick-start, fullstack/Backend/.env.example:1-164 env matrix, and the docker/entrypoint.sh boot sequence into a reproducible local workflow plus a tinker/queue troubleshooting runbook.

1. Prerequisites#

ToolVersionVerify
PHP8.2+ (prod image 8.5-fpm-alpine)php -v
Composer2.xcomposer --version
Node20+node -v
DBsqlite (default) or MySQL 8sqlite3 --version
No Redis required locally — CACHE_STORE=database, QUEUE_CONNECTION=database are the defaults (Phase 6/12). Telescope is off unless TELESCOPE_ENABLED=true.

2. First Boot (Backend — 7 steps)#

From README.md:49-75 and docker/entrypoint.sh:8-50 — the local sequence mirrors the container boot:
Frontend showcase is separate (itinera-showcase-react — npm install; npm run dev -- --port 5199, or python -m http.server 8080 for fullstack/Frontend vanilla).

3. Env Matrix — .env.example:1-164#

Only APP_KEY + JWT_SECRET are mandatory for boot; everything else has a local default.
KeyLocal defaultProd valueNotes
APP_ENVlocalproductiongates TELESCOPE_ENABLED warning
APP_DEBUGfalsefalsenever true on Railway
DB_CONNECTIONsqlitemysqlDB_DATABASE defaults to database/database.sqlite
CACHE_STOREdatabaseredisCACHE_PREFIX threedos_
QUEUE_CONNECTIONdatabaseredis (recommended)see QUEUE_WORKER_SLEEP 3 / TRIES 3
SESSION_DRIVERdatabasedatabaseSESSION_LIFETIME 120
CORS_ALLOWED_ORIGINShttp://localhost:8080, http://127.0.0.1:8080, http://localhost:5173 ...https://yourdomain.comcomma-separated, baked by config:cache
JWT_SECRET(empty) → artisan jwt:secretvault—
PAYMOB_*(empty)PAYMOB_PUBLIC_KEY/SECRET_KEY/HMAC/INTEGRATION_IDSPAYMOB_HMAC must be set in prod or PaymobGateway throws SEC-05
GROQ_API_KEY / OPENAI_API_KEY(empty)vaultgsk-test-mock-key in phpunit.xml
FRONTEND_URL(empty → localhost:8080 fallback)https://frontend.railway.appused for Paymob callback redirect
TELESCOPE_ENABLEDfalsefalsenever on prod unless telescope.yourdomain.com restricted
SITE_FORK_PRICE_CENTS / PLATFORM_COMMISSION_RATE50000 / 0.05—Phase 9 settings seeder
LOG_CHANNELstack → singlestackLOG_LEVEL debug

4. Artisan Runbook#

CommandWhen
`php artisan route:list --jsonmeasure`
php artisan config:cache && route:cache && view:cachereproduce Railway entrypoint locally after env change
php artisan migrate --forceentrypoint does this on every boot; run after pulling migrations
php artisan db:seed --forcerepopulate 60 orders / 60 payments / hotels / test users — only if SEED_ON_DEPLOY=true in prod
php artisan queue:work --sleep=3 --tries=3 --max-time=3600keep FulfillOrderListener and mail queue alive; supervisord does this in container (Phase 12)
php artisan tinkersee §5
php artisan storage:linkafter migrate:fresh if public/storage missing
php artisan pint --testlint gate (CI lint job)

5. Tinker Snippets#

6. Queue Worker Lifecycle#

In prod: supervisord priority 30 runs queue:work --sleep=3 --tries=3 --max-time=3600 (Phase 12). The worker sleeps 3s when idle, retries 3x per job, and recycles every 3600s to bound leaks.
Locally: run the same command in a second terminal. With QUEUE_CONNECTION=database, jobs are sync-equivalent in tests (phpunit.xml sets QUEUE_CONNECTION sync) but async in dev — you must keep the worker running to see PaymentSucceeded → FulfillOrderListener → subscription + AI quota reset.
Check:

7. Log & Debug Locations#

LogWhere
Laravel stack → singlestorage/logs/laravel.log
Log::warning('Paymob webhook HMAC failed')same — greps for HMAC
Log::warning('Order expired beyond grace period')same — greps for grace
Log::error('Order fulfillment failed')same — includes order_id, payment_id, exception
PHP error_log /var/log/php_errors.log (docker/php.ini)container only
supervisor/var/log/supervisor/supervisord.log

8. Troubleshooting Flow#

9. Principles#

1.
Entrypoint is the spec. Local boot repeats docker/entrypoint.sh steps in the same order: config:cache before route:cache before migrate before queue:work.
2.
sqlite by default. New contributors need zero services — database cache/queue + sqlite file are enough; Redis is a prod upgrade, not a dev requirement.
3.
Seed is deterministic. migrate:fresh --seed always yields the same 60 paid orders — telemetry and admin dashboards are comparable across machines.
4.
Tinker is the REPL runbook. Every service (CheckoutService, WebhookService, AiUsageService) is resolvable via app(); snippets above are the fastest way to reproduce a bug without Postman.
Modified at 2026-08-25 22:41:45
Previous
Phase 14: Performance & Optimization
Next
15-Phase Comprehensive Wiki & Documentation Plan
Built with