A restaurant reservation booking app. Scaled the backend of the reviews microservice to handle +2400 RPS over +100M rows at under 50 ms latency.
- Postgres as primary data store
- Redis for in-memory caching
- Load balancer server pointing to multiple EC2 instances of the application
- Front end: ReactJS
- Back end: Node/Express, Postgres, Redis, AWS EC2
- https://github.com/lmwy-labs/Main-Gallery
- https://github.com/lmwy-labs/Main-Menu
- https://github.com/lmwy-labs/Main-Reviews
- Usage
- Requirements
- Development
- [CRUD APIs](CRUD APIs)
Install node modules using npm install.
Initialize Postgres schema and generate dummy data for 10M restaurants and 100M reservations.
npm run sql
npm run seed
Launch webpack and host server.
npm run build:dev
npm run start:dev
This component uses port 3003, with the global component name Reservation.
An nvmrc
file is included if using nvm.
- Node 6.13.0
- etc
From within the root directory:
npm install
Creates a new reservation for the given restaurant_id, reservation_date, reservation_time, and party_size.
POST /api/restaurants/1/reservations
{
"reservation_datetime": "2019-09-02 13:00:00",
"seats": 3,
}
{
"id": "123",
"restaurant_id": "r1",
"reservation_datetime": "2019-09-02 13:00:00",
"seats": 3,
}
Retrieves a list of available reservation times for the given restaurant_id, reservation_date, reservation_time, and party_size.
GET /api/restaurants/:restaurantId/availability/date={reservation_date}&time={reservation_time}&seats={party_size}
GET /api/restaurants/1/availability/date=2019-09-12&time=19:00&seats=3
["19:00", "19:30", "20:00"]
Updates an existing reservation's party size given the reservation_id.
PATCH /api/restaurants/1/reservations/111
{
"num_reserved_seats": 3,
}
{
"reservation_id": 111,
"seats": 3,
}
Deletes the reservation given the reservation_id.