https://github.com/othercodes/sample-todo-list-hexagonal-architecture
Sample of TO-DO List Application using Hexagonal Architecture.
https://github.com/othercodes/sample-todo-list-hexagonal-architecture
Last synced: 11 months ago
JSON representation
Sample of TO-DO List Application using Hexagonal Architecture.
- Host: GitHub
- URL: https://github.com/othercodes/sample-todo-list-hexagonal-architecture
- Owner: othercodes
- License: apache-2.0
- Created: 2022-03-19T15:00:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-23T07:15:11.000Z (almost 3 years ago)
- Last Synced: 2025-03-17T21:56:27.643Z (over 1 year ago)
- Language: Python
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sample TODO List with Hexagonal Architecture
Sample of TO-DO List Application using Hexagonal Architecture.
1. **Infrastructure**: Database specific connectors all 3rd part dependant goes here.
2. **Application**: Main use cases.
3. **Domain**: All the business logic goes here.
## Domain

```bash
to_do_list
├── shared
│ └── domain
│ └── models.py
└── tasks
├── application
│ ├── services.py
│ └── sources.py
├── domain
│ ├── contracts.py
│ ├── exceptions.py
│ ├── models.py
│ └── services.py
└── infrastructure
└── persistence
└── relational.py
```
## CLI Application
```bash
app
├── configuration.py
├── console.py
└── providers.py
```
## Installation
Just run poetry to install the dependencies.
```bash
poetry install
```
Next, you need to create and configure the `.env` file.
```bash
# create .env file
cp example.env .env
# create the database file.
touch to_do_list.db
```
## Usage
Once the dependencies are installed, you can run the application using the following command.
```bash
# initialize the database.
poetry run python todo.py init
# use the application.
poetry run python todo.py
```
## Tests
1. **Unit**: tests the domain and application layer.
2. **Integration**: tests the infrastructure layer.
To run test you can use the following command.
```bash
poetry run pytest
```
```bash
tests
├── conftest.py
├── integration
│ └── test_infrastructure_persistence.py
└── unit
└── test_application_services.py
```