An awesome tour booking web app written in NodeJS, Express, MongoDB π½ (NB: This is es6 version but you can find the es5 version in 'es5-version' branch. And as it's free deployed server, could take few moments for first time rendering. Thank you)
Demo β’ Key Features β’ Demonstration β’ How To Use β’ API Usage β’ Deployment β’ Build With β’ To-do β’ Installation β’ Known Bugs β’ Future Updates β’ Acknowledgement
- Card No. : 4242 4242 4242 4242
- Expiry date: 02 / 22
- CVV: 222
Before using the API, you need to set the variables in Postman depending on your environment (development or production). Simply add:
- {{URL}} with your hostname as value (Eg. http://127.0.0.1:3000 or http://www.example.com)
- {{password}} with your user password as value.
Check Natours API Documentation for more info.
API Features:
Tours List ππ» https://lgope-natours.onrender.com/api/v1/tours
Tours State ππ» https://lgope-natours.onrender.com/api/v1/tours/tour-stats
Get Top 5 Cheap Tours ππ» https://lgope-natours.onrender.com/api/v1/tours/top-5-cheap
Get Tours Within Radius ππ» https://lgope-natours.onrender.com/api/v1/tours/tours-within/200/center/34.098453,-118.096327/unit/mi
The website is deployed with git into Heroku. Below are the steps taken:
git init
git add -A
git commit -m "Commit message"
heroku login
heroku create
heroku config:set CONFIG_KEY=CONFIG_VALUE
parcel build ./public/js/index.js --out-dir ./public/js --out-file bundle.js
git push heroku master
heroku open
You can also change your website URL by running this command:
heroku apps: rename natours-users
If you wish to play around with the code base in your local environment, do the following
* Clone this repo to your local machine.
* Using the terminal, navigate to the cloned repo.
* Install all the necessary dependencies, as stipulated in the package.json file.
* If you don't already have one, set up accounts with: MONGODB, MAPBOX, STRIPE, SENDGRID, and MAILTRAP. Please ensure to have at least basic knowledge of how these services work.
* In your .env file, set environment variables for the following:
* DATABASE=your Mongodb database URL
* DATABASE_PASSWORD=your MongoDB password
* SECRET=your JSON web token secret
* JWT_EXPIRES_IN=90d
* JWT_COOKIE_EXPIRES_IN=90
* EMAIL_USERNAME=your mailtrap username
* EMAIL_PASSWORD=your mailtrap password
* EMAIL_HOST=smtp.mailtrap.io
* EMAIL_PORT=2525
* EMAIL_FROM=your real-life email address
* SENDGRID_USERNAME=apikey
* SENDGRID_PASSWORD=your sendgrid password
* STRIPE_SECRET_KEY=your stripe secret key
* STRIPE_WEBHOOK_SECRET=your stripe webhook secret
* Start the server.
* Your app should be running just fine.
.env
file :You can fork the app or you can git-clone the app into your local machine. Once done, please install all the
dependencies by running
$ npm i
Set your env variables
$ npm run watch:js
$ npm run build:js
$ npm run dev (for development)
$ npm run start:prod (for production)
$ npm run debug (for debug)
$ npm start
Setting up ESLint and Prettier in VS Code ππ»
$ npm i eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-config-airbnb eslint-plugin-node
eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react --save-dev
Pull requests are welcome but please open an issue and discuss what you will do before π
Feel free to email me at [email protected] if you run into any issues or have questions, ideas or concerns.
Please enjoy and feel free to share your opinion, constructive criticism, or comments about my work. Thank you! π
This project is open-sourced under the MIT license.
Live demo (Feel free to visit) ππ» : https://lgope-natours.onrender.com/