Initial release of the app
java -jar thingifier-1-0-jar-with-dependencies.jar
App will start on port 4567.
You can then make REST API calls to localhost:4567
e.g.
GET http://localhost:4567/todo
GET http://localhost:4567/project
Model
Entities:
- todo
- Fields:
- doneStatus
- guid
- description
- title
- Fields:
- project
- Fields:
- guid
- description
- active
- completed
- title
- Fields:
- category
- Fields:
- guid
- description
- title
- Fields:
Relationships:
- projects : category => project
- categories : todo => category
- todos : category => todo
- tasks : project => todo
Resulting REST API
This generates the following REST API automatically
- /todo
- GET - all the todos
- POST - create a todo - body JSON
- OPTIONS
- /todo/GUID
- GET - a specific todo
- DELETE - a specific todo
- POST - amend the todo
- PUT - replace all the todo fields in the JSON body
- OPTIONS
- /todo/GUID/categories
- GET - all the categories for a todo
- POST - allocate a todo to a category - body JSON must contain a GUID for a category e.g.
{"guid":"1234-1234-1234-1234"}
- POST can also be used to create a category and add it to the todo e.g.
{"title":"at shops"}
- this is probably most useful for creating a todo for a specific project e.g.
/project/GUID/tasks
then the json body contains the details of the todo to create and cross reference to the project using thetasks
relationship
- this is probably most useful for creating a todo for a specific project e.g.
Same url pattern for /project
and /category
The JSON body is simply
{"fieldname":"fieldvalue", "anotherFieldName":"anotherValue", etc.}
The fieldnames are shown in the list above for the model or the code below.
The REST API has some guards to check for 404s but very little error handling and no enforcement of mandatory fields etc.
But it is a workable API and all details are stored in memory. Clearly this means it is a rich testing target as it is possible to mess it up quite badly.
The deployed app does have some sample data for testing purposes, this can easily be DELETE
d using the API.