Natours Backend API
A secure REST API for tour booking and management.
Tours · Users · Reviews
01 / The idea
Overview
A tour-booking REST API built while following a Node.js course, covering users, tours, and reviews with JWT authentication, role-based permissions, filtering, sorting, and pagination.
Natours is the backend API for a tour marketplace, organizing the core workflows around accounts, tour inventory, reviews, and protected operations. Its REST endpoints support complete resource management while reusable query utilities give catalogue consumers control over filtering, sorting, selected fields, and pagination. Authentication, permission checks, validation, sanitization, centralized errors, and secure password flows form the security boundary around the data.
02 / Under the hood
Built with
Backend
Technologies: Node.js · Express · MongoDB · JWT
03 / In the details
Core features
- 01
JWT-based authentication with protected routes and authorization checks applied at the middleware layer
- 02
Complete CRUD endpoints for tours, users, and reviews with consistent resource-oriented routing
- 03
Reusable query handling for advanced filtering, sorting, field limiting, and paginated responses
- 04
Role-based permissions that separate administrative operations from standard user actions
- 05
Request validation and sanitization designed to reject malformed or unsafe input before persistence
- 06
Secure password hashing, password reset flows, and careful handling of account credentials
- 07
Centralized operational error handling and logging middleware for predictable API responses and diagnosis


