Skip to content

Application backend using microservice architecture in golang

License

Notifications You must be signed in to change notification settings

Go-Marketplace/backend

Repository files navigation

Go-Marketplace backend

Quickstart

To run app via docker containers, use the command:

docker compose up

If you want to use nightly images, you can pull and run all images from dockerhub:

To run unit tests:

make test

Architecture

The backend features an intricate microservices architecture, with each service having its own database and seamless interaction through APIs. For detailed APIs, check the /proto folder

The server component uses the grpc protocol, enabling exclusive communication among microservices through grpc. Users can choose between grpc and the Restful API via the grpc-gateway mechanism

  • The user service is vital for storing and modifying user information

  • The cart service manages cart details and items, addressing prolonged product storage with a worker. The worker, accessing Redis, cleans up the cart and returns products periodically

  • The product service is key for managing product information, ensuring product deletions reflect in associated cart items. Also the service stores information about the discount in Redis with a user-defined life time

  • The order service oversees order data, allowing status changes and user order cancellations within 24 hours. Upon order or part deletion, all products are returned

  • The gateway service acts as a user facade and authorizes requests, directing them to the necessary microservices for streamlined system functionality

Docs

All project documentation is in the /docs folder, e.g. swagger documentation, ER diagrams and so on

Also, when you run the application under the path /api/v1/swagger, you can see the swagger ui and play around with the application api

Dependencies

gprc protocol was used for server and client side, also from grpc ecosystem I used grpc-gateway and protoc

For unit tests:

To work with the databases:

For working with configuration files: cleanenv

Logger: zerolog

Linters:

Swagger: swaggerui

RBAC: gorbac

Validation: validator

JWT: jwt-go

License

About

Application backend using microservice architecture in golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published