Skip to content

A simple REST based API for creating and maintaining a list of tasks written in Java 8

License

Notifications You must be signed in to change notification settings

jacobhyphenated/TaskList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task List

This is a for-fun project where I build a Java Server Application using Java 8.

This server exposes a REST API that allows for the creation of users and tasks associated with them. Tasks can be repeatable and the logic contained in the server will determine the next due date of repeatable tasks.

Authentication

This server uses basic authentication along with Sprint Security to separate tasks out by user. Basic authentication can be added in several ways.

  1. Use a header containing the base64 encoded string of :
  • Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
  • where QWxhZGRpbjpvcGVuIHNlc2FtZQ== is the Base64 encoded credentials
  1. Embed the credentials in the server URL
  • https://user:passwd@www.server.com/index.html
  • These credentials (and the URL) are encrypted over SSL

API

The REST API exposes the following endpoints.


Create Account (/user/create)

Creates a new account on the server. This is the only unauthenticated API call.

Request (POST,PUT) (Form URL Encoded)

  • username
  • password

Resposne (JSON)

  • User Entity
    • username (string)
    • password (string)
    • id (long)

Get All Tasks (/task/all)

Get all tasks (including completed tasks) associated with the authenticated user.

Request (GET)

  • No Parameters

Response (JSON)

  • List of Tasks
    • id (long)
    • title (string)
    • description (string)
    • group (string)
    • dueDate (yyyy-MM-dd'T'HH:mm:ss)
    • completeDate (yyyy-MM-dd'T'HH:mm:ss)
    • isActive (boolean)
    • repeatable (string, enum)
      • NONE
      • DAILY
      • WEEKLY
      • MONTHLY
      • YEARLY

Get Active Tasks (/task/active)

Get tasks that have not been completed or are repeatable.

Request (GET)

  • No Parameters

Response (JSON)

  • List of Tasks

Create New Task (/task/add)

Add a new task

Request (POST, JSON body)

  • Task

Response (JSON)

  • Task

Complete Task (/task/complete)

Mark a task as complete. If the task is repeatable, the due date is moved forward based on the repeatable time increment.

Request (POST) (Form URL Encoded)

  • taskId (long)
  • date (yyyy-MM-dd'T'HH:mm:ss)
    • date when the task was completed

Respsonse (NONE)

  • 200 OK if completed successfully.'

Delete Task (/task/delete)

Permanently remove the task.

Request (POST) (Form URL Encoded)

  • taskId (long)

Response (NONE) *200 OK if the task is deleted


Edit Task (/task/edit)

Edit/Update a task.

Request (PUT,POST) (JSON body)

  • task

Resposne (NONE)

  • 200 OK if task updated successfully

License

Licensed under the MIT License

About

A simple REST based API for creating and maintaining a list of tasks written in Java 8

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages