How nguyenvuongviet/airbnb works
Project type and purpose
• This is a React-and-TypeScript single-page application (SPA) that mimics an AirBnB-style booking front-end. It’s built with Vite, Tailwind CSS, React Router, Redux Toolkit, and connects to external REST APIs (booking service, weather service, PayPal, etc.). There is no in-repo backend—api.ts is the HTTP client.
File structure
• Top level:
• public, index.html – static host and entry point
• src/main.tsx – React app bootstrap
• src/routes, src/pages – page-level components organized by feature (Home, Booking, Payment, Profile, Admin)
• src/components – shared presentational UI components (Loading, AppHeader, AppFooter, etc.)
• src/store – Redux slices per domain (auth, bookings, rooms, comments, weather, etc.)
• src/services/api.ts – Axios (or fetch) wrapper for HTTP calls
• src/models – TypeScript DTO/interface definitions for API responses and domain models
• src/config – dev/prod environment variables and endpoints
• src/hooks – custom React hooks (e.g. ScrollToTop)
• config files: vite.config.ts, tailwind.config.js, tsconfig*.json, eslint.config.js
Detail
• Config files feeding into the API client
• How routesConfig maps URL patterns to Pages
• Role of models/interfaces in defining data contracts