Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hariyebk/natours
A Tour web app
https://github.com/hariyebk/natours
express jwt-authentication mongoose nodejs restful-api stripe-checkout
Last synced: about 2 months ago
JSON representation
A Tour web app
- Host: GitHub
- URL: https://github.com/hariyebk/natours
- Owner: hariyebk
- License: mit
- Created: 2023-05-31T06:00:13.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-21T09:01:51.000Z (10 months ago)
- Last Synced: 2024-03-21T11:38:50.930Z (10 months ago)
- Topics: express, jwt-authentication, mongoose, nodejs, restful-api, stripe-checkout
- Language: JavaScript
- Homepage:
- Size: 14.8 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Natours
Natours is a Tour web application built as part of my 4-month remote Internship at [Trip.com](https://www.trip.com/). It is powered by a RESTful API and various features such as authentication, security, server-side rendering, credit card payments using Stripe, sending emails, image uploading, and many more. It allows users to book tours of their desire and manage their accounts.
## Public API Endpoints
- `POST api/v1/users/signup`
- `GET api/v1/users/confirmEmail/:token`
- `POST api/v1/users/login`
- `GET api/v1/users/logout`
- `POST api/v1/users/forgotPassword`
- `PATCH api/v1/users/resetPassword`
- `GET api/v1/tours`
- `GET api/v1/tours/:id`
- `GET api/v1/tours/stats`
- `GET api/v1/tours/top-5-tours`
- `GET api/v1/tours/5-most-cheap-tours`
- `GET api/v1/tours/tour-within/:distance/center/:latlng/unit/:unit`
- `GET api/v1/tours/distance/:latlng/unit/:unit`## Private API Endpoints
- `GET api/v1/users/My-tours`
- `GET api/v1/users/My-reviews`
- `PATCH api/v1/users/updateMyPassword`
- `PATCH api/v1/users/updateMe`
- `DELETE api/v1/users/deleteMe`
- `GET api/v1/users/me`
- `GET api/v1/reviews`
- `POST api/v1/reviews`
- `GET api/v1/reviews/:id`
- `GET api/v1/bookings/checkout-session/:id`## Restricted API Endpoints
- `GET api/v1/users`
- `GET api/v1/users/:id`
- `PATCH api/v1/users/:id`
- `DELETE api/v1/users/:id`
- `GET api/v1/tours/monthly-plan/:year?`
- `POST api/v1/tours`
- `DELETE api/v1/tours/:id`
- `PATCH api/v1/tours/:id`
- `DELETE api/v1/reviews`
- `PATCH api/v1/reviews/:id`
- `DELETE api/v1/reviews/:id`
- `POST api/v1/bookings`
- `GET api/v1/bookings`
- `GET api/v1/bookings/:id`
- `PATCH api/v1/bookings/:id`
- `DELETE api/v1/bookings/:id`## API Query Features
- Filter
- sort
- pagination
- limiting fields## Security Features
- HTTP Only Cookies
- Data Sanitization
- Password and Token Encryption
- Rate Limiting
- XSS attack prevention
- Error Handling
## Build With
* [NodeJS](https://nodejs.org/en/) - JS runtime environment
* [Express](http://expressjs.com/) - The web framework used
* [Mongoose](https://mongoosejs.com/) - Object Data Modelling (ODM) library
* [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) - Cloud database service
* [Pug](https://pugjs.org/api/getting-started.html) - High performance template engine
* [JSON Web Token](https://jwt.io/) - Security token
* [ParcelJS](https://parceljs.org/) - Blazing fast, zero configuration web application bundler
* [Stripe](https://stripe.com/) - Online payment API
* [Postman](https://www.getpostman.com/) - API testing
* [Mailtrap](https://mailtrap.io/) - Email delivery platform## Installation
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```
## Contributing
Contributions are welcome and encouraged! To contribute please follow these steps:
1. Fork this repository by clicking on the "Fork" button at the top right corner of the page.
2. Create a new branch: `git checkout -b my-new-feature
3. Make changes to files according to desired feature(s).
4. Commit your changes: `git commit -am 'Add some feature'`.
5. Push to the branch: `git push origin my-new-feature`.
6. Submit a pull request by opening PR in the original repository (not yours)I review all pull requests thoroughly and appreciate every contribution made.
If you find any bugs/issues/errors please create an issue ticket/appropriate category within issues in Github.
## License
This project is licensed under MIT license - see LICENSE.md for more details.
## Project Status
I may continue to improve and add new features to the project over time.