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.
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?
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.
What's here for you
Go and explore the github repository. Kindly star and fork it that will be really helpful for me.
Steps to create your own habitforge lite
- Fork the repository.
- Create your own github api. Go for a classic token and make sure it is repo scoped. Take care of the token expiry, if it is set to any custom date except the never expiry option. You have to create the token after those specific days.
- Create another private github repository, which will act as the database.
- Connect your vercel account with github and deploy the frontend. Go to the environment variables. You can check env.example file and copy the variable names from it. Put your own password,api token,github id and database repository.
If you still face any issues or have doubts, you can comment here or contact me on X or Twitter(namishsahu01).
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)