Code Monkey home page Code Monkey logo

ticketbooking's Introduction

Ticket Booking

Demo repo for setting up baseline.

Package Structure Overview

├── README.md
├── build.gradle
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── darkhorse
    │   │           └── ticketbooking
    │   │               ├── TicketBookingApplication.java
    │   │               └── order
    │   │                   └── constants   --Contants
    │   │                       └── Message.java
    │   │                   ├── controller  --Api definitions
    │   │                   │   ├── OrderController.java
    │   │                   │   └── dto     --Controller layer models
    │   │                   ├── exception   --Exceptions
    │   │                   │   ├── NoAvailableSeatException.java
    │   │                   │   ├── OrderException.java
    │   │                   │   └── SeatBookServiceUnavailableException.java
    │   │                   ├── gateway     --3rd party clients
    │   │                   │   ├── FlightReportClient.java
    │   │                   │   ├── FlightReportGateway.java
    │   │                   │   ├── SeatBookingClient.java
    │   │                   │   ├── SeatBookingGateway.java
    │   │                   │   └── dto     --Gateway layer models
    │   │                   ├── messagequeue    --Message queues
    │   │                   │   ├── FlightReportQueue.java
    │   │                   │   ├── QueueConfiguration.java
    │   │                   │   └── dto     --MessageQueue layer models
    │   │                   ├── model       --Core models
    │   │                   │   ├── Order.java
    │   │                   │   ├── OrderStatus.java
    │   │                   │   └── Passenger.java
    │   │                   ├── repository  --Repositories
    │   │                   │   ├── OrderJpaRepository.java
    │   │                   │   ├── OrderRepository.java
    │   │                   │   ├── PassengerJpaRepository.java
    │   │                   │   └── po      --Persistent models
    │   │                   └── service     --Core processes
    │   │                       └── OrderService.java
    │   └── resources
    │       ├── application.yml
    │       └── db
    │           └── migration
    │               ├── V20220312200202__create-orders-table.sql
    │               └── V20220312200222__create-passengers-table.sql
    └── test
        ├── java
        │   └── com
        │       └── darkhorse
        │           └── ticketbooking
        │               ├── base
        │               │   └── BaseContainerTest.java  --Base unit test class
        │               ├── common
        │               │   └── JSONUtils.java
        │               └── order
        │                   ├── controller
        │                   │   └── OrderControllerTest.java
        │                   ├── gateway
        │                   │   ├── FlightReportGatewayTest.java
        │                   │   └── SeatBookingGatewayTest.java
        │                   ├── messagequeue
        │                   │   └── FlightReportQueueTest.java
        │                   ├── repository
        │                   │   └── OrderRepositoryTest.java
        │                   └── service
        │                       └── OrderServiceTest.java
        └── resources
            ├── application-test.yml
            └── db
                └── init.sql        --Init DB script for testcontainer

Prerequisite

  • Java11
  • gradle
  • Colima
    • Provide docker env for local DB and testcontainers. SqlServer is used as DB.
    • Link: https://github.com/abiosoft/colima
    • FAQ: 如遇安装问题见公司邮件"舍弃docker desktop切换colima踩坑日记"

Main technical dependencies

  • SpringBoot
  • Feign
  • RabbitMQ
  • Testing
    • Test Container --Faking Database
    • Wiremock --Faking 3rd party clients
    • Mockito --Stubbing dependencies in UT

Build

./gradlew build

Run

  • use postman mock server to fake flight report and seat booking service
  • start up colima
  • create sqlserver container and rabbitmq

ticketbooking's People

Contributors

kforest avatar

Watchers

 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.