All projects

Project case study

HungerStation Microservices

Trace a checkout across service boundaries

A .NET 8 food-ordering project that separates authentication, catalog, carts, orders, and background consumers using HTTP APIs and Azure Service Bus.

  • C#
  • .NET 8
  • EF Core
  • Azure Service Bus
  • Stripe
Project notesStripe payment approval publishes a rewards message through Azure Service Bus.

The problem

In this project, I split a food-ordering flow across .NET services: the cart fetches products and discounts, the order service handles Stripe checkout, and a separate consumer records rewards. The difficult part is handling the gaps where one service saves its work and the next step fails.

How it fits together

  1. 01

    Cart

    Fetch products and coupons over HTTP to calculate the total.

  2. 02

    Order

    Save a pending order with its line items and prices.

  3. 03

    Payment

    Create a Stripe session and query its payment status.

  4. 04

    Rewards

    Publish reward data to a topic for a separate consumer.

Seven service projects sit behind an ASP.NET Core MVC frontend. AuthAPI uses ASP.NET Core Identity and signed JWTs. A separate Service Bus queue carries cart-email requests to EmailAPI, whose current implementation renders and stores the message body.

Decisions & tradeoffs

Give each service its own data model

I gave the services separate EF Core contexts. Most use PostgreSQL; orders and rewards use SQL Server. The cart fetches products and coupons over HTTP rather than joining their tables, so those services have to be available for the cart request to succeed.

Move follow-up work onto a message bus

I use HTTP for cart details and Service Bus queues or topics for email requests and rewards. Payment validation saves the approved order, then publishes its reward message. There is no transactional outbox, so a failure between those operations can leave an approved order without a reward message.

Keep the reward contract small

I pass the order ID, user ID, and reward activity in the message, and the consumer saves its own reward record. The handler does not check whether an order has already earned rewards, so repeated validation or message delivery can create duplicates.

Tests and limitations

The linked version implements the cart, Stripe status checks, reward publication, and reward handling. It has no automated test project or reproducible benchmark, so I do not have latency or end-to-end reliability measurements to share.

The reward consumer has a registration bug: it requests IRewardService, but startup only registers RewardService. That needs fixing before running the consumer. Local setup also needs database, Stripe, and Service Bus credentials, with different configuration keys used by the producer and consumers.

There are other unfinished parts: the reward handler swallows database errors, allowing the consumer to complete a failed message, and EmailAPI logs the generated email without sending it. Failed writes, duplicate delivery, and a crash between saving an order and publishing its message still need tests.