Inspiration

This project was inspired by WakaTime and the amazing Discord Bots!

Using this project, the productivity of the pod can be monitored without interfering with privacy and can be used to have a healthy competition within the pod. The pod leader (or anyone in the channel) can see the performance of all fellows in that week (or all-time data) in the form of a leaderboard. 🧑🏻‍💻

What it does

Kaal shows the fellows' work time and productivity at a glance within Discord and a simple CLI tool to track each fellow's coding routine while working for the fellowship.

How we built it

We divided the project into 3 major components, namely:

  1. Discord Bot: The task of Discord Bot is to listen for commands like !register, !status, !leaderboard to return appropriate responses. For this we setup a project using discord.py package which helped us to interact with the Bot via REST APIs.

  2. CLI Tool: The CLI Tool itself consists of two portions: The Click CLI which is used for interaction and a daemon ticker script which listens for the active window changes and log them into a file. The responsibility of ticker is to push the activities data after every 10 minutes to the backend and when the user checks out.

  3. Flask Backend: The Flask backend listens for requests from the CLI and does the major job of storing data in the backend (Firestore) or relaying commands to Discord Bot server via WebSockets.

Challenges We ran into

  • Creating a connection between Flask server and Discord Bot:

The problem here arises due to the fact that Flask server is synchronous and Discord Bot is asynchronous. So there was a problem in connecting these two as Discord Bot didn't send the responses immediately. This required an in depth study of Async/Await to use this perfectly.

  • Git rebasing to resolve conflicts:

We faced issues while rebasing and synchronizing our local folders with the remotes. We had issues with commits being shown in the wrong places if multiple people were bug fixing a Pull Request.

  • Firestore query calls:

The Python Module of Google Firebase doesn't have the documentation as compared to its counterparts of NodeJS and Java. This lead to us being searching for the correct way to implement the features required.

Accomplishments that I'm proud of

  • Learnt about good open-source practices:

The team learnt about Good Open Source practices as we tried to follow a proper reviewing structure and worked on various branches simultaenously. We used Kanban Boards and GitHub issues to track our progress and upcoming tasks.

  • Discord Bot:

We learnt how to build a Discord Bot, connect it with our backend.

  • Daemon script to watch active windows:

The daemon script is one of the most important parts of the project which worked in background to watch the active window changes. Running it in background and constantly logging data was a major achievement. This script is controlled by an external flag file which required some work to be done so it can work flawlessly

  • Non-relational database:

We experimented with a Non relational Database like Cloud Firestore for the first time. Moulding our heads into a NoSQL world was a tough job to accomplish as we didn't have the leverage of SQL Queries anymore.

What's next for Kaal

  • Comprehensive Leaderboard

Kaal currently features a bland descending order sorted list to show the productive times of the enitre pod. We intend to improve it further by making it look better and add timeframe options like weekly|all-time|today.

  • Smarter monitoring of windows for separation of productive & non-productive tasks

We are employing a naive system to judge whether the user is doing something productive or not. We are simply tracking the popular IDE's to contribute to the coding time. By smarter classification, we will be able to give a more accurate picture of what's happening at the users end.

Built With

Share this project:

Updates