How lukalomadze1/morrow works
Morrow is a sleeper-train booking and operations demo. Travellers search direct journeys, inspect berth availability, hold places, confirm a booking and access a ticket; staff can manage departures and bookings. The domain is split between network/timetable logic, availability and pricing, holds/bookings, and operations, backed by SQLite/libSQL. The README also describes the departure board and the animated night journey. Some pages and routes were not sampled, so their connections are shown only where the README or source index supports them.
Main entry points: search.ts Offer search · client.ts LibSQL database · page.tsx Berth selection · holds.ts Berth holds
Components 29
Journey discovery
- Journey search
src/app/search/page.tsx - Offer search
src/lib/search.ts - Lines and stations
src/lib/network.ts - Journey timing
src/lib/time.ts - Departure inventory
src/lib/departures.ts - Departure board
src/app/api/board/route.ts
Booking lifecycle
- Berth selection
src/app/book/[departureId]/page.tsx - Train formation
src/lib/formation.ts - Place availability API
src/app/api/departures/[id]/places/route.ts - Hold API
src/app/api/holds/route.ts - Berth holds
src/lib/holds.ts - Booking checkout
src/app/book/checkout/[holdId]/page.tsx - Booking API
src/app/api/bookings/route.ts - Booking and tickets
src/lib/bookings.ts - Ticket access
src/app/ticket/[token]/page.tsx - Ticket actions
src/components/booking/TicketActions.tsx
Operations
- Operations dashboard
src/app/ops/page.tsx - Operations logic
src/lib/ops.ts - Operations API
src/app/api/ops/departures/[id]/route.ts - Operations sessions
src/lib/auth.ts
Domain platform
- Fare calculation
src/lib/pricing.ts - LibSQL database
src/lib/db/client.ts - Booking data model
src/lib/db/schema.ts - API validation
src/lib/api.ts
Site experience
- Animated night journey
src/components/home/NightStory.tsx - Scenery generation
src/lib/scenery.ts - Train illustration
src/components/art/Train.tsx - Line posters
src/components/art/Posters.tsx
Other components
- Traveller
Connections 31
- Traveller → Journey search: searches
README.md - Journey search → Offer search: requests offers
src/app/search/page.tsx - Offer search → Lines and stations: finds connections
src/lib/search.ts - Offer search → Journey timing: builds journeys
src/lib/search.ts - Offer search → Departure inventory: ensures and loads
src/lib/search.ts - Offer search → Fare calculation: prices offers
src/lib/search.ts - Traveller → Berth selection: chooses berth
README.md - Berth selection → Place availability API: checks places
- Berth selection → Train formation: shows floor plan
- Place availability API → API validation: validates requests
src/app/api/departures/[id]/places/route.ts - Traveller → Hold API: holds places
README.md - Hold API → Berth holds: creates hold
src/app/api/holds/route.ts - Berth holds → LibSQL database: writes claims
src/lib/holds.ts - Berth holds → Fare calculation: sets fare
src/lib/holds.ts - Traveller → Booking checkout: enters details
README.md - Booking checkout → Booking API: confirms booking
- Booking API → Booking and tickets: confirms booking
src/app/api/bookings/route.ts - Booking and tickets → LibSQL database: persists booking
src/lib/bookings.ts - Traveller → Ticket access: opens ticket
README.md - Ticket access → Booking and tickets: loads ticket
- Ticket access → Ticket actions: offers ticket actions
- Operations dashboard → Operations logic: loads dashboard data
src/app/ops/page.tsx - Operations dashboard → Operations sessions: checks session
src/app/ops/page.tsx - Operations API → Operations sessions: checks session
src/app/api/ops/departures/[id]/route.ts - Operations API → Operations logic: updates departure
src/app/api/ops/departures/[id]/route.ts - Operations logic → LibSQL database: reads and writes
src/lib/ops.ts - LibSQL database → Booking data model: uses schema
src/lib/db/client.ts - Animated night journey → Scenery generation: renders scenery
src/components/home/NightStory.tsx - Animated night journey → Train illustration: renders train
src/components/home/NightStory.tsx - Line posters → Lines and stations: uses line data
src/components/art/Posters.tsx - Departure board → Departure inventory: serves board data