DEV Community

Namish Kumar Sahu
Namish Kumar Sahu

Posted on

A productivity tool with GitHub as your cloud database

I was in a dilemma when I was exploring different productivity apps for my personal purpose. I wanted a privacy first secured application that would have cross device sync. But most of the privacy focused applications are offline first.

Challenge

So here was the primary challenge. I have to build an application that will have multi device sync while having minimal or no cost for it. As I move forward building it I decided to make it open source. So I have to use such technologies and methods which can be easily replicated by others.

Approach

Vercel has a generous free tier, so the frontend deployment is sorted. And just to not have any more deployment related worries the frontend framework is decided to be NextJS for its compatibility with Vercel.
I decided to directly do API calls from the frontend which eliminates the need for a separate backend server.

Here comes the most interesting choice and its regarding the database. I want to make it as simple as possible. So I dumped the idea of SQL along with it Neon and Supabase as options were gone. The most realistic choice would be MongoDB Atlas but previously the cluster(MongoDB Cloud database) had shown many issues. It will go inactive at any random moment and you have to restart it from the console. Moreover I wanted a solution where the bottlenecks will be so unrealistic I should be using it for free and unlimited.

github database repository

Then the idea of using github private repository as the cloud database. But how my nextjs app will make changes in the github repo? The answer was to create a github classic token and give it the access to make changes in the repository and use its API for interactions with the app. And I did exactly that. I used three json files for categories, tasks and daily logs.

Results

So what do I have on the table now?

Open Source Repository

I deployed my NextJS web app on Vercel with proper environment variables. The website is responsive so I use the tool across all my devices. And I open sourced the code so anyone can fork it then create their github api keys and deploy it on Vercel (or wherever they want) for free.

Future Plans

Ok, let's get into the downsides. The data sits on your own github private repository. But it is still raw and unprotected. The next obvious step is to create an encryption algorithm. So I will find any suitable algorithm and integrate it.

The user interface looks completely AI slop for now. I am open to open source contributions regarding this. Otherwise, I will work upon it after being done with encryption algorithm.

Top comments (0)