A lot of non-profit and humanitarian organizations came forward to help people in the covid era, many lives were saved by complete strangers!! However, a lot more lives could've been saved and a lot more people could've been helped if the entire crowd funding process was optimized.
The only problem with traditional online crowdfunding is that it is highly based on popularity. But just because something didn't caught attention doesn't mean that it's not important. Than we saw the Tokyo Olympics and many organizations came out to fund the terribly underfunded teams and athletes who went ahead to display an excellent performance at the event. So i thought, crowd funding campaigns should be for every domain, and for both short term and long term aims. So i went ahead to create this platform.
What it does
YRAK is a platform which lets people donate money in terms of a digital currency called Ruby which has a fixed value ($5 for now). All someone who wishes to contribute has to do is, buy some rubies, even one can do! The money from that transaction is than set to the pool of money and an algorithm inspired from multilevel queue scheduling algorithms used by operating systems distributes funds to different campaigns registered by non-profit and humanitarian organizations.
How was it built
Since this was meant to be a web platform and I have worked with Django for quite some time, I decided to use that as back end. I wrote the entire scheduling algorithm in Python and integrated my database with cockroach DB cloud.
As far as the working of the algorithm is concerned, the application has eight major models. The first one is User which contains information of all signed up users who donate money . Then there's Category. A category is simply the domain to which the campaign belongs and that category marks the priority of the campaign. For example Healthcare takes priority one and arts and music support to local groups take priority 4. Then there are campaigns which are registered by organizations. each campaign has a requirement setup, and when that requirement is met the campaign becomes inactive. There is one Universal model called state which is non accessible via the admin site. This state simply contains the current campaign to which the fund will be transferred to upon a transaction and the total pool of money available right now in terms of rubies.
As it is not possible to populate and depopulate Python Data Structures every time a transaction is made, a queue Data Structure has been made out of the SQL database. It uses mainly two models called Queue and item. An item is simply the campaign which has to be funded and it contains and integer field called Quantum. Every time that campaign is funded, the quantum is decremented and as it becomes 0, its value is set to 4 again and it is sent to a lower Priority Queue. Initially a campaign of X priority is sent to a queue of the same priority, but as the campaigns get funded and Quantum gets updated, the priorities change ensuring that no domain and no campaign goes untouched and a fair distribution of funding takes place. All information regarding user transactions and funding are stored in the model Ruby which helps maintaining transparency with the donors.
Challenges we ran into
I don't know if i should say it out loud.. but i picked up way too big a project to be complete in just 48 hours!! Using standard database models as database structures like stacks and queues was something i could find no help in! So, i just had to put my head to it, hit and trial method, in order to get it working. Since i didn't had a team this time, i had to work on both UI and back end by myself! (And i have taken a mental note to not take up projects this BIG for hackathons lol). Also, i usually work with SQLite or Alchemy. This is the first time i integrated a non-default database (about time!!), and went ahead with Cockroach DB. Though it has a well written documentation, the first time is always tricky. But the mentors were really helpful while i was setting up the database. Kudos to team Cockroach DB. Last but not the least Multilevel feedback queue seems straightforward in theory, but i came across never before seen errors, both logical and technical!! As i said, i miscalculated my abilities a little here and picked up way to big a project for a hackathon!!
Accomplishments that we're proud of
Though i didn't complete everything i intended to.... I am still proud of everything i made. I went ahead and implemented a complex scheduling algorithm used in operating system processes and did a variant of it in python-django, and i feel awesome. I understand whatever i coded in these two days is not enough to get me a prize at this hackathon, but i believe in this idea and think that it can be something bigger. So i am gonna brush up a little, and apply to the cal hacks fellowship.
What i learned
A lot!!!! I can't even remember everything, i am gonna sit with a pen and make notes going over these two days... Things you can do with python keep getting interesting, than of course there's integrating the website with cockroach DB with the ssl certificate and everything, and there's of course a great surge of personal growth after each hackathon. I am gonna come back again stronger!!
What's next for Your Random Act Of Kindness
To put it in as simple words as i can, optimization, bug proofing, feature adding, deployment, and who knows... maybe my own little non-profit company! (fingers crossed)