This is a room booking application built with React for the frontend using Vite as the bundler, and Node.js with MySQL and Sequelize ORM for the backend. It includes a seed script (seed.js) to populate the database with initial data.
room-booking/
│
├── client/ # Frontend directory
│ ├── public/ # Static assets
│ └── src/ # React source code
│
├── server/ # Backend directory
│ ├── config/ # Configuration files
│ ├── controllers/ # API controllers
│ ├── models/ # Sequelize models
│ ├── routes/ # API routes
│ ├── seed.js # Database seeding script
│ └── app.js # Express application entry point
│
└── README.md # Project documentation
-
Clone the repository:
git clone https://github.com/Alomgir27/room-booking.git
-
Install dependencies for both frontend and backend:
cd room-booking/client npm install cd ../server npm install
-
Database Configuration:
- Open
server/config/config.json. - Modify the development object with your MySQL database credentials.
- Open
-
Environment Variables:
- Create a
.envfile in theserverdirectory. - Define environment variables such as
PORTfor the server.
- Create a
-
Migrate the database schema:
cd server npx sequelize-cli db:migrate -
Seed the database with initial data:
npx sequelize-cli db:seed:all
-
Start the backend server:
cd server npm run dev -
Start the frontend development server:
cd client npm run dev -
Access the application at
http://localhost:3000.
- Navigate to
http://localhost:3000in your browser to view the application. - Use the provided functionality to book rooms and manage bookings.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.