FlightAPI Microservice Development

Job ID: 40385031

Budget: $4,000 – $6,500 USD

**Project Overview**
We already have mature Routeblock tables with 20k+ cached flight and hotel routes.

We need a professional, production-ready, independent Laravel 13 microservice called **FlightAPI** that:
- Completely replaces Amadeus for both Flight and Hotel dummy itinerary generation
- Produces realistic dummy PDFs that exactly match our current samples (PDFs will be attached)
- Runs on full autopilot with scheduled refresh
- Exposes a clean public B2B REST API
- Supports direct sales + distribution on RapidAPI, Rakuten API, and other marketplaces


**Core Objective**
Build a reliable 3-layer hybrid engine for Flight + Hotel that delivers 95%+ realism dummy documents, never fails, and becomes our scalable SaaS product with recurring revenue.


**MANDATORY Architecture – 3-Layer Hybrid (Flight & Hotel)**

**Layer 1 – Routeblock Cache (Primary)**
• Redis + MySQL lookup
• Sub-50 ms response for cached items (target 95–99% of traffic)

**Layer 2 – Grok AI Generation (Core Engine)**
• On cache miss: Dispatch background job using Grok-4-Fast
• Generate full structured JSON using strict prompts (we will provide exact prompts matching our PDF samples)

**Layer 3 – Type-Specific Validation**
• Flight: AeroDataBox (schedule, flight numbers, aircraft) + rule-based sanity checks
• Hotel: Google Maps/Places API (Place Details) + rule-based sanity checks (real hotel names, addresses, amenities, cancellation policies, etc.)


**Reliability Guarantee**
If any step fails:
1. Retry AI generation once
2. Fallback to nearest existing Routeblock entry
3. Fallback to simplified direct template
API must always return valid PDF-ready JSON.

**Auto-Refresh System**
• Nightly (02:00): Refresh top 10,000 hot routes/hotels (new dates, prices, variations)
• Weekly: OpenFlights update (flights) + Google Places refresh (hotels) + new route/hotel discovery
• Track freshness_score (0–100) and last_refreshed

**Public B2B API Features**
• Combined endpoint with type: flight or type: hotel
• Endpoints:
• POST /api/v1/itineraries/search
• GET /api/v1/itineraries/{pnr_or_reservation_number}
• POST /api/v1/itineraries/refresh
• Tiered rate limiting + detailed usage tracking
• OpenAPI/Swagger documentation (for RapidAPI & Rakuten integration)
• Webhook support for marketplace callbacks

**Customer Dashboard & Social Login**
• Built-in admin/customer portal (using Laravel)
• Social login: Google, Apple, Facebook, X (Twitter)
• API key management, usage analytics, billing history, reissue button

**Recurring Payment Integration (Stripe – Full SaaS Billing)**
• Plans:
• Starter: $79/month (Flight or Hotel only)
• Growth: $179/month (Both + higher limits)
• Enterprise: $499/month (unlimited calls + white-label)
• Full Stripe integration: subscriptions, usage-based overage, webhooks, upgrade/downgrade, cancellation

**Marketplace Distribution Support (RapidAPI, Rakuten API, etc.)**
• Standardized OpenAPI 3.1 spec
• Marketplace-friendly API key generation and usage reporting
• Webhook endpoints for 3rd-party platform callbacks
• Rate limiting configurable per integration
• Usage analytics endpoint for partner dashboards

**Tech Stack (Strict Requirement)**
• Laravel 13 (fresh project)
• MySQL or PostgreSQL
• Redis + Laravel Horizon (queues & caching)
• Laravel Scheduler (cron)
• Laravel Sanctum + Socialite (for Google/Apple/Facebook/X login)
• Grok-4-Fast (official PHP SDK)
• AeroDataBox Flight API (flights)
• Google Maps/Places API (hotels)
• Stripe (full subscription + usage billing)
• OpenFlights CSV import + Google Places seeding

**Performance Targets**
• Cached request: < 100 ms
• New generation: background job with polling/WebSocket feedback (“Generating…”)


**Deliverables & Milestones (Fixed Price – 5–7 weeks)**

**Milestone 1 (Week 1 – 10%)**
• Laravel 13 setup + DB schema (flight + hotel) + OpenFlights & hotel seeding + social login

**Milestone 2 (Week 2 – 20%)**
• Routeblock cache + Grok AI job (flight & hotel) + structured JSON

**Milestone 3 (Week 3 – 20%)**
• Validation layers (AeroDataBox + Google Places) + rule-based sanity + fallback logic

**Milestone 4 (Week 4 – 15%)**
• Public B2B API + rate limiting + OpenAPI spec + marketplace webhook support

**Milestone 5 (Week 5 – 15%)**
• Stripe recurring billing + customer dashboard with social login + usage analytics

**Milestone 6 (Final – 20%)**
• Data migration from existing tables
• Integration of the new API into our two existing live production websites for real-world testing and use
• Full testing, documentation & deployment


**Required Skills**
• Strong Laravel 13 (Horizon, Sanctum, Socialite, Scheduler)
• Proven LLM integration (Grok/OpenAI) with strict structured JSON
• Experience building SaaS APIs with Stripe recurring + usage billing
• Experience with marketplace integrations (RapidAPI, Rakuten, etc.) is a big plus
• Clean, production-grade, well-documented code

**How to Apply**
Please reply with:
1. Your fixed-price bid for the full project
2. Links to 1–2 relevant Laravel projects (API + billing + social login)
3. Answers to these questions:
• Have you integrated Grok or OpenAI with strict JSON output in Laravel?
• Experience with Laravel Horizon + Redis queues?
• Have you built APIs for RapidAPI or similar marketplaces?
• Can you start immediately and deliver Milestone 1 within 7 days?

PDF samples (flight + hotel) will be attached for exact JSON matching.

We are looking for a reliable long-term partner to build the backbone of our dummy-ticket infrastructure and B2B API business.
Related categories: MySQL PostgreSQL Laravel Redis Stripe JSON Documentation API Development SaaS Grok