Project Manager — Design
Date: 2026-05-15
Issue: #94
Milestone: M2 — Visual Editing & Assets
Namespace: Caffeine::Editor
Overview#
Entry point of the Caffeine Studio IDE. Allows users to create new projects from templates, open existing projects, and manage the list of recent projects. A "Project" is defined by a project.caffeine (JSON) file containing engine metadata, asset paths, and build settings.
Architecture#
Caffeine Studio launchCLI arg "--project path/to/project.caffeine" → OpenProject()no CLI arg → Show Project Manager UI (recent projects list)[New Project] → CreateNewProject(config)[Open Project] → OpenProject(file dialog)[Recent] → OpenProject(recent path)
Classes#
ProjectConfigName — display nameVersion — engine version (default "0.2.0")RootPath — absolute path to project rootAssetRawPath — "assets/raw"AssetProcessedPath— "assets/processed"ScriptsPath — "scripts"TemplateType — "2D", "3D", "Empty"LastScene — relative path to last opened scene
ProjectManagerCreateNewProject(config) — creates dirs + project.caffeineOpenProject(path) — loads .caffeine file, validatesGetCurrentProject() — returns active ProjectConfigGetRecentProjects() — returns recent paths listSetRecentProjectsPath() — override for testing
Directory Structure Created#
<RootPath>/project.caffeineassets/raw/processed/
scripts/build/
JSON Serialization#
Minimal hand-written parser (no external dependency). The project.caffeine format:
json
{
"project_name": "MyGame",
"engine_version": "0.2.0",
"paths": {
"assets_raw": "assets/raw",
"assets_processed": "assets/processed",
"scripts": "scripts"
},
"last_scene": "scenes/main.scene"
}
Parser handles: quoted strings, nested objects (one level), comma/colon separators. Writer outputs with 2-space indentation.
Recent Projects#
- Stored as a text file, one absolute path per line
- Max 10 entries, most recent first
- Default location: platform config directory (
%APPDATA%/Caffeine/recent.txton Windows,~/.config/caffeine/recent.txton Unix)
Error Handling#
- All operations return
bool—trueon success,falseon failure - No partial state: if directory creation fails mid-way, the caller handles cleanup
- No exceptions — follows engine convention
Dependencies#
- Upstream:
Caffeine::Core(filesystem, string) - Downstream:
Caffeine::Editor::EditorContext(holds a ProjectManager instance)