A modern React application built with XState for managing complex booking flows across multiple services including food delivery, flight booking, hotel booking, travel booking, and parcel delivery.
- Multi-Service Booking: Support for 5 different booking services
- State Management: Built with XState for predictable state transitions
- Modern UI: Clean, responsive design with Tailwind CSS
- Provider Selection: Multiple providers for each service type
- Real-time State Visualization: See current state transitions in the UI
- Swiggy
- Zomato
- Uber Eats
- IndiGo
- SpiceJet
- Air India
- OYO
- Treebo
- Zostel
- Ixigo
- MakeMyTrip
- Goibibo
- Dunzo
- Shiprocket
- Delhivery
- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:5173(or the port shown in your terminal)
src/
├── components/
│ ├── ServiceSelector.jsx # Main service selection
│ ├── BookingService.jsx # Service-specific booking container
│ ├── ProviderSelector.jsx # Provider selection for each service
│ └── BookingFlow.jsx # Booking state flow (idle → processing → completed/cancelled)
├── machines/
│ ├── bookingMachine.js # Main booking state machine
│ ├── foodBookingMachine.js # Food delivery state machine
│ ├── flightBookingMachine.js # Flight booking state machine
│ ├── hotelBookingMachine.js # Hotel booking state machine
│ ├── parcelBookingMachine.js # Parcel delivery state machine
│ └── travelBookingMachine.js # Travel booking state machine
├── App.jsx # Main application component
└── main.jsx # Application entry point
Each service follows a consistent state machine pattern:
- selectingProvider: Choose from available providers
- [provider]: Provider-specific states
- idle: Ready to start booking
- processing: Booking in progress
- completed: Booking successful
- cancelled: Booking cancelled
- completed: Final success state
- React 18: Modern React with hooks
- XState: State management and state machines
- @xstate/react: React integration for XState
- Tailwind CSS: Utility-first CSS framework
- Vite: Fast build tool and dev server
npm run dev: Start development servernpm run build: Build for productionnpm run preview: Preview production buildnpm run lint: Run ESLint
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request