Skip to content

Browse, book, and embark on your next adventure hassle-free.

Notifications You must be signed in to change notification settings

Renc17/RivieraTour

Repository files navigation

Nest Logo

Installation

$ npm install
$ npx prisma db seed

Build

  .env

  DATABASE_URL="postgresql://user:password@localhost:5432/database?schema=public"
  SECRET_TOKEN="<SOME_TOKEN>"
  ADMIN_PASSWORD="<SOME_PASSWORD>"

  # mail
  MAIL_HOST=smtp.gmail.com
  MAIL_USER=sarandariviera442@gmail.com
  MAIL_PASSWORD=makina123aA
  MAIL_FROM=noreply@gmail.com

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

API Calls

Admin Login

  curl -X POST \
    'http://localhost:3000/admin/login' \
    --header 'Accept: */*' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "email": "info@toursarandariviera.com",
      "password": "123456"
  }'

Admin Change Password

  curl -X PUT \
    'http://localhost:3000/admin/password' \
    --header 'Accept: */*' \
    --header 'Authorization: Bearer <AUTH_TOKEN>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "password": "..."
  }'

User Login

  curl -X POST \
    'http://localhost:3000/account/login' \
    --header 'Accept: */*' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "email": "<USER_EMAIL>",
      "password": "<PASSWORD>"
  }'

User Register

  curl -X POST \
    'http://localhost:3000/account/register' \
    --header 'Accept: */*' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "username": "...",
      "email": "...",
      "password": "..."
  }'

Auth User Book Tour

  curl -X POST \
    'http://localhost:3000/book/tour' \
    --header 'Accept: */*' \
    --header 'Authorization: Bearer <AUTH_TOKEN>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "tourId": "<uuid_of_tour>",
      "email": "...@gmail.com",
      "date": {
          "day": "16",
          "month": "JUNE"
      },
      "name": "...",
      "adults": ...,
      "children": ...
  }'

Auth User Get Bookings

  curl -X GET \
    'http://localhost:3000/book/myBookings' \
    --header 'Accept: */*' \
    --header 'Authorization: Bearer <AUTH_TOKEN>'

Admin Get All Bookings

  curl -X GET \
    'http://localhost:3000/book' \
    --header 'Accept: */*' \
    --header 'Authorization: Bearer <AUTH_TOKEN>'

Admin Get All Tours

  curl -X GET \
    'http://localhost:3000/tours' \
    --header 'Accept: */*' \
    --header 'Authorization: Bearer <AUTH_TOKEN>'

Admin Get Tour By UUID

curl -X GET \
  'http://localhost:3000/tours/id' \
  --header 'Accept: */*' \
  --header 'Authorization: Bearer <AUTH_TOKEN>'

Admin Reset Seats Capacity

  curl -X PUT \
    'http://localhost:3000/tours/id' \
    --header 'Accept: */*' \
    --header 'Authorization: Bearer <AUTH_TOKEN>'

License

Nest is MIT licensed.

About

Browse, book, and embark on your next adventure hassle-free.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published