Natours is a comprehensive tour booking application built using Node.js, Express, and MongoDB. It was developed as part of Jonas Schmedtmann's Node.js course on Udemy. The application serves as a backend project to demonstrate advanced Node.js concepts, RESTful APIs, authentication, and deployment techniques.
- RESTful API: Built following best practices for designing RESTful APIs.
- Authentication and Authorization:
- JWT-based authentication.
- Role-based access control for users, guides, and admins.
- Tour Management:
- CRUD operations for tours.
- Geo-spatial queries to find tours within a specific radius.
- User Management:
- Secure sign-up and login.
- Password reset via email.
- Advanced Features:
- Data sanitization and rate limiting for enhanced security.
- Aggregation pipelines for advanced data filtering and statistics.
- Stripe integration for secure payments.
- Deployment: NOT YET 😶
The project utilizes modern web technologies:
- Backend: Node.js, Express.js
- Database: MongoDB (with Mongoose)
- Authentication: JSON Web Tokens (JWT), bcrypt.js
- Payment Integration: Stripe
- Email: Nodemailer with SendGrid
- Development Tools: ESLint, Prettier, Postman for API testing
-
Clone the repository:
git clone https://github.com/abderrahmanebnd/4-nutorous.git cd 4-nutorous -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory and add the following keys:NODE_ENV=development PORT=3000 DATABASE=<your-mongodb-connection-string> DATABASE_PASSWORD=<your-database-password> JWT_SECRET=<your-jwt-secret> JWT_EXPIRES_IN=90d JWT_COOKIE_EXPIRES_IN=90 EMAIL_USERNAME=<your-email-username> EMAIL_PASSWORD=<your-email-password> EMAIL_HOST=smtp.mailtrap.io EMAIL_PORT = 25
-
Run the development server:
npm run start:dev
- Users: Sign up, log in, book tours, and manage bookings.
- Admin: Manage users, tours, reviews, and bookings.
- Use Postman or similar tools to interact with the API endpoints during development.
Contributions are welcome! Feel free to submit a pull request or report issues.
- Special thanks to Jonas Schmedtmann for providing the course and guidance to build this project.