Skip to content

Commit 424a06f

Browse files
committed
fixed Heroku deploy issue and updated to es6 module
1 parent 1edd5df commit 424a06f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+789
-622
lines changed

.eslintrc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
"no-return-await": "off",
1414
"no-underscore-dangle": "off",
1515
"class-methods-use-this": "off",
16-
"dot-notation":"warn",
16+
"dot-notation": "warn",
1717
"prefer-destructuring": ["error", { "object": true, "array": false }],
1818
"no-unused-vars": ["error", { "argsIgnorePattern": "req|res|next|val" }],
19-
"arrow-body-style": ["error", "always"]
19+
"arrow-body-style": ["error", "always"],
20+
"avoidEscape": false
2021
}
2122
}

.prettierrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"singleQuote": true,
2+
"singleQuote": false,
33
"printWidth": 100,
44
"semi": true
5-
}
5+
}

README.md

+62-54
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525

2626
## Key Features 📝
2727

28-
* Authentication and Authorization
28+
- Authentication and Authorization
2929
- Sign up, Log in, Logout, Update, and reset password.
30-
* User profile
30+
- User profile
3131
- Update username, photo, email, password, and other information
3232
- A user can be either a regular user or an admin or a lead guide or a guide.
3333
- When a user signs up, that user by default regular user.
34-
* Tour
34+
- Tour
3535
- Manage booking, check tour map, check users' reviews and rating
3636
- Tours can be created by an admin user or a lead-guide.
3737
- Tours can be seen by every user.
3838
- Tours can be updated by an admin user or a lead guide.
3939
- Tours can be deleted by an admin user or a lead-guide.
40-
* Bookings
40+
- Bookings
4141
- Only regular users can book tours (make a payment).
4242
- Regular users can not book the same tour twice.
4343
- Regular users can see all the tours they have booked.
@@ -46,74 +46,77 @@
4646
- An admin user or a lead guide can create a booking (manually, without payment).
4747
- An admin user or a lead guide can not create a booking for the same user twice.
4848
- An admin user or a lead guide can edit any booking.
49-
* Reviews
49+
- Reviews
5050
- Only regular users can write reviews for tours that they have booked.
5151
- All users can see the reviews of each tour.
5252
- Regular users can edit and delete their own reviews.
5353
- Regular users can not review the same tour twice.
5454
- An admin can delete any review.
55-
* Favorite Tours
55+
- Favorite Tours
5656
- A regular user can add any of their booked tours to their list of favorite tours.
5757
- A regular user can remove a tour from their list of favorite tours.
5858
- A regular user can not add a tour to their list of favorite tours when it is already a favorite.
59-
* Credit card Payment
60-
59+
- Credit card Payment
6160

