Chat mode imported from dhanyaacharya123/frontend (
.github/chatmodes/chatbot.chatmode.md). Copyright stays with the author.
Refactor this full-stack service booking application to follow a clean production-ready architecture. The project contains a React frontend and a Spring Boot backend.
Reorganize the folders and update all import paths and package references so the application continues working without breaking functionality.
Target project structure:
service-booking-system │ ├── frontend │ ├── public │ │ └── index.html │ │ │ ├── src │ │ │ │ ├── pages │ │ │ ├── BookingForm.jsx │ │ │ ├── BookingDetailPage.jsx │ │ │ ├── MyOrdersPage.jsx │ │ │ ├── OrderDetailPage.jsx │ │ │ ├── PaymentCheckoutPage.jsx │ │ │ ├── PaymentSuccessPage.jsx │ │ │ ├── PaymentFailurePage.jsx │ │ │ ├── CancellationSuccessPage.jsx │ │ │ ├── RateServicePage.jsx │ │ │ └── ReceiptPage.jsx │ │ │ │ │ ├── components │ │ │ ├── AddAddressDialog.jsx │ │ │ ├── StatusTimeline.jsx │ │ │ └── ImageWithFallback.jsx │ │ │ │ │ ├── ui │ │ │ ├── button.jsx │ │ │ ├── card.jsx │ │ │ ├── badge.jsx │ │ │ ├── input.jsx │ │ │ ├── textarea.jsx │ │ │ ├── calendar.jsx │ │ │ ├── select.jsx │ │ │ ├── dialog.jsx │ │ │ ├── alert.jsx │ │ │ ├── alert-dialog.jsx │ │ │ ├── progress.jsx │ │ │ ├── separator.jsx │ │ │ └── utils.js │ │ │ │ │ ├── services │ │ │ ├── bookingService.js │ │ │ ├── paymentService.js │ │ │ └── ratingService.js │ │ │ │ │ ├── routes │ │ │ └── routes.js │ │ │ │ │ ├── styles │ │ │ └── index.css │ │ │ │ │ ├── App.jsx │ │ └── main.jsx │ │ │ └── package.json │ ├── backend │ │ └── src/main/java/com/servicebooking │ │ ├── controller │ │ ├── BookingController.java │ │ ├── PaymentController.java │ │ ├── OrderController.java │ │ └── RatingController.java │ │ │ ├── service │ │ ├── BookingService.java │ │ ├── PaymentService.java │ │ ├── OrderService.java │ │ └── RatingService.java │ │ │ ├── repository │ │ ├── BookingRepository.java │ │ ├── VendorRepository.java │ │ ├── PaymentRepository.java │ │ └── RatingRepository.java │ │ │ ├── model │ │ ├── Booking.java │ │ ├── Vendor.java │ │ ├── Service.java │ │ ├── Payment.java │ │ ├── Rating.java │ │ └── Address.java │ │ │ ├── dto │ │ ├── BookingRequest.java │ │ ├── PaymentRequest.java │ │ └── RatingRequest.java │ │ │ └── ServiceBookingApplication.java │ ├── database │ └── schema.sql │ └── README.md
Refactoring rules:
Separate frontend and backend into two top-level folders.
Move all React pages into the pages folder.
Move reusable components into components.
Keep design primitives in the ui folder.
Add a services folder for API calls from frontend.
Ensure all React imports update automatically after moving files.
Organize Spring Boot backend using Controller → Service → Repository → Model architecture.
Ensure package names and imports update correctly in backend.
Do not modify existing business logic.
Ensure the project still builds and runs successfully after restructuring.