Simple Event-Driven Microservice Architecture in Rust

Overview

Simple Event-Driven Microservice Architecture in Rust

build and testing codecov

Overview

"Simple Event-Driven Microservice Architecture in Rust" is an open-source project showcasing the simplicity and efficiency of building microservices in Rust. This minimalistic project demonstrates an e-commerce backend system, featuring just two microservices: Catalog and Order.

Getting Started

Prerequisites

During the installation steps you will install the following dependencies when running install_prerequisites_macos.sh

  • Rust
  • Brew
  • Java
  • Kafka

Installation Steps (MacOs)

  1. Set Executable Permissions
    Open your terminal at the root of the project and run the following commands:
    chmod +x .scripts/install_prerequisites_macos.sh
    chmod +x pre_run.sh
    
  2. Install Dependencies
    Execute the script to install prerequisites:
    ./.scripts/install_prerequisites_macos.sh
    
  3. Run Kafka Server
    Start the Kafka server, which is used for event passing between microservices:
    ./pre_run.sh
    
  4. Start Microservices
    Run both the Catalog and Order microservices in separate terminal windows:
  • For Catalog Microservice:
    (cd ./catalog_service && cargo run)
    
  • For Order Microservice:
    (cd ./order_service && cargo run)
    

Usage

Once the server is operational, you can interact with the microservices through the following endpoints:

  • Catalog Microservice:
    GET http://127.0.0.1:8081/catalog
    Retrieves a JSON list of all available products.

  • Order Microservice:
    POST http://127.0.0.1:8080/order
    Creates an order in the system. Use the header Content-Type: application/json and the following JSON body structure:

    {
    "item_id": 1,
    "name": "James",
    "address": "22 Bugs Bunny Street, London, E1 4AH, United Kingdom",
    "quantity": 1
    }
    

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for improvements and suggestions.

Prior to contributing please ensure you read CONTRIBUTING.md.

License

This project is open source and available under MIT.

Happy Coding! 🚀🦀

You might also like...
TypeRust - simple Rust playground where you can build or run your Rust code and share it with others

Rust playground Welcome to TypeRust! This is a simple Rust playground where you can build or run your Rust code and share it with others. There are a

Simple and performant hot-reloading for Rust

reloady Simple, performant hot-reloading for Rust. Requires Rust nightly and only works on Linux for now. installing CLI To install the CLI helper car

Crabzilla provides a simple interface for running JavaScript modules alongside Rust code.

Crabzilla Crabzilla provides a simple interface for running JavaScript modules alongside Rust code. Example use crabzilla::*; use std::io::stdin; #[i

Simple daemon built with Rust to track metrics.

Marvin - Metrics Tracker What I cannot create, I do not understand. — Richard Feynman Simple daemon built with Rust to track metrics. The goal is run

A simple programming language for something between C and Rust.

inuc inuc is a systems programming language that is something between C and Rust. Features : [] Strong , static typing (type inference not a priority

Rust language from simple to deep, and then to strengthen learning in multiple module

Rust Library This project is used to learn rust language from simple to deep, and then to strengthen learning in multiple module. It is used to help n

A simple thread schedule and priority library for rust

thread-priority A simple library to control thread schedule policies and thread priority. If your operating system isn't yet supported, please, create

Simple time handling in Rust

time Documentation: latest release main branch book Minimum Rust version policy The time crate is guaranteed to compile with any release of rustc from

Fast and simple datetime, date, time and duration parsing for rust.

speedate Fast and simple datetime, date, time and duration parsing for rust. speedate is a lax† RFC 3339 date and time parser, in other words, it pars

Owner
James Mallon
James Mallon
Microservice written in Rust from scratch.

Simple-ms This Repo This repository contains code for a microservice written in Rust using the Tokio Axum framework. This code is used in MongoDB's wo

MongoDB Developer Relations 5 Nov 10, 2022
A Domain Driven Design example application in Rust.

Rust Domain Driven Design Example rust-ddd Rust Domain-Driven-Design (DDD) Summery This repository is used to present how I find implementing DDD in R

Behrouz R.Farsi 6 Nov 15, 2022
Um Web Scrapper para extrair as soluções dos exercícios do Driven HUB com seus respectivos enunciados

hub_scrapper Um Web Scrapper para extrair as soluções dos exercícios do Driven HUB com seus respectivos enunciados, convertendo-os para Markdown. ⚠️ A

Davi Feliciano 4 Oct 7, 2023
Rust, cargo and QEMU setup for multi-architecture OS development.

rust-osdev-jumpstart Rust, cargo and QEMU setup for multi-architecture OS development. Goal This repo should give you a boost in starting a bare-metal

Alister Lee 27 Nov 20, 2022
Proof-of-concept for a memory-efficient data structure for zooming billion-event traces

Proof-of-concept for a gigabyte-scale trace viewer This repo includes: A memory-efficient representation for event traces An unusually simple and memo

Tristan Hume 59 Sep 5, 2022
A new blockchain architecture under active development, with a strong focus on scalability, privacy and safety

Project Slingshot Accelerating trajectory into interstellar space. Slingshot is a new blockchain architecture under active development, with a strong

Stellar 378 Dec 18, 2022
Elemental System Designs is an open source project to document system architecture design of popular apps and open source projects that we want to study

Elemental System Designs is an open source project to document system architecture design of popular apps and open source projects that we want to study

Jason Shin 9 Apr 10, 2022
Domain modeling. Event sourcing. CQRS.

f(model) - Functional Domain Modeling with Rust Publicly available at crates.io and docs.rs When you’re developing an information system to automate t

Fraktalio 12 Oct 7, 2023
Harvest Moon: (More) Friends of Mineral Town event script compiler

mary This is a script compiler for Harvest Moon: Friends of Mineral Town and Harvest Moon: More Friends of Mineral Town for the GBA. The end goal is f

Nat (Stan) 5 Oct 23, 2023
Simple autoclicker written in Rust, to learn the Rust language.

RClicker is an autoclicker written in Rust, written to learn more about the Rust programming language. RClicker was was written by me to learn more ab

null 7 Nov 15, 2022