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.
This server uses basic authentication along with Sprint Security to separate tasks out by user. Basic authentication can be added in several ways.
- Use a header containing the base64 encoded string of :
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
- where
QWxhZGRpbjpvcGVuIHNlc2FtZQ==
is the Base64 encoded credentials
- Embed the credentials in the server URL
https://user:passwd@www.server.com/index.html
- These credentials (and the URL) are encrypted over SSL
The REST API exposes the following endpoints.
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 (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 tasks that have not been completed or are repeatable.
Request (GET)
- No Parameters
Response (JSON)
- List of Tasks
Add a new task
Request (POST, JSON body)
- Task
Response (JSON)
- Task
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.'
Permanently remove the task.
Request (POST) (Form URL Encoded)
- taskId (long)
Response (NONE) *200 OK if the task is deleted
Edit/Update a task.
Request (PUT,POST) (JSON body)
- task
Resposne (NONE)
- 200 OK if task updated successfully
Licensed under the MIT License