Skip to content

simple demo of a microservices architecture using NATS as the messaging system

License

Notifications You must be signed in to change notification settings

une-tasse-de-cafe/autocoffee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoCoffee - a NATS based microservices demo

This is a simple demo of a microservices architecture using NATS as the messaging system. The demo is based on a "coffee shop" scenario where clients can order coffee in an automated way.

Architecture

The demo consists of the following components:

  • routes - a service that exposes a web interface for clients to order coffee.
  • controller - a service that receives the orders from the routes service, check the stock (using the stock service) and send the order to coffee-makers services.
  • stock - a service that keeps track of the stock of coffee beans in a database.
  • coffee-makers - a service that receives the orders from the controller service and makes the coffee. The service updates the stock in the stock service when an order is completed.

Running the demo

You will need to have a NATS server running. Set an environment variable NATS_SERVER and run each service with go run.

export NATS_SERVER=localhost:4222
cd routes && go run main.go &
cd controller && go run main.go &
cd stock && go run main.go &
cd coffee-makers && go run main.go &

Demo

Demo Webpage

About

simple demo of a microservices architecture using NATS as the messaging system

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published