Code Monkey home page Code Monkey logo

dynamo-todo's Introduction

dynamo-todo

This is a little demo application o mess around a bit with Amazon DynamoDB.

Nothing fancy to see here, this is just a semi-usable command-line TODO list that reads/writes into DynamoDB. It is useful only to quickly remember how to do basic operations in the API.

Building

First compile the project (a simple go build is enough) and make sure you have a local DynamoDB instance running (so you don't waste money running this on the real thing...):

# compile the project
go build

# run a local, disposable dynamo instance
docker run --name dynamo-local --rm -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb

Remember that you will have an empty database at this stage. The last thing you need to do is to use NoSQL Workbench to load the model definition of the file TodoApp.json and commit that to your running instance.

Linux users don't have the luxury of using NoSQL Workbench and must create the schema and/or load the data manually. Luckly, the DataModel and TableData keys of the json file have all the information (and practically on the same format) that you need to do so. Have fun!

Usage samples

$ ./dynamo-todo

Usage of ./dynamo-todo:
  -add string
        Adds a new TODO item, with the specified text (shortcut for -key and -text)
  -context string
        Default context to use (default "INBOX")
  -done
        Marks/unmarks the TODO as done
  -key string
        Sets the key of the TODO. If not specified, is auto generated.
  -tags string
        Attach the comma-separated list of tags to the specified TODO.
  -text string
        Sets the text of the TODO

# listing, with default options
./dynamo-todo

# list from a specific context
./dynamo-todo -context NEXT

# list by tags, in a specific context
./dynamo-todo -tags home,work -context NEXT

# add an item with a specific tag
./dynamo-todo -text "Review emails" -tags work

# updating an item
./dynamo-todo -key 2 -text "Hey ho!" -tags fun,vacation

License

MIT. In short, have fun.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.