Inspiration

I personally get easily distracted. I often catch myself spending more than 30 minutes on social media websites when I just needed to respond to a quick message or check a piece of information on a class group.

In order to keep track of the time I spent on unproductive websites I installed all kind of apps that either logged or restricted my access to the internet. But those apps were not flexible, they either blocked all access after a certain amount of time or simply posted a notification with no further consequences.

That's why I thought there should be an app that makes you work for your time spent on social media. In my experience there's no better way to appreciate something than when you've had to work to earn it.

The work done to gain access needed to be useful in itself, since I'm a student with exams coming up I concluded that educational quizzes would be a good fit. I could use the app to reinforce my studying as well as use it to help me learn Japanese or train for interview questions.

What it does

What the app does is block websites that correspond to your personal blacklist. But those websites are not completely blocked, if you wish to access them you can still do so but you must first answer correctly to a quiz randomly picked from your gallery. After successfully completing the quiz you'll gain temporary access to the website, once that ticket expires you will be blocked again. At that point you'll need to complete another quiz to gain access.

The quizzes in your gallery can be created locally directly on the app or they can be downloaded from the Quiz Shop where other users have uploaded their work.

How I built it

Chrome extensions are basically web pages that run locally on the browser, so I used HTML, CSS, Javascript and AngularJS. For the database I used FireBase, and to deal with the monetary aspect of the app I used the Stripe API.

Challenges I ran into

I wanted to make it possible to compile Javascript code directly on the website in order to have Algorithmic Questions among the quizzes. But Chrome has a few security measures in place that limits inline scripting. It is still possible to do it but it's in an indirect way and I've run out of time.

Edit: I managed to get this functionality working at the last minute. Otherwise difficulties with the implementation of this app was still due to how Chrome handles security as they make sure that no external script can't have access to core chrome functionality or user information. Thus Chrome makes developer jump through some hoops, which is a good thing of course but this wouldn't of been a priority for a hackathon app.

Accomplishments that I'm proud of

I've never developed anything that has to do with Chrome but in a weekend I've built something that I would personally use more than any of the dozen of chrome extensions that I have installed currently. Excluding ChromeCast and AdBlockr but I can't compete with that.

What I learned

Not to make assumptions that could be confirmed only at the end of a project. I had my eyes set on compiling Javascript on this extension and even though it is still possible (thankfully) it could of not been which would have jeopardized a large part of the use case I had in mind for the app.

For future projects I will make sure to check that all it's functionalities and dependencies are covered.

What's next for Akrasia

So many things.

First off I'd like to make it possible to compile Javascript code so that I can use Akrasia to practice technical interview questions.

After that I'll try to use Docker to make it possible to compile more than just Javascript.

In addition to that I'd like the url matching to use regex instead of the simple keyword lookup that I'm using currently.

After that I'll try to use the Stripe API to add financial consequences to irresponsible online behaviours. Users would all chip in a fixed sum at the beginning of each week, users that broke their own agreement will lose a fragment of that contributions which will go to a charity of their choice.

Finally I'd like to create a similar app but on mobile, by creating cloned shortcuts to apps it is possible to have the user pass a quiz first before accessing the original app.

Share this project:

Updates