AgendApp is a C++20 console application for managing an agenda of events. The program is built around a finite state machine that drives an interactive terminal workflow for creating, updating, browsing, and exporting agendas. Persistence is handled through plain text files stored in the user profile, and the agenda can be exported to standalone HTML for distribution.
- Agenda lifecycle: load existing agendas or bootstrap a new one when no persisted data is found.
- Event management: create events with validated date and time ranges, update agenda metadata, list entries, and remove events by title or identifier.
- HTML export: generate a self-contained HTML document that renders the agenda without external assets.
- Persistence: serialise agendas to
%APPDATA%/AgendaApp/agendas(Windows) or$HOME/AgendaApp/agendas(Unix) using a custom plain text format. - User safeguards: warn before quitting with unsaved changes and offer inline save options.
StateMachinenamespace (include/statemachine,src/statemachine): Implements the finite state machine, with each menu or action represented by its own state object. Transitions are explicit, and messages are passed between states through the machine interface.Agendanamespace (include/Agenda,src/Agenda): Aggregates agenda properties and the event list. TheControllerorchestrates persistence, domain validation, and exposes a façade for the UI layer.Eventsnamespace (include/Events,src/Events): Contains rich domain objects (Event,EventsList) with string, HTML, and time handling utilities.Timestampnamespace (include/Timestamp,src/Timestamp): ProvidesDateandTimetypes with parsing, validation, and formatting responsibilities.Utilsmodule: Supplies reusable console helpers, thread-local UID generation, input validation, and ANSI-aware screen clearing for Windows and Unix terminals.ResourceManager: Centralises filesystem access, ensuring directories exist, writing agenda data, and emitting HTML exports.
The codebase follows interface-driven design (IStringConvertible, IHtmlConvertible) so that data structures expose a consistent textual representation to the CLI and exporter.
AgendaApp <agenda_name>
- On startup, the controller loads
<agenda_name>.datfrom the agenda directory. If the file is missing, the user is prompted for an agenda title and description before continuing. - The main menu is rendered through
MainMenuState, dispatching to dedicated states such asAddEventState,RemoveEventMenuState,SaveAgendaState, orExportHTMLState. - States return control to the machine after they complete or request another transition, keeping the run loop free of menu-specific logic.
- CMake ≥ 3.10
- A C++20-capable compiler (MSVC 19.3x, Clang ≥ 15, or GCC ≥ 12)
Windows (PowerShell):
cmake -S . -B build -G "Visual Studio 17 2022"
cmake --build build --config ReleaseUnix-like systems:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build buildThe resulting binary is emitted to bin/AgendaApp.exe on Windows or bin/AgendaApp on Unix.
# Windows
bin\AgendaApp.exe my-agenda# Unix-like
./bin/AgendaApp my-agendaAgenda files are saved under the configured data directory (default: %APPDATA%/AgendaApp/agendas or $HOME/AgendaApp/agendas). HTML exports are written to the sibling html directory.
Agendas are persisted as plain text documents. A stripped example:
name: my-agenda
title: Roadmap Q2
description: Kickoff milestones
uid: 1a2b3c...
title: Release Alpha
description:
Stabilise feature set
:endDescription
beginDate: 01/04/2025 09:00
endDate: 01/04/2025 11:00
Each event is bracketed by an identifier, metadata, a multi-line description terminated with :endDescription, and validated start/end timestamps.
The repository ships with an Expect automation script (tests/edit.expect) that exercises the menu flow on Windows, ensuring the edit pipeline keeps working. Additional tests can be layered on top of the same mechanism to cover other states.
- The state machine accepts new features by appending another state to
MainMenuState::StateFactoryand implementing the corresponding state class. - The
ResourceManager::Configstruct can be extended to redirect agenda or HTML output directories without touching higher layers. - Rendering logic can be redirected from HTML to other formats by adding new implementations of
IHtmlConvertibleor additional convertible interfaces.


