Giter VIP home page Giter VIP logo

general-assembly-task-manager-api's Introduction

Task_Manager_Project_3

By Amjad Ali and Marie Trull

Task Manager for GA Student Assignments

Technologies Used

  • Ruby, Sinatra, PostgreSQL, ActiveRecord, Sessions.

REACT APP

See corresponding REACT app info at https://github.com/Amjad-H-Ali/Genaral-Assembly-Task-Manager-React

Route Info

UserController

  • URL:

    /user/register

  • METHOD:

    POST

  • DETAILS:

    • 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’.
  • RESPONSE:

    SUCCESS

    { success: true, username: JohnDoe123, message: "Logged in as JohnDoe123." }

    Fail

    { success: false, message: "Username already taken." }

  • URL:

    /user/login

  • METHOD:

    POST

  • DETAILS:

    • 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’.
  • RESPONSE:

    SUCCESS:

    { success: true, username: JohnDoe123, message: "Logged in as JohnDoe123." }

    Fail

    { success: false, message: "Invalid Username or Password." }

  • URL:

    /user/logout

  • METHOD:

    POST

  • DETAILS:

    • Destroys the session, effectively ‘logging the user out’
  • RESPONSE:

    { success: true, message:"Logged out." }

AssignmentController + OutcomesController

  • URL:

    • /assignment

    • /outcome

  • METHOD:

    GET

  • DETAILS:

    • Queries the DB for all the assignments associated with logged in user.
  • RESPONSE:

    SUCCESS

    { success: true, message: "Found 3 assignment(s) for JohnDoe123.", user_assignments: [Object 1, Object 2, Object 3] }

  • URL:

    • /assignment
    • /outcome
  • METHOD:

    POST

  • DETAILS:

    • Creates a new assignment in DB with properties "name, link, notes, and complete (default set to false)".
  • RESPONSE:

    SUCCESS

    { success: true, added_assignment: Assignment_Object, message: "Added assignment for JohnDoe123." }

  • URL:

    • /assignment/:id

    • /outcome/:id

  • METHOD:

    GET

  • DETAILS:

    • Queries the DB for an assignment with the given Id.
  • RESPONSE:

    SUCCESS

    { success: true, assignment: Assignment_Object, message: "Found Assignment1" }

  • URL:

    • /assignment/:id

    • /outcome/:id

  • METHOD:

    DELETE

  • DETAILS:

    • Queries the DB for an assignment with the given Id.
    • Deletes assignment from DB.
  • RESPONSE:

    SUCCESS

    { success: true, message: "Delete Assignment1 successful." }

  • URL:

    • /assignment/:id

    • /outcome/:id

  • METHOD:

    PUT

  • DETAILS:

    • Queries the DB for an assignment with the given Id.
    • Edits assignment's "name, link, and notes " properties.
  • RESPONSE:

    SUCCESS

    { success: true, updated_assignment: Assignment_Object, message: "Updated assignment." }

  • URL:

    • /assignment/:id/check

    • /outcome/:id/check

  • METHOD:

    PUT

  • DETAILS:

    • Queries the DB for an assignment with the given Id.
    • Updates assignment's 'complete' property to either true or false in DB.
  • RESPONSE:

    SUCCESS

    { success: true, assignment_complete: true/false, message:"Assignment status updated." }

general-assembly-task-manager-api's People

Contributors

marieltrull avatar mj-z-ali avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.