Logo

Cake Planner

Backend

πŸ—οΈ CakePlanner Architecture

This document provides a high-level overview of the CakePlanner architecture, covering the system design, domain boundaries, and key technical workflows.


Table of Contents


Description

The Cake Planner is a web-based application designed to organize cake-bringing events within groups (e.g., teams, departments). It consists of a modern Single Page Application (SPA) frontend and a high-performance C++ backend.

1. System Context (The Big Picture)

The Cake Planner is designed as a monolithic application that serves baking groups (companies, clubs, friends) to organize events. It acts as the central hub for planning, rating, and sharing photos.

The system follows a classic **Client-Server Architecture**, facilitated by a Reverse Proxy.

The following C4-style System Context diagram illustrates how users interact with the system and how the internal components relate to each other.

High Level Architecture

2. Container Architecture

The system consists of a modern Single Page Application (SPA) frontend and a high-performance C++ backend.

ComponentTechnologyDescription
FrontendAngular 21+Material Design, Signals, Transloco (i18n). Responsive UI for Desktop & Mobile.
MiddlewareNGINXReverse Proxy, Load Balancer, SSL Termination. HTTP Security Headers.
BackendC++23 (Crow)REST API, Business Logic, Authentication, Authorization.
DatabaseSQLite3Zero-configuration SQL engine. Stores users, events, and ratings.
Media EngineQt6Server-side image processing (scaling & WebP conversion).

Component Description

1. NGINX (Reverse Proxy & Web Server)

The entry point for all traffic. It handles:

2. Frontends (Angular App)

Admin-Panel: A Single Page Application (SPA) built with Angular.



User-App: A Progressive Web Application (PWA) built with Angular.


3. Backend (C++ Crow)

The core logic provider, written in C++23 using the Crow framework.


4. Database (SQLite)

A local, file-based relational database.


5. External Systems

SMTP Mail Gateway: Used by the backend to send notifications (registration, password reset, event updates).

3. Domain Design (Bounded Contexts)

The Cake Planner system is divided into several Bounded Contexts to modularize logic and clarify responsibilities. This ensures that different parts of the system (e.g., user management vs. event planning) remain loosely coupled where possible.

3.1 Bounded Contexts Description

1. Identity & Access Management (IAM)

Responsibility: Handles everything related to checking "who is this user" and "what can they do".

2. Group Management

3. Event Planning

4. Engagement & Social

5. Notification System

3.2 Context Map Diagram

The following diagram illustrates the relationships between these contexts. To maintain readability, the components are arranged hierarchically. Context Map

3.3 Distinct Bounded Contexts

To keep the logic organized, the application is conceptually divided into distinct Bounded Contexts. Each context handles a specific part of the business domain.

Bounded Contexts

πŸ”Ž Context Descriptions

  1. Identity & Access: Handles user registration, login, and group assignments. Ensures that only group members can see their events.

  2. Planning: The core calendar logic. Manages dates, baker assignments, and prevents scheduling conflicts.

  3. Engagement: Contains the logic for the "Hall of Fame". It calculates average ratings and sorts events by popularity.

  4. Media: A specialized technical context responsible for handling file uploads, generating thumbnails, and optimizing images for the web (WebP).

  5. Administration: Provides tools for system maintainers to manage users, reset passwords, configure global settings, and view system logs.