Add to Base URL above
-
Use the following Endpoints
POST /auth/signupCreate User AccountPOST /auth/signinLogin A UserPOST /dishesCreate a trip (Needs admin priviledges)GET /dishesGet all tripsPOST /bookingsBook a seat on a restaurantGET /bookingsSee all of your bookingsDELETE /bookings/:bookingIdDelete A BookingPATCH /dishes/:dishIdCancel A Dish (Needs admin priviledges)GET /user/seedSeed users table with users with admin rightsPOST /admin/signupAn admin can add new admin (Needs admin priviledges)PUT /user/:id/adminAn admin can give a registered user admin right (Needs admin priviledges)PUT /bookings/:bookingIdUpdate Booking Seat NumberPOST /restaurantsAdd a bus (Needs admin priviledges)GET /restaurantsGet all buses (Needs admin priviledges)GET /dishes/price?price="price"Filter dishes by priceGET /dishes/restaurant?restaurant="restaurantName"Filter trips by restaurant_name -
A successful response will be
{ status: 'success', data: {} }
or
{ status: 'success', data: [] }
and an unsuccessful response will be
{ status: 'error', error: 'relevant-error-message' }
-
NodeJs and Npm (https://nodejs.org/en/download/)
-
PostgreSQL(https://www.postgresql.org/download/)
-
Create a .env file at the project root
RestaurantBackendSystem/.env -
DBeaver: DBeaver is free and open source universal database tool for developers and database administrators. (https://dbeaver.io/download/), this is optional though, you can use any other GUI for postgreSQL.
I would love to hear from anyone that will like to contribute.
Make sure you have latest NodeJs installed locally.
If you want set up locally you can follow these steps, you can also use postman(https://www.getpostman.com/downloads/) to test.
Fork the repository, open terminal in root and do the following on terminal
$ npm installAfter Setting up the database, create database tables running the command below, its advisable to run the command more than once and make sure your database is updated with the tables:
$ npm run create-dev-tablesStart server by running:
$ npm run startSeed Database tables with users(with admin right) by running the command below, its advisable to run it more than once:
$ npm run seed-user-tableor use
GET /user/seed Endpoint
Test endpoints by running:
$ npm run testNone for now.
developed with 💕 by Sammy Mutahi