Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock endpoints for backend. #30

Merged
merged 7 commits into from
Feb 3, 2022
Merged

Mock endpoints for backend. #30

merged 7 commits into from
Feb 3, 2022

Conversation

krashanoff
Copy link
Collaborator

@krashanoff krashanoff commented Jan 31, 2022

This PR is a collaboration with @svetly-t and @pkrish20 to mock up mission-critical endpoints for the backend. They provide no functionality, merely valid requests so that the frontend can accommodate the interface established.

I'm not entirely sure why I can't assign more than a single reviewer and assignee to this ticket, but this PR should be produced in close collaboration with the frontend-oriented devs to create an API that "makes sense".

In addition to mocking endpoints, this PR fixes a type conflict between two of our database schemas.

Endpoints

  • Create user
  • Create class
  • Create class invite
  • Join class
  • Get assignment information for a specific user
  • Get class info
  • Upload grading script
  • Upload submission for assignment

Nice to have

  • Definitive documentation source

Closes #14.

@krashanoff krashanoff added the backend Concerning the backend label Jan 31, 2022
@krashanoff krashanoff added this to the MVP milestone Jan 31, 2022
backend/main.py Outdated Show resolved Hide resolved
backend/main.py Outdated Show resolved Hide resolved


@app.route("/<class_id>/invite", methods=["POST"])
def create_invite(class_id):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want to generate multiple invite codes, I'm not sure if this method would overwrite previous invite codes, or just generate a new one where other old ones are also valid. I think it's best that only one invite code exists at a time!

Copy link
Collaborator Author

@krashanoff krashanoff Feb 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't. It depends on how we implement it. If you check over the schema for the database, we have it so that multiple invites can be generated for a class, each with their own expiry date. It's kind of like Discord in that regard.

I'd like to get a second opinion on this before we move forward with the one invite code approach, if that's what the team would like.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah let's talk during the team meeting! I'm fine w either tbh so this is fine to keep the code like this

@krashanoff
Copy link
Collaborator Author

@cindyrzheng We are writing docs to address your concerns!

@krashanoff krashanoff added the documentation Concerning documentation label Feb 1, 2022
* Move class-related endpoints to /class.
* Add docs to README.md.

Co-authored-by: pkrish20 <preethask@g.ucla.edu>
Co-authored-by: svetly-t <svetly-t@users.noreply.github.com>
Copy link
Collaborator

@cindyrzheng cindyrzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs look great- super thankful that you guys wrote them up! appreciate it

Sent in some lingering questions about invite code into the groupme but this makes sense if we do discord style invite codes!

lgtm

@krashanoff krashanoff merged commit 52d99be into main Feb 3, 2022
@krashanoff krashanoff deleted the krashanoff/mock-endpoints branch February 3, 2022 21:43
@krashanoff
Copy link
Collaborator Author

Squash merged. Discord-style invites can be fleshed out a little more as we discuss. For now just having an expiry is fine. I'll likely add a ticket for an endpoint to invalidate an invite manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the backend documentation Concerning documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scaffold backend
3 participants