Skip to content

Backend API built with NestJS using Domain-Driven Design and Clean Architecture.

Notifications You must be signed in to change notification settings

JMOrbegoso/wish-list-api

Repository files navigation

Wish List API 🌟

Backend REST API built with NestJS and following the principles of Domain-Driven Design and Clean Architecture


TypeScript badge NestJS badge MongoDB badge Yarn badge Jest badge Docker badge

Wish List API is a backend REST API where you can publish your wishes, share them, and keep them on track, recording the progress you make, until you fulfill them.

✨ Features

  • Built with TypeScript.
  • Domain-Driven Design (DDD):
    • Value Objects.
    • Entities.
    • Aggregates.
  • Clean Architecture:
    • Domain Layer.
    • Application Layer.
    • Infrastructure Layer.
  • Design Patterns:
  • Command Query Responsibility Segregation (CQRS).
  • 📺 Presentation:
    • NestJS.
  • 📚 Persistence:
    • MikroORM.
    • MongoDB.
  • 👤 Authentication:
    • Passport.js.
    • JWT Access Tokens.
    • Refresh Tokens.
    • Refresh Tokens rotation.
    • Refresh Tokens auto-revocation.
  • 🛡️ Authorization:
    • User Roles.
    • Resource Ownership.
  • 🧪 Testing:
    • Jest.
    • Supertest (e2e).
    • Coverage Report: 70%.
  • 📝 Documentation:

⌚ Prerequisites

To run this Backend API make sure you have installed all of the following prerequisites on your machine:

  • Node.js.
  • TypeScript.
  • Yarn.
  • Docker.

💻 Install

# Environment Variables
cp '.env.example' '.env' # Development
cp '.env.example' '.test.env' # Tests

# Install dependencies
yarn

# Run MongoDB database in Docker 🐋
docker-compose up # Development
docker-compose -f docker-compose.e2e.yml --env-file ./.test.env up # Tests

🚀 Running

# Run in development mode
yarn start

# Run in watch mode (development)
yarn start:dev

# Run in production mode
yarn start:prod

🧪 Tests

# Run tests
yarn test

# Run test coverage
yarn test:cov

# Run tests end to end
yarn test:e2e

🧑‍💻 Author

JMOrbegoso