Task Manager for GA Student Assignments
- Ruby, Sinatra, PostgreSQL, ActiveRecord, Sessions.
See corresponding REACT app info at https://github.com/Amjad-H-Ali/Genaral-Assembly-Task-Manager-React
-
/user/register
-
POST
-
- Takes in a new username and password.
- Checks to make sure that username deosn't exist in the DB.
- If it doesn't already exist, a new user will be created in the DB.
- The Property "logged_in" in the Session object will set to true, and the user will be ‘logged in’.
-
{ success: true, username: JohnDoe123, message: "Logged in as JohnDoe123." }
{ success: false, message: "Username already taken." }
-
/user/login
-
POST
-
- Takes in a username and password.
- Checks if given username and password match in the DB.
- If the information is correct, a Session will be created and the user will be ‘logged in’.
-
{ success: true, username: JohnDoe123, message: "Logged in as JohnDoe123." }
{ success: false, message: "Invalid Username or Password." }
-
/user/logout
-
POST
-
- Destroys the session, effectively ‘logging the user out’
-
{ success: true, message:"Logged out." }
-
-
/assignment
-
/outcome
-
-
GET
-
- Queries the DB for all the assignments associated with logged in user.
-
{ success: true, message: "Found 3 assignment(s) for JohnDoe123.", user_assignments: [Object 1, Object 2, Object 3] }
-
- /assignment
- /outcome
-
POST
-
- Creates a new assignment in DB with properties "name, link, notes, and complete (default set to false)".
-
{ success: true, added_assignment: Assignment_Object, message: "Added assignment for JohnDoe123." }
-
-
/assignment/:id
-
/outcome/:id
-
-
GET
-
- Queries the DB for an assignment with the given Id.
-
{ success: true, assignment: Assignment_Object, message: "Found Assignment1" }
-
-
/assignment/:id
-
/outcome/:id
-
-
DELETE
-
- Queries the DB for an assignment with the given Id.
- Deletes assignment from DB.
-
{ success: true, message: "Delete Assignment1 successful." }
-
-
/assignment/:id
-
/outcome/:id
-
-
PUT
-
- Queries the DB for an assignment with the given Id.
- Edits assignment's "name, link, and notes " properties.
-
{ success: true, updated_assignment: Assignment_Object, message: "Updated assignment." }
-
-
/assignment/:id/check
-
/outcome/:id/check
-
-
PUT
-
- Queries the DB for an assignment with the given Id.
- Updates assignment's 'complete' property to either true or false in DB.
-
{ success: true, assignment_complete: true/false, message:"Assignment status updated." }