Giter Club home page Giter Club logo

booking-system's Introduction

Booking System

Problem Statement

We want to make a booking solution for one hotel. The first 2 user stories are:

  • As a user I want to see all free rooms.
  • As a user I want to book a room.

The Booking struct contains

  • client id
  • room name
  • arrival date
  • departure date

And the Room struct contain only

  • room name

Proposed solution

In order to face a scalable solution I used tactical DDD with CQRS on top of Hexagonal Architecture. For that there're 3 main folders ๐Ÿ‘‡

  • src/application ๐Ÿ‘‰ Contains all the top level services divided into commands, queries and events.
  • src/domainmodel ๐Ÿ‘‰ Contains all the business logic. For business logic I considered all the elements that change application state. In this case, the bookings. So this leaves all the reads out of the domainlayer and this also implies queries & query handlers.
  • src/infrastructure ๐Ÿ‘‰ Implementation details such as persistence.

As for the delivery mechanism, I used NestJs as framework of choice given it's maturity and all the built-in features it comes with. Features used ๐Ÿ‘‡

  • Delivery Mechanism ๐Ÿ‘‰ NestJs
  • Persistence layer ๐Ÿ‘‰ TypeORM
  • CQRS framework ๐Ÿ‘‰ NestJs CQRS

How to run the project

For this you will need to have Docker installed. Then run

docker compose up -d

Once everything is running, just point your browser to

https://127.0.0.1:3000/api

booking-system's People

Contributors

theunic avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.