A nvmrc file is inlcuded if using nvm
- Node 12.14.0
A completed CRUD api using the inherited database (MongoDB) is present in the at the commit tagged, crud. To get there:
git checkout crud- GET
/restaurant/all- Get data for all restaurants - GET
/restaurant/:restaurantId- Get data for a restaurant - POST
/restaurant- Create a restaurant - PUT
/restaurant/:restaurantId- Update a restaurant - DELETE `/restaurant/:restaurantId - Delete a restaurant
- GET
/reservation/all- Get all reservations at all restaurants - POST
/reservation- Create a new reservation - PUT
/reservation/:reservationId- Update an existing reservation - DELETE
/reservation/:reservationId- Delete an existing reservation
- GET
/mapper/all- Get all mappers (locations with restaurant id) - GET
/mapper/:restaurantId- Get mapper for a restaurant - POST
/mapper/- Create a mapper - PUT
/mapper/:restaurantId- Update mapper for a restaurant - DELETE
/mapper/:restaurantId- Delete mapper for a restaurant
Seeding functionality is available at the commit tagged, psql-seed To get there:
git checkout psql-seedTo run the seeding script, you'll need to have PostgreSQL installed with a user and database for this project. Create a config file to make it all work:
cp psql/config/psql.config.example.js psql/config/psql.config.js...then open up that file and fill in the blanks.
Next, generate some data files, populate the database, and then remove those data files:
npm run csv10M
npm run psql:seedYou can specify a number other than the 10,000,000 primary records this will generate. Get some usage instructions:
node dataGeneration/generate.jsAlternatively, you can skip seeding and just prepare an empty database:
npm run psql:schema