Skip to content

achiku/kaonashi

Repository files navigation

kaonashi

Build Status MIT License

Headless local note app with just-enough set of RESTful APIs

Why created

There are wide range of note apps out there, but the fundamental functionality is not so different among them. Programmers and desingers are kind of people who are good at creating whatever tools/UIs suitable for their own use case, and it has became substantially easier to create UI for multiple devices as variety of tools evolved in the past few years. This go gettable binary, called kaonashi, will get your back. You can create and keep polishing valuable note UIs for your own use case on top of RESTful APIs that should be just-enough for simple note app.

Example UIs

Instalation

go get -u github.com/achiku/kaonashi/cmd/kaonashi

Create database

$ kaonashi -init

Start service

$ kaonashi -d &

What it can do

Interacting with kaonashi using curl.

POST a note

curl -v -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X POST \
    -d '{"data":{"title":"my first note","body":"note body"}}' \
    http://localhost:8080/note
{
    "data": {
        "message": "created"
    }
}

PUT a note

curl -v -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X PUT \
    -d '{"data":{"title":"my first note","body":"note body updated"}}' \
    http://localhost:8080/note/1
{
    "data": {
        "message": "updated"
    }
}

DELETE a note

curl -v -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X DELETE \
    http://localhost:8080/note/1
{
    "data": {
        "message": "deleted"
    }
}

GET note titles

curl -v -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X GET \
    http://localhost:8080/note
{
    "data": [
        {
            "created": "2016-01-09 22:51:10.860726046 +0900 JST",
            "id": 2,
            "title": "title 02",
            "updated": "2016-01-09 22:51:10.861432579 +0900 JST"
        },
        {
            "created": "2016-01-09 22:20:45.814969118 +0900 JST",
            "id": 1,
            "title": "title 01",
            "updated": "2016-01-09 22:20:45.816734399 +0900 JST"
        }
    ]
}

GET a note

curl -v -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X GET \
    http://localhost:8080/note/2
{
    "data": {
        "body": "hello, kaonashi!",
        "created": "2016-01-09 22:51:10.860726046 +0900 JST",
        "id": 2,
        "title": "title01",
        "updated": "2016-01-09 22:51:10.861432579 +0900 JST"
    }
}

Contribute

Pull requests for new features, bug fixes, and suggestions are welcome!

Install gom

This project is using gom for dependency management.

$ go get -u github.com/mattn/gom
$ gom install

Test

$ go test -v

Write code and auto-reload

Using wbs, it will be really easy to code and reload.

$ cd cmd/kaonashi
$ gom exec wbs -c wbs.toml

About

Headless local note app with just-enough set of RESTful APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages