$ npm install
$ npx prisma db seed
.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
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
curl -X POST \
'http://localhost:3000/admin/login' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "info@toursarandariviera.com",
"password": "123456"
}'
curl -X PUT \
'http://localhost:3000/admin/password' \
--header 'Accept: */*' \
--header 'Authorization: Bearer <AUTH_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"password": "..."
}'
curl -X POST \
'http://localhost:3000/account/login' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "<USER_EMAIL>",
"password": "<PASSWORD>"
}'
curl -X POST \
'http://localhost:3000/account/register' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "...",
"email": "...",
"password": "..."
}'
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": ...
}'
curl -X GET \
'http://localhost:3000/book/myBookings' \
--header 'Accept: */*' \
--header 'Authorization: Bearer <AUTH_TOKEN>'
curl -X GET \
'http://localhost:3000/book' \
--header 'Accept: */*' \
--header 'Authorization: Bearer <AUTH_TOKEN>'
curl -X GET \
'http://localhost:3000/tours' \
--header 'Accept: */*' \
--header 'Authorization: Bearer <AUTH_TOKEN>'
curl -X GET \
'http://localhost:3000/tours/id' \
--header 'Accept: */*' \
--header 'Authorization: Bearer <AUTH_TOKEN>'
curl -X PUT \
'http://localhost:3000/tours/id' \
--header 'Accept: */*' \
--header 'Authorization: Bearer <AUTH_TOKEN>'
Nest is MIT licensed.