Sunday, 2 October 2016

GSoC'16 overview

It's been an entire month after GSoC'16 ended. I provided a GitHub link of my contributions as the final submission link. I didn't write a blog post covering my contributions. This post covers my work done during the GSoC period. It contains links to some of my posts at I mainly worked with the APIs and the Permissions system.

# APIs


A part of the project was creating Swagger specification for our APIs. Our application was written in Flask and APIs were supposed to be written in Flask-RESTplus. The best part about RESTplus was its integration with Swagger. You could document your API Views and it would generate the specification. RESTplus provides Pluggable Resource views that can be extended for GET, POST, PUT and DELETE request handlers. It also provides decorators for documenting other details about the Resource, like response models and possible error responses.

API Error Response Models

During the initial GSoC period we spent some time on discussing how the APIs should be structured. Here's an Issue#336 of the same. Later that period I defined error response models for the APIs. Implementing them was quite easy with RESTplus.

ETag based caching for GET APIs

This post includes implementing ETag based caching and how clients can cache responses based on the ETags.

# Permissions System

Roles and Permissions

Apart from the APIs I also worked a lot on the Servers Permission System. It included defining System Roles and Event Roles that could be assigned to users. The blog post covers these roles and their permissions in detail.

Shell Hacks

A small post about some hacks I took up to increase productivity when using shell.

Permission Decorators for APIs

If you have defined the APIs nicely, then implementing permissions becomes really easy. As I told before, Flask RESTplus provides a Resource class that has get(), post(), put(), delete() methods to deal with the different request methods. We had DAOs (Data Access Objects) defined for our database models that had create(), update() like methods defined for them. Every Resource was bound to a DAO, and fulfilling an HTTP request meant using a DAO method according to the request method.

To implement permissions, I created decorators over the DAO methods create(), read(), etc. The post is about the same.

# Real-Time user notifications

Setting up Nginx and Gunicorn for using Sockets

This post is about setting up environment for creating Real-Time user notifications.


Implementing User notifications through WebSockets using Flask-SocketIO.

# Others

Apart from these I also worked on Tickets, mainly UI and form handling.

Multiple Tickets: UI

Multiple Tickets: Backend

AJAX image upload

User Notifications: DB model