Skip to content

mgryszko/todo-clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Yet another todo manager inspired by todo.txt. Pet project developed for two reasons:

The functionality is very simple - you can add, edit, delete a todo and list all todos.

Usage

CLI

lein bin
target/todo action [task_number] [task_description]

actions:
    add "task to be done"
    update 1 "task to be updated"
    delete 2
    list

REST

lein ring server

http POST :3000/todos task="do something"
http GET :3000/todos
http GET :3000/todos/1
http PUT :3000/todos/1 task="maybe tomorrow"
http DELETE :3000/todos/1

Configuration

todo.txt file location can be configured as the environment variable TODO_FILE or Java system property todo.file.

Structure

Production code

  • core - namespace todo.core
  • delivery mechanism
    • CLI - namespaces under todo.infrastructure.cli
    • REST - namespaces under todo.infrastructure.rest
  • file repository adapter - namespaces under todo.infrastructure.file

Tests

  • unit tests of core
  • integration tests of file repository adapter
  • system tests - roundtrip tests via CLI and REST. Using mainly front door (public API). Back door only for cleaning the todo file

To run all tests: lein midje or at REPL startup: lein repl

External libraries