6261
## Demonstration 🖥️
62+
6363
#### Home Page :
64+
6465
![natoursHomePageonline-video-cutt](https://user-images.githubusercontent.com/58518192/72606801-7ebe0680-3949-11ea-8e88-613f022a64e5.gif)
6566

6667
#### Tour Details :
68+
6769
![tourOverviewonline-video-cutterc](https://user-images.githubusercontent.com/58518192/72606859-a0b78900-3949-11ea-8f0d-ef44c789957b.gif)
6870

6971
#### Payment Process :
72+
7073
![paymentprocess-1-ycnhrceamp4-7fW](https://user-images.githubusercontent.com/58518192/72606973-d9eff900-3949-11ea-9a2e-f84a6581bef3.gif)
7174

7275
#### Booked Tours :
73-
![rsz_bookedtours](https://user-images.githubusercontent.com/58518192/72607747-6a7b0900-394b-11ea-8b9f-5330531ca2eb.png)
7476

77+
![rsz_bookedtours](https://user-images.githubusercontent.com/58518192/72607747-6a7b0900-394b-11ea-8b9f-5330531ca2eb.png)
7578

7679
#### User Profile :
80+
7781
![rsz_userprofile](https://user-images.githubusercontent.com/58518192/72607635-44edff80-394b-11ea-8943-64c48f6f19aa.png)
7882

7983
#### Admin Profile :
80-
![rsz_adminprofile](https://user-images.githubusercontent.com/58518192/72607648-4d463a80-394b-11ea-972f-a73160cfaa5b.png)
8184

85+
![rsz_adminprofile](https://user-images.githubusercontent.com/58518192/72607648-4d463a80-394b-11ea-972f-a73160cfaa5b.png)
8286

8387
## How To Use 🤔
8488

8589
### Book a tour
86-
* Login to the site
87-
* Search for tours that you want to book
88-
* Book a tour
89-
* Proceed to the payment checkout page
90-
* Enter the card details (Test Mood):
90+
91+
- Login to the site
92+
- Search for tours that you want to book
93+
- Book a tour
94+
- Proceed to the payment checkout page
95+
- Enter the card details (Test Mood):
9196
```
9297
- Card No. : 4242 4242 4242 4242
9398
- Expiry date: 02 / 22
9499
- CVV: 222
95100
```
96-
* Finished!
97-
98-
101+
- Finished!
99102

100103
### Manage your booking
101104

102-
* Check the tour you have booked on the "Manage Booking" page in your user settings. You'll be automatically redirected to this
105+
- Check the tour you have booked on the "Manage Booking" page in your user settings. You'll be automatically redirected to this
103106
page after you have completed the booking.
104107

105108
### Update your profile
106109

107-
* You can update your own username, profile photo, email, and password.
110+
- You can update your own username, profile photo, email, and password.
108111

112+
## API Usage
109113

114+
Before using the API, you need to set the variables in Postman depending on your environment (development or production). Simply add:
110115

111-
## API Usage
112-
Before using the API, you need to set the variables in Postman depending on your environment (development or production). Simply add:
113-
```
114-
- {{URL}} with your hostname as value (Eg. http://127.0.0.1:3000 or http://www.example.com)
115-
- {{password}} with your user password as value.
116-
```
116+
```
117+
- {{URL}} with your hostname as value (Eg. http://127.0.0.1:3000 or http://www.example.com)
118+
- {{password}} with your user password as value.
119+
```
117120

118121
Check [Natours API Documentation](https://documenter.getpostman.com/view/8893042/SW7c37V6) for more info.
119122

@@ -127,10 +130,10 @@ Get Top 5 Cheap Tours 👉🏻 https://lgope-natours.onrender.com/api/v1/tours/t
127130

128131
Get Tours Within Radius 👉🏻 https://lgope-natours.onrender.com/api/v1/tours/tours-within/200/center/34.098453,-118.096327/unit/mi
129132

130-
131-
132133
## Deployment 🌍
134+
133135
The website is deployed with git into Heroku. Below are the steps taken:
136+
134137
```
135138
git init
136139
git add -A
@@ -142,38 +145,37 @@ parcel build ./public/js/index.js --out-dir ./public/js --out-file bundle.js
142145
git push heroku master
143146
heroku open
144147
```
148+
145149
You can also change your website URL by running this command:
150+
146151
```
147152
heroku apps: rename natours-users
148153
```
149154

150-
151155
## Build With 🏗️
152156

153-
* [NodeJS](https://nodejs.org/en/) - JS runtime environment
154-
* [Express](http://expressjs.com/) - The web framework used
155-
* [Mongoose](https://mongoosejs.com/) - Object Data Modelling (ODM) library
156-
* [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) - Cloud database service
157-
* [Pug](https://pugjs.org/api/getting-started.html) - High performance template engine
158-
* [JSON Web Token](https://jwt.io/) - Security token
159-
* [ParcelJS](https://parceljs.org/) - Blazing fast, zero configuration web application bundler
160-
* [Stripe](https://stripe.com/) - Online payment API and Making payments on the app.
161-
* [Postman](https://www.getpostman.com/) - API testing
162-
* [Mailtrap](https://mailtrap.io/) & [Sendgrid](https://sendgrid.com/) - Email delivery platform
163-
* [Heroku](https://www.heroku.com/) - Cloud platform
164-
* [Mapbox](https://www.mapbox.com/) - Displaying the different locations of each tour.
165-
166-
157+
- [NodeJS](https://nodejs.org/en/) - JS runtime environment
158+
- [Express](http://expressjs.com/) - The web framework used
159+
- [Mongoose](https://mongoosejs.com/) - Object Data Modelling (ODM) library
160+
- [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) - Cloud database service
161+
- [Pug](https://pugjs.org/api/getting-started.html) - High performance template engine
162+
- [JSON Web Token](https://jwt.io/) - Security token
163+
- [ParcelJS](https://parceljs.org/) - Blazing fast, zero configuration web application bundler
164+
- [Stripe](https://stripe.com/) - Online payment API and Making payments on the app.
165+
- [Postman](https://www.getpostman.com/) - API testing
166+
- [Mailtrap](https://mailtrap.io/) & [Sendgrid](https://sendgrid.com/) - Email delivery platform
167+
- [Heroku](https://www.heroku.com/) - Cloud platform
168+
- [Mapbox](https://www.mapbox.com/) - Displaying the different locations of each tour.
167169

168170
## To-do 🗒️
169171

170-
* Review and rating
172+
- Review and rating
171173
- Allow users to add a review directly at the website after they have taken a tour
172-
* Booking
174+
- Booking
173175
- Prevent duplicate bookings after a user has booked that exact tour, implement favorite tours
174-
* Advanced authentication features
176+
- Advanced authentication features
175177
- Signup, confirm user email, log in with refresh token, two-factor authentication
176-
* And More! There's always room for improvement!
178+
- And More! There's always room for improvement!
177179

178180
## Setting Up Your Local Environment ⚙️
179181

@@ -209,12 +211,14 @@ If you wish to play around with the code base in your local environment, do the
209211
```
210212

211213
#### Demo-`.env` file :
212-
![demo-env-file](https://github.com/lgope/Natours/assets/58518192/cf5b833f-2a48-48a1-aeb3-5ffea8967e33)
213214

215+
![demo-env-file](https://github.com/lgope/Natours/assets/58518192/cf5b833f-2a48-48a1-aeb3-5ffea8967e33)
214216

215217
## Installation 🛠️
218+
216219
You can fork the app or you can git-clone the app into your local machine. Once done, please install all the
217220
dependencies by running
221+
218222
```
219223
$ npm i
220224
Set your env variables
@@ -230,26 +234,30 @@ eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react --save-dev
230234
```
231235

232236
## Contributing 💡
237+
233238
Pull requests are welcome but please open an issue and discuss what you will do before 😊
234239

235240
## Known Bugs 🚨
241+
236242
Feel free to email me at [email protected] if you run into any issues or have questions, ideas or concerns.
237243
Please enjoy and feel free to share your opinion, constructive criticism, or comments about my work. Thank you! 🙂
238244

239245
## Future Updates 🪴
240246

241-
* Enable PWA
242-
* Improve overall UX/UI and fix bugs
243-
* Featured Tours
244-
* Recently Viewed Tours
245-
* And More! There's always room for improvement!
247+
- Enable PWA
248+
- Improve overall UX/UI and fix bugs
249+
- Featured Tours
250+
- Recently Viewed Tours
251+
- And More! There's always room for improvement!
246252

247253
## License 📄
254+
248255
This project is open-sourced under the [MIT license](https://opensource.org/licenses/MIT).
249256

250257
## Deployed Version 🚀
258+
251259
Live demo (Feel free to visit) 👉🏻 : https://lgope-natours.onrender.com/
252260

253261
## Acknowledgement 🙏🏻
254262

255-
* 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 & More: The Complete Bootcamp 2019](https://www.udemy.com/course/nodejs-express-mongodb-bootcamp/)
263+
- 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 & More: The Complete Bootcamp 2019](https://www.udemy.com/course/nodejs-express-mongodb-bootcamp/)

0 commit comments

Comments
 (0)