How zvoook/lifeforge works
1. What this repo is
LifeForge is a Go learning repository centered on a console task manager. The currently functional product is the CLI app under playground/TaskService, which manages personal development tasks by area and persists them to JSON.
2. Primary runnable entrypoint
The active application starts at playground/TaskService/main.go and is run with go run ./playground/TaskService. This is the main architecture to diagram today. The cmd/api and internal/app directories look like an embryonic production-style Go layout, but they are not the current core implementation based on the README.
3. Domain model
The task.go, task_status.go, and area.go files define the core business concepts:
- a task entity
- task completion/status
- a fixed set of development areas such as Backend, English, Guitar, Algorithms, and University
This indicates the system is strongly domain-driven around task tracking, not generic CRUD only.
4. Console/UI layer
Files like cli.go, handlers.go, readers.go, and formatters.go form the presentation boundary:
- readers.go gathers user input from the terminal
- handlers.go likely maps commands to actions
- formatters.go turns domain data into human-readable console output
- cli.go coordinates the menu/interaction loop
This layer is the user-facing entry point and should be shown as the front edge of the system.
5. Application/service layer
service.go is the main orchestration layer. It likely contains the use-case logic for:
- creating tasks
- listing tasks
- filtering by area
- finding by ID
- completing tasks
- changing priority
- deleting tasks
- clearing all tasks
- producing dashboard summaries
This is the business-rule boundary between UI and persistence.
6. Repository and persistence
repository.go and storage.go define persistence concerns. The README explicitly says the app uses a JSON-memory task repository, and save.json is the backing store. So the architecture is not a database-backed service; it is a file-backed local CLI with repository abstraction over JSON storage.
7. Validation and error handling
validation.go and errors.go suggest input and business-rule validation are handled in the TaskService layer before persistence. That means invalid task IDs, empty fields, unsupported areas, or illegal state transitions should be caught before storage writes.
8. Data flow through the system
The typical flow is:
console input → CLI/handlers → service validation and business logic → repository/storage → save.json
and then back in reverse for display:
repository data → service shaping → formatters → console output
This is the key flow to diagram because it shows the app is a layered, single-process command-line system.
9. Operational behavior
The app is local and stateful through a file, not a networked service. There are no visible external dependencies like HTTP, messaging, or cloud services in the active TaskService path. The persistence boundary is the local JSON file, which makes the whole system portable and simple to run.
10. Secondary repo structure
cmd/api/main.go plus internal/app/app.go indicate a more standard Go application skeleton exists alongside the playground code. Architecturally, this suggests the project is evolving from a learning playground toward a cleaner production structure, but the README confirms the CLI implementation is the current working system.
11. Technology and runtime
The stack is plain Go with standard command-line execution and file-based JSON persistence. The build artifact is an executable generated from the CLI package, so the deployment model is simply “compile and run locally.”
12. How to draw the architecture
For an accurate diagram, show:
- one CLI entrypoint
- a service layer in the middle
- a repository/storage layer
- a JSON file store as the persistence target
- domain objects for tasks, status, and area
- supporting utilities for reading, formatting, validation, and errors
Keep cmd/api and internal/app as a separate, likely future-facing scaffold rather than the active runtime path.
Main entry points: service.go Task service · cli.go CLI loop · repository.go Repository · task.go Task
Components 18
Active TaskService
Current runnable console task manager implementation under playground/TaskService
- Main · CLI application entrypoint
playground/TaskService/main.go - CLI loop · Coordinates the menu and interaction flow
playground/TaskService/cli.go - Handlers · Maps user commands to task actions
playground/TaskService/handlers.go - Readers · Collects and parses terminal input
playground/TaskService/readers.go - Formatters · Turns domain data into console output
playground/TaskService/formatters.go - Task service · Orchestrates task use cases and business rules
playground/TaskService/service.go - Validation · Validates inputs and illegal state transitions
playground/TaskService/validation.go - Errors · Shared error definitions for task workflows
playground/TaskService/errors.go - Repository · Task repository abstraction
playground/TaskService/repository.go - Storage · Reads and writes the backing JSON data
playground/TaskService/storage.go - Task · Core task record
playground/TaskService/task.go - Status · Task completion state
playground/TaskService/task_status.go - Area · Fixed development areas
playground/TaskService/area.go - save.json · Local persisted task data
playground/TaskService/save.json
Future scaffold
Embryonic production-style Go layout not yet the main runtime path
Connections 16
- Main → CLI loop: starts · Bootstraps the console application
- CLI loop → Handlers: dispatches · Routes menu actions to handlers
- CLI loop → Readers: reads · Collects user input
- Handlers → Task service: calls · Invokes task use cases
- Readers → Validation: checks · Validates raw input before use
- Task service → Validation: enforces · Applies business-rule validation
- Task service → Errors: returns · Uses shared error values for failures
- Task service → Repository: persists · Stores and loads tasks through repository abstraction
- Repository → Storage: uses · Delegates file-backed persistence
- Storage → save.json: writes · Persists state to the JSON file
- Repository → Task: manages · Stores task entities
- Task → Status: has · Task completion state
- Task → Area: belongs to · Task is categorized by area
- Task service → Formatters: shapes · Prepares data for display
- Formatters → CLI loop: prints · Formats output for the console UI
- API main → App shell: boots · Future scaffold runtime path