The Restaurant Reservation System is designed to streamline the process of booking tables and managing reservations in a restaurant. It allows restaurant staff to easily manage reservations and table assignments. Users can create, edit, and cancel reservations, as well as seat guests at tables. The system provides a clear overview of the reservations for any given day and the status of tables, improving the efficiency and organization of the restaurant.
- Frontend: React, HTML, CSS
- Backend: Node.js, Express
- Database: PostgreSQL
- Others: Fetch for API calls, Bootstrap for styling
- Clone the repository:
git clone https://github.com/halbert-anderson/final-restaurant-reservation
cd final-restaurant-reservation- Install dependencies:
npm install- Set up environment variables:
PORT=5001
DATABASE_URL=your-database-url- Run the application:
npm start- Open your browser
Go to http://localhost:3000 to view the application. You can access the live application here.
- Development:
http://localhost:5001 - Production:
https://final-restaurant-reservation-system-9mjb.onrender.com
-
Get All Reservations
- URL:
/api/reservations - Method:
GET - Description: Retrieves all reservations.
- Response:
{ "data": [ { "reservation_id": 1, "first_name": "John", "last_name": "Doe", "mobile_number": "1234567890", "reservation_date": "2024-07-16", "reservation_time": "19:00", "people": 4, "status": "booked" }, ... ] }
- URL:
-
Create Reservation
- URL:
/api/reservations - Method:
POST - Description: Creates a new reservation.
- Request Body:
{ "data": { "first_name": "John", "last_name": "Doe", "mobile_number": "1234567890", "reservation_date": "2024-07-16", "reservation_time": "19:00", "people": 4 } } - Response:
{ "data": { "reservation_id": 1, "first_name": "John", "last_name": "Doe", "mobile_number": "1234567890", "reservation_date": "2024-07-16", "reservation_time": "19:00", "people": 4, "status": "booked" } }
- URL:
-
Update Reservation
- URL:
/api/reservations/:reservation_id - Method:
PUT - Description: Updates an existing reservation.
- Request Body:
{ "data": { "first_name": "John", "last_name": "Doe", "mobile_number": "1234567890", "reservation_date": "2024-07-16", "reservation_time": "19:00", "people": 4, "status": "seated" } } - Response:
{ "data": { "reservation_id": 1, "first_name": "John", "last_name": "Doe", "mobile_number": "1234567890", "reservation_date": "2024-07-16", "reservation_time": "19:00", "people": 4, "status": "seated" } }
- URL:
-
Update Reservation Status
- URL:
/api/reservations/:reservation_id/status - Method:
PUT - Description: Updates the status of a reservation.
- Request Body:
{ "data": { "status": "cancelled" } } - Response:
{ "data": { "reservation_id": 1, "status": "cancelled" } }
- URL:
-
Get All Tables
- URL:
/api/tables - Method:
GET - Description: Retrieves all tables.
- Response:
{ "data": [ { "table_id": 1, "table_name": "Table 1", "capacity": 4, "reservation_id": null }, ... ] }
- URL:
-
Create Table
- URL:
/api/tables - Method:
POST - Description: Creates a new table.
- Request Body:
{ "data": { "table_name": "Table 1", "capacity": 4 } } - Response:
{ "data": { "table_id": 1, "table_name": "Table 1", "capacity": 4, "reservation_id": null } }
- URL:
-
Seat Reservation
- URL:
/api/tables/:table_id/seat - Method:
PUT - Description: Seats a reservation at a table.
- Request Body:
{ "data": { "reservation_id": 1 } } - Response:
{ "data": { "table_id": 1, "reservation_id": 1, "status": "seated" } }
- URL:
-
Clear Table
- URL:
/api/tables/:table_id/seat - Method:
DELETE - Description: Clears a table, marking it as free.
- Response:
{ "data": { "status": "finished" } }
- URL:




