Skip to content

Developers Getting Started with OK

soumyabasu edited this page Jun 10, 2015 · 6 revisions

Purpose

This a walkthrough of the ok codebase. After reading this document and going through the related function calls, you should be able to develop for ok and figure out (at a high level) what other pieces of ok your code touches and depends on.

Major Files

Backend

There are three files that you will need to know about for most ok feature development. They are:

  • models.py: These describe the objects that the ok database stores (e.g. course information, student submissions, etc). Each object, like in OOP, also has many methods that correspond to things that it knows how to do.

  • api.py: These describe the API that allow someone from the outside world to interact with our models. Many of these methods have the flavor of "Make sure this user has the right permission to do this action and then call the corresponding method on the model"

  • urls.py: Now that we have an API, we need to provide a way for people to get to it. This is what a URL does. The @app.route decorators match an API to the corresponding method. The register_api calls at the end are a formulaic way to make an API out of a class in the api.py file.

Frontend

TODO

Life of an API call

Final Steps

Now you should be ready to develop for ok! Take a look at the README for developer guidelines and installation instructions: https://github.com/Cal-CS-61A-Staff/ok