vjcagay / todo-backend

Helping you select your next backend programming language! Inspired by TodoMVC.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Todo Backend

This project aims to create todo app implementations demonstrating basic CRUD (create, read, update, delete) operations on several backend programming languages.

Inspired by TodoMVC, I created this project with the aim of learning new programming languages in a fun way. Simple enough, but still teaches the fundamentals of backend development.

...and many more in the future.

The app, no matter the backend, will connect only into a single MongoDB database and will access the same set of data.

Screenshot

screenshot

Setup

  • Make sure that you have MongoDB installed in your system.
  • Run ./db/start.sh to start the local MongoDB server.
  • Check out the frontend documentation for instructions on how to prepare the frontend so that it can be served by the backend code of the language of your choosing.
  • Choose a backend language in backend you want
  • Let's rock!

API

A Todo is an object that will have the following data:

  • ObjectID _id acts as the primary key
  • String task describes what the Todo is about
  • Boolean done marks the when the Todo is done

The frontend and backend should use the following endpoints:

  • GET /todos
    • Gets all Todos
    • Does not require anything
    • Returns an array of Todos
  • POST /todos
    • Create a new Todo
    • Requires Todo data
    • Returns new Todo with the generated _id
  • PUT /todos/{_id}
    • Updates an existing Todo
    • Requires Todo data and _id to be passed on the URL
    • Returns a Todo with the updated data (_id is immutable)
  • DELETE /todos/{_id}
    • Deletes a Todo
    • Requires _id to be passed on the URL
    • Returns a JSON object displaying the number of deleted Todos, in this case, only 1 ({ deleted: 1 })
  • DELETE /todos
    • Deletes all Todos that are marked done
    • Does not require anything
    • Returns a JSON object displaying the number (n > -1) of deleted Todos ({ deleted: n > -1 })

Author

© Vincent John Cagay

About

Helping you select your next backend programming language! Inspired by TodoMVC.

License:The Unlicense


Languages

Language:JavaScript 62.4%Language:Java 30.3%Language:HTML 4.5%Language:Shell 2.3%Language:CSS 0.5%