# Dietbox Portal — The back office, and the newest generation of the platform’s architecture.

> The internal tool the company runs the product from — subscriptions, vouchers, the food catalogue, marketing — built as a layered service with commands, queries and domain events dispatched at save time, and an admin client that can act as the user it is helping.

## Overview

A back office is where a SaaS company’s real operating procedure lives — the subscriptions, the vouchers, the food catalogue, marketing — and this was the first place the platform’s newer patterns were carried through end to end: layers numbered on disk, commands and queries behind a pipeline behaviour that logs every one of them, and a domain that raises its own events and has them dispatched the moment its changes are saved.

## Stack

- .NET 6
- C#
- CQRS
- MediatR
- EF Core
- SQL Server
- ASP.NET Identity
- JWT
- Vue 3
- Vuex
- Azure DevOps

## Highlights

- Impersonation as a first-class feature: support can act as the nutritionist or patient they’re helping, from the client’s navbar or the patient view, and step back out.
- Eighteen controllers spanning the business administered: nutritionists and patients, subscriptions and their configuration, transactions, vouchers, the food catalogue, tags, marketing, materials, events, universities, metrics, accounts.
- A dashboard with charts mirroring those same domains, so the numbers support looks at come from the same commands that changed them.
- Domain events kept separate from integration events, so a change another service needs to hear about is an explicit publication, not a side effect of one that only matters inside this one.

## Role

Head of Technology · 2023–2024. Closed-source professional work — the write-up describes it without the source.

---

Source: https://felipealmeida.tech/projects/dietbox-portal
