QuickBook is a simple room booking application where users can book rooms with add-ons like breakfast, airport pickup, and extra bed. It integrates a frontend built with React, and a backend using Node.js with MySQL for storing bookings.
-
Frontend:
- Room booking UI with base price and add-ons.
- Dynamic total calculation based on quantity and selected add-ons.
- Modal confirmation upon booking.
-
Backend:
- Handles POST requests to save bookings.
- Stores booking data (room, quantity, addons, total fare) in a MySQL database.
- React (Vite template)
- Tailwind CSS
- Axios (for API requests)
- Node.js
- Express
- MySQL
- dotenv (for environment variables)
- CORS (Cross-Origin Resource Sharing)
git clone https://github.com/your-username/quickbook-app.git
cd quickbook-appcd backendnpm install- Create a database called
quickbookin MySQL:
CREATE DATABASE quickbook;- Create a table in the
quickbookdatabase:
CREATE TABLE bookings (
id INT AUTO_INCREMENT PRIMARY KEY,
product_name VARCHAR(100),
quantity INT,
addons TEXT,
total_fare DECIMAL(10,2),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);Create a .env file in the backend folder and add the following:
PORT=3000
DB_HOST=localhost
DB_USER=your_mysql_user
DB_PASS=your_mysql_password
DB_NAME=quickbooknode server.jsThis will run the backend on http://localhost:3000.
cd frontendnpm installCreate a .env file in the frontend folder and add:
VITE_API_URL=http://localhost:3000/apinpm run devThis will run the frontend on http://localhost:5173.
- Backend should be running at
http://localhost:3000. - Frontend should be running at
http://localhost:5173.
- Make sure to regenerate any API keys or secrets if you accidentally pushed any sensitive data to GitHub.
- Never commit
.envfiles or any sensitive data to version control. Always add them to.gitignore.
-
Frontend Deployment:
- Deploy to Netlify or Vercel for production.
-
Backend Deployment:
- Deploy the backend to Railway or Heroku.
- Configure the production database credentials in
.envbefore deployment.
Feel free to fork the repo, submit issues, or open pull requests. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.