Hexagonal Architecture
Tasker is built using the **Ports and Adapters** pattern, ensuring that core business logic is completely isolated from external frameworks, databases, and delivery mechanisms.
Package Structure
The code is divided into three main layers:
1. Core (The Brain)
Contains pure Python code with no external dependencies (except Pydantic for validation). This is where the domain models and business rules live.
core/task_management: Issues, Components, and basic CRUD actions.core/project_analysis: Impact and root-cause analysis logic.
2. Entrypoints (The Mouth)
External interfaces that allow the world to talk to the project. They never contain business logic; they only translate requests into core actions.
entrypoints/terminal_cli: Typer-based interface.entrypoints/web_api: FastAPI-based interface.
3. Storage (The Memory)
The persistence layer. Tasker uses Neo4j as its primary adapter for storing the graph.
storage/graph_database: Neo4j repository implementation.
Golden Rules
Dependency Rule: Outer layers depend on inner layers. Inner layers (Core) must never depend on outer layers (FastAPI, Neo4j, etc.).
- No Business Logic in Entrypoints: Controllers should only validate inputs and call core actions.
- No DB in Core: Repositories are defined as Protocols in Core and implemented in Storage.
- Testable Core: You should be able to test the entire business logic using only
pytestand zero external services.