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

Find new REST API framework #42

Closed
JustinLex opened this issue Sep 9, 2019 · 3 comments
Closed

Find new REST API framework #42

JustinLex opened this issue Sep 9, 2019 · 3 comments
Assignees
Labels
Backend All stuff related to backend work
Milestone

Comments

@JustinLex
Copy link
Member

We currently have a basic REST API setup using flask-restless to automatically generate a REST endpoints from our database ORM.

However Flask-restless seems to be unmaintained for over two years now, and we'd be better off using another Flask framework, maybe just standard Flask? This bug is particularly annoying.

@JustinLex JustinLex added the Backend All stuff related to backend work label Sep 9, 2019
@JustinLex JustinLex added this to the 0.1 milestone Sep 9, 2019
@JustinLex JustinLex self-assigned this Sep 9, 2019
@JustinLex
Copy link
Member Author

Been working with Django-Rest-Framework a bit, and the way it handles serialization and middlewares is really sexy. I think we might want something more modular than Django, though.

@JustinLex
Copy link
Member Author

JustinLex commented Dec 26, 2019

Using Marshmallow with Flask and SQLalchemy integration now. Pretty much the same functionality as flask-restless, but much more flexible and actually maintained.

One of the neat tricks we can do is provide a url to related objects instead of nesting them in the JSON response (known as an HATEOAS design). I think this is the best design, as the flat JSON we output is easily importable into JS objects from the Immutable NPM libraryo and the client can decide to load exactly the data it wants, on the fly. If, say, we're loading comments about a member, we don't have to load them until the comments tab is opened on the UI, and we can just load the ones that are currently visible (plus some buffer). Having the API give direct URLs should also make it easier for other students to develop off the API, as they can just follow the links.

@JustinLex
Copy link
Member Author

Using FastAPI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend All stuff related to backend work
Projects
None yet
Development

No branches or pull requests

1 participant