Skip to content

Backend Routes

Derek Roode edited this page Apr 16, 2021 · 14 revisions

/api

user_routes

  • /users/
    • GET
      • Get a list of users
  • /users/<int:id>
    • GET
      • Get a user by id

auth_routes

  • /auth/
    • GET
      • authenticates a user
  • /auth/login
    • POST
      • Logs a user in
  • /auth/logout
    • POST
      • Logs a user out
  • /auth/signup
    • POST
      • Creates a new user and logs them in
  • /auth/unauthorized
    • GET
      • Returns unauthorized JSON when flask-login authentication fails

group_routes

  • /groups/
    • GET
      • Get all of the groups
    • POST
      • Create a group
  • /groups/<int:id>
    • GET
      • Get a given group
    • PATCH
      • Update a given groups information
    • DELETE
      • Delete a given group
  • /groups/<int:id>/comments
    • GET
      • Returns comments for a given groups
    • POST
      • Creates a comment for a given group
  • /groups/user_group
    • GET
      • Returns current users groups
    • POST
      • Add a group to current user groups
    • DELETE
      • Removes a group from current user groups
  • /groups/user_group/<int:id>
    • GET
      • Returns single user group
    • DELETE
      • Removes single user group

comment_routes

  • /comments/<int:id>
    • GET
      • Get data for a given comment
    • PATCH
      • Update data for a given comment
    • DELETE
      • Delete a given comment

action_shot_routes

  • /action_shots/
    • GET
      • Get all of the action_shots
    • POST
      • Create an action shot
  • /action_shots/<int:id>
    • GET
      • Get a specific action shot
    • DELETE
      • Delete a specific action shot

progress_photo_routes

  • /progress_photos/
    • GET
      • Get all of the progress photos
    • POST
      • Create an progress photo
  • /progress_photos/<int:id>
    • GET
      • Get a specific progress photo
    • DELETE
      • Delete a specific progress photo

workout_routes

  • /workouts/

    • GET
      • Get all of the workouts
    • POST
      • Add a workout.
  • /workouts/<int:id>

    • GET
      • Get a workout by id
  • /workouts/my_workouts

    • GET
      • Get all of the workouts for a given user
    • POST
      • Add a workout to a users workout table
  • /workouts/user_workouts/completed

    • GET
      • Get the total number of workouts completed by all users
  • /workouts/user_workouts/completed/user

    • GET
      • Get the total number of workouts completed a single user
    • PATCH
      • Update the workouts completed by a single user

Clone this wiki locally