How yomileonel/room_booking_system works
Spacio is a room-booking application with a Next.js frontend and Spring Boot REST backend. Customers browse rooms, create bookings, pay through Stripe Checkout, and retrieve invoices; admins manage rooms, bookings, discount codes, users, and dashboard metrics. Authentication and optional AI-assistant workflows are distinct branches. The README documents the main product flows and integrations; source excerpts are limited, so implementation-level links not shown there are omitted.
Main entry points: BookingAdd.tsx Booking flow · apiClient.ts API client · app/page.tsx Booking interface · rooms/page.tsx Room browsing
Components 34
Customer web app
- Booking interface
react_frontend/src/app/page.tsx - Room browsing
react_frontend/src/app/rooms/page.tsx - Room details
react_frontend/src/app/rooms/[id]/page.tsx - Customer profile
react_frontend/src/app/profile/page.tsx - API client
react_frontend/src/app/api/apiClient.ts
Identity and access
- Login and registration
react_frontend/src/app/login/page.tsx - Authentication API
bookingssystem/src/main/java/steve/bookingssystem/user/Controller/RegistrationLoginController.java - JWT security
bookingssystem/src/main/java/steve/bookingssystem/security/JwtService.java - User records
bookingssystem/src/main/java/steve/bookingssystem/user/model/User.java
Rooms and bookings
- Room API
bookingssystem/src/main/java/steve/bookingssystem/room/Controller/RoomController.java - Room management
bookingssystem/src/main/java/steve/bookingssystem/room/service/RoomService.java - Room data
bookingssystem/src/main/java/steve/bookingssystem/room/model/Room.java - Booking flow
react_frontend/src/app/components/BookingAdd.tsx - Booking API
bookingssystem/src/main/java/steve/bookingssystem/booking/Controller/BookingController.java - Booking rules
bookingssystem/src/main/java/steve/bookingssystem/booking/service/BookingService.java - Booking records
bookingssystem/src/main/java/steve/bookingssystem/booking/model/Booking.java - Discount codes
bookingssystem/src/main/java/steve/bookingssystem/discount/Controller/DiscountCodeController.java - Room image storage
bookingssystem/src/main/java/steve/bookingssystem/storage/StorageService.java
Payments and billing
- Payment API
bookingssystem/src/main/java/steve/bookingssystem/payment/Controller/PaymentController.java - Payment processing
bookingssystem/src/main/java/steve/bookingssystem/payment/service/PaymentService.java - Stripe Checkout
bookingssystem/src/main/java/steve/bookingssystem/payment/service/StripeService.java - Invoice service
bookingssystem/src/main/java/steve/bookingssystem/invoice/service/InvoiceService.java - Invoice PDF
bookingssystem/src/main/java/steve/bookingssystem/invoice/service/InvoicePdfGenerator.java
Admin and assistant
- Admin dashboard
react_frontend/src/app/admin/page.tsx - Dashboard metrics
bookingssystem/src/main/java/steve/bookingssystem/admin/AdminDashboardController.java - Assistant chat
react_frontend/src/app/assistant/page.tsx - Assistant endpoint
react_frontend/src/app/api/assistant/route.ts - AI tool-calling
react_frontend/src/app/lib/assistant/openai-client.ts - Assistant data tools
react_frontend/src/app/lib/assistant/tools.ts
Other components
- Customer
- Administrator
- Stripe service
- Spring REST API
- PostgreSQL
Connections 37
- Customer → Booking interface: uses
README.md - Administrator → Admin dashboard: manages
README.md - Booking interface → Room browsing: browses
README.md - Room browsing → Room details: selects room
README.md - Room details → Booking flow: starts booking
README.md - Booking interface → Login and registration: authenticates
README.md - Login and registration → API client: requests
react_frontend/src/app/login/page.tsx - API client → Spring REST API: calls REST
README.md - Spring REST API → Authentication API: routes auth
- Authentication API → JWT security: issues tokens
bookingssystem/src/main/java/steve/bookingssystem/user/Controller/RegistrationLoginController.java - Authentication API → User records: stores accounts
bookingssystem/src/main/java/steve/bookingssystem/user/Controller/RegistrationLoginController.java - Room browsing → API client: loads rooms
- Spring REST API → Room API: routes rooms
- Room API → Room management: manages
- Room management → Room data: reads rooms
bookingssystem/src/main/java/steve/bookingssystem/room/service/RoomService.java - Room details → Booking flow: chooses dates
README.md - Booking flow → API client: submits booking
- Spring REST API → Booking API: routes bookings
- Booking API → Booking rules: handles booking
- Booking rules → Booking records: persists booking
- Booking flow → Discount codes: applies code
- Booking flow → Payment API: starts payment
README.md - Payment API → Payment processing: processes payment
- Payment processing → Stripe Checkout: creates checkout
- Stripe Checkout → Stripe service: uses checkout
README.md - Stripe service → Payment API: reports payment
- Payment processing → Invoice service: creates invoice
README.md - Invoice service → Invoice PDF: generates PDF
README.md - Customer profile → API client: loads account
react_frontend/src/app/profile/page.tsx - Admin dashboard → Dashboard metrics: loads metrics
- Assistant chat → Assistant endpoint: sends question
react_frontend/src/app/assistant/page.tsx - Assistant endpoint → AI tool-calling: asks model
react_frontend/src/app/api/assistant/route.ts - AI tool-calling → Assistant data tools: executes tools
react_frontend/src/app/lib/assistant/openai-client.ts - Assistant data tools → Spring REST API: reads booking data
react_frontend/src/app/lib/assistant/tools.ts - Assistant endpoint → Spring REST API: stores chat history
react_frontend/src/app/api/assistant/route.ts - Spring REST API → PostgreSQL: persists records
README.md - Room API → Room image storage: handles room photos