Skip to content

luyanakat/booking-flight-microservices

Repository files navigation

Booking Flight Microservices

  • Project use microservices architecture with gRPC and GraphQL, each service is independent and connect to each other by gRPC. Also, each service working with separate database.

Sample Diagram

Run Project with Docker-Compose

  • Simple Run docker compose up -d or docker compose up if you want to see log

  • GraphQL Server will run via: http://localhost:3000

  • Clean up everything created by docker-compose by use your terminal

  docker-compose down
  docker volume prune -y

Frameworks and Libraries

Project Structure

  • cmd: It contains graphQL server to run a GraphQL Playground, also with Gin

  • docs: It contains all documentation for example API Reference

  • graphql: It contains all code generated by gqlgen for GraphQL Server, also resolver, schema and model-generated by gql

  • grpc: It contains all gRPC services, includes user-service, flight-service, customer-service, booking-service

  • helper: It contains all helper functions. For example check_input or config,... etc helper

  • middleware: It contains all middleware for the GraphQL server, serve with Gin middleware

  • pb: It contains all proto files generated by proto-complier for gRPC services

  • proto: It contains all proto-define for gRPC services

  • scripts: It contains all scripts for docker-compose

Project Structure for gRPC Service

  • ent: It contains all ent-generated code by ent-go-framework, also with ent/schema for database design

  • handler: It contains handler for gRPC service

  • intercepter: It contains all intercepter for gRPC service

  • internal: It contains all internal package using for gRPC service, example: auth or config

  • repo: It contains repository for gRPC service, include init database connection and CRUD function

  • request: It contains request, response for gRPC service, but in this project, only for pagination

  • config.yml: Config file for gRPC port, db connection config, ... etc

  • service.Dockerfile: Dockerfile for gRPC service

Code

  • GraphQL Server
  • Database Connection
  • Pagination GraphQL
  • Authentication
  • Unit test (0%)

gRPC Service

  • User Service
    • Query User (Admin)
    • Create User (Admin)
    • Register Customer
    • Login
  • Flight Service
    • Create Flight (Admin)
    • Update Flight (Admin)
    • Query Flight
  • Customer Service
    • Change Password
    • Query Customer (Admin)
    • Update Customer
  • Booking Service
    • Create Booking
    • Cancel Booking
    • Booking History
    • View Booking
    • Query Booking (Admin)

Document

  • Database design
  • API Reference

Delivery

  • Dockerized
  • Docker-compose
  • Multi-stage build

About

Booking flight system using microservices

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published