all projects
Backend API

Natours Backend API

A secure REST API for tour booking and management.

Source code
REST API
ClientExpress

Tours · Users · Reviews

JWT authenticationMongoDB

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

Node.jsExpressMongoDB

Technologies: Node.js · Express · MongoDB · JWT

03 / In the details

Core features

  1. 01

    JWT-based authentication with protected routes and authorization checks applied at the middleware layer

  2. 02

    Complete CRUD endpoints for tours, users, and reviews with consistent resource-oriented routing

  3. 03

    Reusable query handling for advanced filtering, sorting, field limiting, and paginated responses

  4. 04

    Role-based permissions that separate administrative operations from standard user actions

  5. 05

    Request validation and sanitization designed to reject malformed or unsafe input before persistence

  6. 06

    Secure password hashing, password reset flows, and careful handling of account credentials

  7. 07

    Centralized operational error handling and logging middleware for predictable API responses and diagnosis

All projects