A modern yoga class booking web application built with React.js and Firebase.
- Class Booking: Book yoga classes with real-time availability
- Time Slots: Two daily sessions (9:00 AM & 11:00 AM)
- Capacity Management: 20 spots per time slot
- Multiple Payment Options: Credit card or package purchase
- Multi-language Support: Thai and English interface
- Dashboard: Overview of bookings and revenue
- Booking Management: View and manage all bookings
- Real-time Statistics: Today's bookings, monthly revenue
- User Management: Handle customer information
- Credit Card Payment: Secure card processing simulation
- Package System: Buy multiple classes in advance
- Pricing: ฿500 per single class
- Frontend: React.js 17
- Backend: Firebase (Firestore, Authentication)
- Styling: Custom CSS with gradient designs
- Internationalization: React i18next
- Routing: React Router v6
- Node.js 14 or higher
- Firebase project setup
- Clone the repository
git clone <repository-url>
cd yoga-booking-app
- Install dependencies
npm install
- Configure Firebase
- Create a Firebase project at https://firebase.google.com
- Enable Authentication and Firestore
- Copy your Firebase config to
src/services/firebase.js
- Start the development server
npm start
-
Authentication: Enable Email/Password authentication
-
Firestore: Create collections:
bookings
- for storing class bookingsusers
- for user profilespackages
- for class packages
-
Security Rules: Configure Firestore rules for proper access control
For testing purposes, create these accounts in Firebase Authentication:
- Admin: admin@yoga.com / admin123
- User: user@yoga.com / user123
src/
├── components/ # Reusable UI components
│ ├── Header.js
│ ├── Login.js
│ ├── DatePicker.js
│ ├── TimeSlotSelector.js
│ └── PaymentForm.js
├── pages/ # Main application pages
│ ├── BookingPage.js
│ └── AdminDashboard.js
├── contexts/ # React Context providers
│ ├── AuthContext.js
│ └── BookingContext.js
├── services/ # Firebase and API services
│ ├── firebase.js
│ └── bookingService.js
├── i18n/ # Internationalization
│ └── index.js
└── App.js # Main application component
- Real-time availability checking
- Date range validation (30 days advance booking)
- Time slot capacity management
- Automatic booking confirmation
- Credit card form validation
- Package selection system
- Payment processing simulation
- Receipt generation
- Thai and English languages
- Dynamic language switching
- Localized date/time formatting
- Cultural-appropriate UI elements
- Firebase Authentication
- Protected routes
- Admin role checking
- Secure data access patterns
{
id: "auto-generated",
date: Timestamp,
timeSlot: "09:00" | "11:00",
userInfo: {
firstName: string,
lastName: string,
email: string,
phone: string
},
status: "confirmed" | "cancelled",
amount: number,
paymentMethod: "card" | "package",
packageId: string?, // if paid with package
createdAt: Timestamp
}
{
id: "auto-generated",
name: string,
classes: number,
price: number,
description: string,
createdAt: Timestamp
}
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support, please contact [your-email@example.com]