HexaTodo
This project demonstrates a simple ToDo application built in Crystal programming language following the principles of Hexagonal Architecture (Ports and Adapters). Hexagonal Architecture promotes modularity and testability by structuring the application around core domain logic with input and output ports.
Features
- Create, read, update, and delete (CRUD) operations for ToDo items.
- Mark ToDo items as completed.
- Console-based user interface for interaction.
Architecture Overview
The application is structured according to Hexagonal Architecture principles, with three main components:
- Core Domain: Contains the core business logic and entities.
- Input Ports: Define the contract for external interactions with the application.
- Output Ports: Define the contract for the application's interactions with external systems.
Installation
- Install Crystal programming language if you haven't already. Follow the instructions here.
- clone this repository :
git clone https://github.com/JadeKharats/hexatodo.cr
- Navigate to the project directory:
cd hexatodo.cr
- Compile
shards build
Now, you have binaries in ./bin
folder
Usage
Webserver
TODO write webserver usage
CLI
TODO Add CLI usage
Structure
- domain/todo.cr: Contains the core domain entities representing the business logic.
- domain/inputport.cr: Defines the contract for external interactions with the application.
- domain/outputport.cr: Defines the contract for the application's interactions with external systems.
- application/repositories/inmemory.cr: Implements the repository interface for storing ToDo items in memory.
- ports/console_output.cr: Implements the output port to interact with the console.
- domain/todoservices.cr: Implements the business logic and use cases.
Dependencies
This project has no external dependencies beyond the Crystal standard library.
Roadmap
- [x] Initialize Hexagonal Architecture.
- [ ] Generate documentation with
crystal docs
command - [ ] Add CLI usage (with option-parser)
- [ ] Add HTTP usage
- [ ] Add server (with http/server)
- [ ] Add page (with ECR)
- [ ] Bonus : Add HTMX integration
- [ ] Add repository in file (with File, JSON, YAML)
- [ ] Add JSON repository
- [ ] Add YAML repository
To go further, with external libraries
- [ ] Add Port with
action-controller
- [ ] Add repository implementations:
- [ ] SQLite (with
crystal-db
) - [ ] RethinkDB
- [ ] SQLite (with
- [ ] Design CLI to use API Port
- [ ] make OPENAPI API with
action-controller
- [ ] make CLI client
- [ ] make OPENAPI API with
- [ ] Add ToDo fields:
- [ ] Add Status ENUM to ToDo
- [ ] Add full description to ToDo
- [ ] Add user management
- [ ] Signup/signin/logout
- [ ] Add author to ToDo
- [ ] Add assign to ToDo
- [ ] Add due date
- [ ] Add labels or tags
- [ ] Add milestone to group ToDo
- [ ] Add dependencies between ToDo
- [ ] Add Product to group ToDo and user
- [ ] Add subtask to ToDo
Bonus
- [ ] Add Trophy :
- [ ] the most closed ToDo
- [ ] the most open ToDo
- [ ] the same by milestone
Development
TODO Write development instructions here
Contributing
- Fork it (https://github.com/JadeKharats/hexatodo.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Jade D. Kharats - creator and maintainer