{"id":21162433,"url":"https://github.com/lgope/natours","last_synced_at":"2025-07-09T14:32:43.695Z","repository":{"id":38969305,"uuid":"226864607","full_name":"lgope/Natours","owner":"lgope","description":"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)","archived":false,"fork":false,"pushed_at":"2023-11-23T04:05:48.000Z","size":34088,"stargazers_count":129,"open_issues_count":1,"forks_count":51,"subscribers_count":11,"default_branch":"natours-v2","last_synced_at":"2024-04-14T21:31:38.219Z","etag":null,"topics":["compression","cors","css3","express-mongo-sanitize","express-rate-limit","expressjs","helmet","javascript","json-web-token","mongodb-atlas","mongoose","morgan","multer","nodejs","nodemailer","parceljs","pug-template-engine","stripe-api","validator","xss-clean"],"latest_commit_sha":null,"homepage":"https://lgope-natours.onrender.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lgope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-09T12:20:47.000Z","updated_at":"2024-04-10T06:30:40.000Z","dependencies_parsed_at":"2023-02-17T08:00:53.298Z","dependency_job_id":"ff411e93-041d-4b98-9a08-a71c4cce2dca","html_url":"https://github.com/lgope/Natours","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgope%2FNatours","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgope%2FNatours/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgope%2FNatours/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lgope%2FNatours/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lgope","download_url":"https://codeload.github.com/lgope/Natours/tar.gz/refs/heads/natours-v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225565149,"owners_count":17489141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","cors","css3","express-mongo-sanitize","express-rate-limit","expressjs","helmet","javascript","json-web-token","mongodb-atlas","mongoose","morgan","multer","nodejs","nodemailer","parceljs","pug-template-engine","stripe-api","validator","xss-clean"],"created_at":"2024-11-20T13:29:01.033Z","updated_at":"2024-11-20T13:29:01.606Z","avatar_url":"https://github.com/lgope.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://lakshman-natours.herokuapp.com/\"\u003e\u003cimg src=\"https://github.com/lgope/Natours/blob/master/public/img/logo-green-round.png\" alt=\"Natours\" width=\"200\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  Natours\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eAn awesome tour booking site built on top of \u003ca href=\"https://nodejs.org/en/\" target=\"_blank\"\u003eNodeJS\u003c/a\u003e.\u003c/h4\u003e\n\n \u003cp align=\"center\"\u003e\n \u003ca href=\"#deployed-version\"\u003eDemo\u003c/a\u003e •\n  \u003ca href=\"#key-features\"\u003eKey Features\u003c/a\u003e •\n  \u003ca href=\"#demonstration\"\u003eDemonstration\u003c/a\u003e •\n  \u003ca href=\"#how-to-use\"\u003eHow To Use\u003c/a\u003e •\n  \u003ca href=\"#api-usage\"\u003eAPI Usage\u003c/a\u003e •\n  \u003ca href=\"#deployment\"\u003eDeployment\u003c/a\u003e •\n  \u003ca href=\"#build-with\"\u003eBuild With\u003c/a\u003e •\n  \u003ca href=\"#to-do\"\u003eTo-do\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e • \n  \u003ca href=\"#known-bugs\"\u003eKnown Bugs\u003c/a\u003e • \n  \u003ca href=\"#future-updates\"\u003eFuture Updates\u003c/a\u003e • \n  \u003ca href=\"#acknowledgement\"\u003eAcknowledgement\u003c/a\u003e\n\u003c/p\u003e\n\n## Key Features 📝\n\n- Authentication and Authorization\n  - Sign up, Log in, Logout, Update, and reset password.\n- User profile\n  - Update username, photo, email, password, and other information\n  - A user can be either a regular user or an admin or a lead guide or a guide.\n  - When a user signs up, that user by default regular user.\n- Tour\n  - Manage booking, check tour map, check users' reviews and rating\n  - Tours can be created by an admin user or a lead-guide.\n  - Tours can be seen by every user.\n  - Tours can be updated by an admin user or a lead guide.\n  - Tours can be deleted by an admin user or a lead-guide.\n- Bookings\n  - Only regular users can book tours (make a payment).\n  - Regular users can not book the same tour twice.\n  - Regular users can see all the tours they have booked.\n  - An admin user or a lead guide can see every booking on the app.\n  - An admin user or a lead guide can delete any booking.\n  - An admin user or a lead guide can create a booking (manually, without payment).\n  - An admin user or a lead guide can not create a booking for the same user twice.\n  - An admin user or a lead guide can edit any booking.\n- Reviews\n  - Only regular users can write reviews for tours that they have booked.\n  - All users can see the reviews of each tour.\n  - Regular users can edit and delete their own reviews.\n  - Regular users can not review the same tour twice.\n  - An admin can delete any review.\n- Favorite Tours\n  - A regular user can add any of their booked tours to their list of favorite tours.\n  - A regular user can remove a tour from their list of favorite tours.\n  - A regular user can not add a tour to their list of favorite tours when it is already a favorite.\n- Credit card Payment\n\n## Demonstration 🖥️\n\n#### Home Page :\n\n![natoursHomePageonline-video-cutt](https://user-images.githubusercontent.com/58518192/72606801-7ebe0680-3949-11ea-8e88-613f022a64e5.gif)\n\n#### Tour Details :\n\n![tourOverviewonline-video-cutterc](https://user-images.githubusercontent.com/58518192/72606859-a0b78900-3949-11ea-8f0d-ef44c789957b.gif)\n\n#### Payment Process :\n\n![paymentprocess-1-ycnhrceamp4-7fW](https://user-images.githubusercontent.com/58518192/72606973-d9eff900-3949-11ea-9a2e-f84a6581bef3.gif)\n\n#### Booked Tours :\n\n![rsz_bookedtours](https://user-images.githubusercontent.com/58518192/72607747-6a7b0900-394b-11ea-8b9f-5330531ca2eb.png)\n\n#### User Profile :\n\n![rsz_userprofile](https://user-images.githubusercontent.com/58518192/72607635-44edff80-394b-11ea-8943-64c48f6f19aa.png)\n\n#### Admin Profile :\n\n![rsz_adminprofile](https://user-images.githubusercontent.com/58518192/72607648-4d463a80-394b-11ea-972f-a73160cfaa5b.png)\n\n## How To Use 🤔\n\n### Book a tour\n\n- Login to the site\n- Search for tours that you want to book\n- Book a tour\n- Proceed to the payment checkout page\n- Enter the card details (Test Mood):\n  ```\n  - Card No. : 4242 4242 4242 4242\n  - Expiry date: 02 / 22\n  - CVV: 222\n  ```\n- Finished!\n\n### Manage your booking\n\n- Check the tour you have booked on the \"Manage Booking\" page in your user settings. You'll be automatically redirected to this\n  page after you have completed the booking.\n\n### Update your profile\n\n- You can update your own username, profile photo, email, and password.\n\n## API Usage\n\nBefore using the API, you need to set the variables in Postman depending on your environment (development or production). Simply add:\n\n```\n- {{URL}} with your hostname as value (Eg. http://127.0.0.1:3000 or http://www.example.com)\n- {{password}} with your user password as value.\n```\n\nCheck [Natours API Documentation](https://documenter.getpostman.com/view/8893042/SW7c37V6) for more info.\n\n\u003cb\u003e API Features: \u003c/b\u003e\n\nTours List 👉🏻 https://lgope-natours.onrender.com/api/v1/tours\n\nTours State 👉🏻 https://lgope-natours.onrender.com/api/v1/tours/tour-stats\n\nGet Top 5 Cheap Tours 👉🏻 https://lgope-natours.onrender.com/api/v1/tours/top-5-cheap\n\nGet Tours Within Radius 👉🏻 https://lgope-natours.onrender.com/api/v1/tours/tours-within/200/center/34.098453,-118.096327/unit/mi\n\n## Deployment 🌍\n\nThe website is deployed with git into Heroku. Below are the steps taken:\n\n```\ngit init\ngit add -A\ngit commit -m \"Commit message\"\nheroku login\nheroku create\nheroku config:set CONFIG_KEY=CONFIG_VALUE\nparcel build ./public/js/index.js --out-dir ./public/js --out-file bundle.js\ngit push heroku master\nheroku open\n```\n\nYou can also change your website URL by running this command:\n\n```\nheroku apps: rename natours-users\n```\n\n## Build With 🏗️\n\n- [NodeJS](https://nodejs.org/en/) - JS runtime environment\n- [Express](http://expressjs.com/) - The web framework used\n- [Mongoose](https://mongoosejs.com/) - Object Data Modelling (ODM) library\n- [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) - Cloud database service\n- [Pug](https://pugjs.org/api/getting-started.html) - High performance template engine\n- [JSON Web Token](https://jwt.io/) - Security token\n- [ParcelJS](https://parceljs.org/) - Blazing fast, zero configuration web application bundler\n- [Stripe](https://stripe.com/) - Online payment API and Making payments on the app.\n- [Postman](https://www.getpostman.com/) - API testing\n- [Mailtrap](https://mailtrap.io/) \u0026 [Sendgrid](https://sendgrid.com/) - Email delivery platform\n- [Heroku](https://www.heroku.com/) - Cloud platform\n- [Mapbox](https://www.mapbox.com/) - Displaying the different locations of each tour.\n\n## To-do 🗒️\n\n- Review and rating\n  - Allow users to add a review directly at the website after they have taken a tour\n- Booking\n  - Prevent duplicate bookings after a user has booked that exact tour, implement favorite tours\n- Advanced authentication features\n  - Signup, confirm user email, log in with refresh token, two-factor authentication\n- And More! There's always room for improvement!\n\n## Setting Up Your Local Environment ⚙️\n\nIf you wish to play around with the code base in your local environment, do the following\n\n```\n* Clone this repo to your local machine.\n* Using the terminal, navigate to the cloned repo.\n* Install all the necessary dependencies, as stipulated in the package.json file.\n* 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.\n* In your .env file, set environment variables for the following:\n    * DATABASE=your Mongodb database URL\n    * DATABASE_PASSWORD=your MongoDB password\n\n    * SECRET=your JSON web token secret\n    * JWT_EXPIRES_IN=90d\n    * JWT_COOKIE_EXPIRES_IN=90\n\n    * EMAIL_USERNAME=your mailtrap username\n    * EMAIL_PASSWORD=your mailtrap password\n    * EMAIL_HOST=smtp.mailtrap.io\n    * EMAIL_PORT=2525\n    * EMAIL_FROM=your real-life email address\n\n    * SENDGRID_USERNAME=apikey\n    * SENDGRID_PASSWORD=your sendgrid password\n\n    * STRIPE_SECRET_KEY=your stripe secret key\n    * STRIPE_WEBHOOK_SECRET=your stripe webhook secret\n\n* Start the server.\n* Your app should be running just fine.\n```\n\n#### Demo-`.env` file :\n\n![demo-env-file](https://github.com/lgope/Natours/assets/58518192/cf5b833f-2a48-48a1-aeb3-5ffea8967e33)\n\n## Installation 🛠️\n\nYou can fork the app or you can git-clone the app into your local machine. Once done, please install all the\ndependencies by running\n\n```\n$ npm i\nSet your env variables\n$ npm run watch:js\n$ npm run build:js\n$ npm run dev (for development)\n$ npm run start:prod (for production)\n$ npm run debug (for debug)\n$ npm start\nSetting up ESLint and Prettier in VS Code 👇🏻\n$ npm i eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-config-airbnb eslint-plugin-node\neslint-plugin-import eslint-plugin-jsx-a11y  eslint-plugin-react --save-dev\n```\n\n## Contributing 💡\n\nPull requests are welcome but please open an issue and discuss what you will do before 😊\n\n## Known Bugs 🚨\n\nFeel free to email me at lakshman.gope2@gmail.com if you run into any issues or have questions, ideas or concerns.\nPlease enjoy and feel free to share your opinion, constructive criticism, or comments about my work. Thank you! 🙂\n\n## Future Updates 🪴\n\n- Enable PWA\n- Improve overall UX/UI and fix bugs\n- Featured Tours\n- Recently Viewed Tours\n- And More! There's always room for improvement!\n\n## License 📄\n\nThis project is open-sourced under the [MIT license](https://opensource.org/licenses/MIT).\n\n## Deployed Version 🚀\n\nLive demo (Feel free to visit) 👉🏻 : https://lgope-natours.onrender.com/\n\n## Acknowledgement 🙏🏻\n\n- This project is part of the online course I've taken at Udemy. Thanks to Jonas Schmedtmann for creating this awesome course! Link to the course: [Node.js, Express, MongoDB \u0026 More: The Complete Bootcamp 2019](https://www.udemy.com/course/nodejs-express-mongodb-bootcamp/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgope%2Fnatours","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flgope%2Fnatours","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flgope%2Fnatours/lists"}