3. I am a 3rd year CompSci undergrad at IIIT Vadodara, India.
I have been doing software development since 2013.
The first language I developed in was AutoHotkey.
The first (big) project I did was a Bot Editor for Counter Strike.
is.gd/CSBEd
After that, I developed Clipjump which I continued development for 3+
years. is.gd/clipjump
Meanwhile I also developed a lot of AutoHotkey scripts and libraries.
4. A shout out to the AutoHotkey community for bringing out the
developer in me.
I also started doing some competitive programming in 2014.
Before 2014, I only knew AutoHotkey as a development language. I started
learning new development languages like Python by 2015.
Then I did some open source projects. Everything is public on GitHub.
By 2016, I was confident in Python and some popular frameworks, hence I
managed to crack GSoC.
5. GSoC 2016 was one of the most memorable periods of my life. It feels my
life changed exponentially during that time.
Then I had a chance to mentor students in Google Code-In under FOSSASIA.
Right now, I work as a contract developer at Appbase.io.
I mainly do backend and Android (ND) development.
Scripting and Web scraping intrigue me.
6. Me and FOSSASIA
I came to know about FOSSASIA through GSoC 2016. Since then, I have tried to
be active with FOSSASIA and contribute to it whenever possible.
“ FOSSASIA has a very friendly and open community. I think this is what I
like the most about it. Anyone can be a part of it so easily.“
8. What’s so about the Open Event project?
Tech Events and Conferences are being organized since the beginning of time.
They are important to propagate ideas, new tools, concepts and for
networking.
It is high time we needed an open, powerful and customizable tool to manage
these events.
Hence, Open Event.
9. Ah I see, so what’s an API?
API is a way for apps to interact with a server.
Speaking in layman terms, it’s the language in which a server talks to the user.
Like every language, it has a fixed known grammar (syntax).
Updating the grammar requires everyone else knowing about the update.
12. So why API is needed?
You might have figured it now.
API is the bridge that connects a backend server to the rest of the world. Eg >
Android apps, websites.
13.
14. A little about the codebase
Open Event server is written in Python (2).
Uses the Flask framework.
Database handled through SQLAlchemy.
DB migrations managed using Alembic.
16. Choosing a framework was a very key step. It can so easily affect the entire
of the Open Event project.
We had a few key points in mind -
1. Modular
2. Hackable
3. Ease of Documentation Generation
30. What’s this sorcery?
Something like this can be achieved by following some conventions.
● Input and Output models are defined distinctly.
● Resources are defined.
● Models are attached to each method (get, post etc) inside resources.
34. API Auth in Open Event
● For authorization, Open Event allows Basic, JWT and Session based
authentication.
● Basic = username:password , JWT = Token based authentication
● So you can use the full API from any place you prefer (browser, curl,
code).
35. Example Code (concept)
def requires_auth(f):
@wraps(f)
def decorated(*args, **kwargs):
message = 'Authentication credentials not found'
success = False
# process request
if success:
return f(*args, **kwargs)
else:
raise Exception(message=message)
return decorated
@eventSpace.route('/')
class HelloWorld(Resource):
@requires_auth
def post(self):
return {'id': 1, 'name': self.api.payload['name']}
37. What’s this?
Import/Export feature of the Open Event is what makes it truly open.
It will allow you to export an event to your computer and then import it back
on any server.
EventYay -> Your PC -> MyEventzz
38. Why should one use this?
● Use as a event template
● Peace of mind, full backup of your event
● Correctly archive events
Also,
● Exported event can be used to create a static website and app for your
event, is that anything even cooler than that.. And that too for free.
39. Ok, so what Open Event can do is -
1.Help me to manage my event (CFPs, Tickets etc)
2.Create event’s own app
3.Create a static website for the event
4.And all this is for FREE !!
40. Working of Import/Export
● Exported event is nothing but the API outflow of the event. They are saved
as single json files.
● To export images, videos etc, they are first added to the zip in an
organized manner and API data refers to them instead of their web url.
● For importing, it’s just the reverse. Feeding the json data to the API to
create the event.
Simple, isn’t it.
43. Background tasks, what?
Some tasks should never run on the main thread of the server.
Like sending emails, import event, export event.
We use Celery for queuing tasks to the background.
44. What is Celery?
Celery is an asynchronous task/job queue based on distributed message
passing.
Uses Redis, a simple key=value store for message passing.
You add tasks to queue and they are run asynchronously, one after another.
45. Using Celery with Flask
Thanks to the community, we have official libraries for celery and redis in
Python.
pip install celery redis
A short tutorial is at https://is.gd/FlaskCelery
46. More resources
Me and Shivam (@shivammamgain) worked on the API part. You can visit our
API-related blogs for more info.
Mine’s: https://is.gd/OpenEventApiBlog1
Shivam’s: https://is.gd/OpenEventApiBlog2
This is body. We have status codes, response types, header
Status code = traffic lights, colors, sentences, stuff
3 - work ctsly, need to be updated, so 3
2 - neat codebase, so can hack
Why no framework is even an option? - flask is light, we can create our own minimal helper modules and use them all around.
Restplus and restful are similar, but docs.
Not sure.. If it was inspired.. But good way to consume APIs, you will soon see..
Speak about current dev online
Add a screenshot here
Add a screenshot here
Add a screenshot here
Add a screenshot here
This might not make sense to you r.now so let’s go ahead.
This might not make sense to you r.now so let’s go ahead.
Request global object, flask login user object
API endpoints can create apps and websites I think.