Skip to content

pdurbin/addressbookmvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

Goal

  • Create various implementations of a minimally simple addressbook service

Why?

  • To ease comparison between different languages/frameworks/approaches
  • To demonstrate how to use the various languages/frameworks/approaches

The Original Idea

http://todomvc.com but using server-side technologies.

  • have a database with a table with names and phone numbers (and probably a surrogate key)
  • the application should list all the entries (optionally paged)
  • you should be able to add, edit and delete an entry
  • each entry has 2 fields: name and phone number
  • any other features are optional

Implementation Guidelines

General

  • Go for clarity and simplicity which should ease comparison and improve the pedagogical win.
  • Err on the side of excessive commenting.
  • Implementations MUST include persistence.
  • Implementations SHOULD behave as described in the API doc below, whether it provides an actual API service or merely outputs HTML directly.

Contacts

A contact is completely described as:

{
  "id":   <integer>,
  "name": "<string>",
  "phone": "<string>"
}

SQL

If you choose to use an SQL-based persistence, here is some example DDL:

CREATE TABLE contacts (
id INTEGER NOT NULL PRIMARY UNIQUE AUTOINCREMENT,
name TEXT NOT NULL,
phone TEXT NOT NULL
);

The above is SQLite compatible syntax.

File

If you choose to use file-based persistence, please use OS-independent path handling/access where possible.

API

URI Responses1 HTTP Method (Verb) and Parameters Description
/contacts 200, 204 GET list all contacts
/contact 201, 400 POST with JSON representation of new contact create a new contact
/contact/<id> 200, 404 GET display a specific contact
/contact/<id> 200, 400, 404 PUT with JSON representation of new data update a specific contact
/contact/<id> 204, 404 DELETE delete a specific contact

About

http://todomvc.com but for the back end

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •