How wrocoder/hoptrip works
HopTrip is a Poland-first flight-deal discovery product: cached provider prices are ingested and converted into persistent offers and price history, then route statistics and scored deals support a public browsing and affiliate-redirect journey. The API also exposes analytics and protected moderation/affiliate operations. The sampled pipeline and ingestion code establish the data stages; the README documents the broader public, affiliate-policy, session-analytics and moderation capabilities. Several API routes and web pages were not sampled, so their detailed wiring is represented only where the tree or documentation supports it.
Main entry points: pipeline.py Ingestion pipeline · main.py API application · app Web experience · page.tsx Home discovery
Components 24
Public discovery
- Web experience
apps/web/src/app - Home discovery
apps/web/src/app/page.tsx - Web API client
apps/web/src/lib/api.ts - Deal catalog
apps/web/src/app/components/catalog.tsx - Route guides
apps/web/src/lib/destination-guides.ts - Outbound links
apps/web/src/app/components/outbound.tsx
API and operations
- API application
apps/api/app/main.py - Catalog API
apps/api/app/api/catalog.py - Admin operations
apps/api/app/api/admin.py
Deal data pipeline
- Job orchestration
apps/api/app/jobs - Ingestion pipeline
apps/api/app/jobs/pipeline.py - Travelpayouts adapter
apps/api/app/providers/travelpayouts.py - Offer ingestion
apps/api/app/services/ingestion.py - Deal generation
apps/api/app/services/deals.py - Route statistics
apps/api/app/services/statistics.py
Affiliate and analytics
- Affiliate API
apps/api/app/api/affiliate.py - Analytics API
apps/api/app/api/analytics.py - Partner link sync
apps/api/app/services/partner_links.py - Affiliate policy
apps/api/app/services/affiliate.py - Session analytics
apps/web/src/lib/session.ts
Other components
- Traveler
- PostgreSQL
- Travelpayouts
- Analytics records
apps/api/app/models/analytics.py
Connections 30
- Traveler → Web experience: browses
- Web experience → Home discovery: renders
- Home discovery → Web API client: requests data
- Web API client → API application: calls API
- Home discovery → Deal catalog: shows deals
- Web experience → Route guides: presents guides
- Deal catalog → Outbound links: opens offer
- Outbound links → Affiliate API: requests redirect
- API application → Catalog API: dispatches
- API application → Affiliate API: dispatches
- API application → Analytics API: dispatches
- API application → Admin operations: dispatches
- Session analytics → Analytics API: posts events
- Analytics API → Analytics records: records events
- Admin operations → Affiliate policy: checks policy
- Admin operations → PostgreSQL: reads and writes
- Job orchestration → Ingestion pipeline: runs pipeline
- Ingestion pipeline → Travelpayouts adapter: searches offers
- Travelpayouts adapter → Travelpayouts: fetches cached prices
- Ingestion pipeline → Offer ingestion: ingests offers
- Offer ingestion → PostgreSQL: writes offers
- Ingestion pipeline → Route statistics: recalculates routes
- Route statistics → PostgreSQL: reads and writes
- Ingestion pipeline → Deal generation: generates deals
- Deal generation → PostgreSQL: reads and writes
- Ingestion pipeline → Partner link sync: syncs links
- Partner link sync → PostgreSQL: reads and writes
- Web API client → Catalog API: requests catalog
- Affiliate API → Affiliate policy: applies policy
- Catalog API → PostgreSQL: reads catalog