DEV Community

Cover image for I Built Zigistry, a Package Registry for Zig with No Money (except $3 domain name)- Here's How
Rohan
Rohan

Posted on • Originally published at Medium

I Built Zigistry, a Package Registry for Zig with No Money (except $3 domain name)- Here's How

Zigistry's link

Please ⭐️ to support this project

A place where you can find all the libraries and programs that suit your Ziglang needs. - Rohan Vashisht

There have been 2 main goals of Zigistry:

  • Speed, secure, ease of use, to the point
  • $0 investment, funds (except the domain name itself)

But how can I achieve all this without even investing a dollar?

The creation of a package and programs manager for Zig programming language.

Context: On 22nd June 2024, I was having a conversation on the Zig discord server on how I can fix a few errors in my morse code library for Zig, when I asked how I can put it on a Zig package manager, I realized there wasn't a place like that.

By the next day, I had created the first version of Zigistry in Preact (a 3KB alternative to React). With a backend (cron job) code that would fetch the packages from GitHub and store them directly on GitHub in JSON format. This script automatically runs every hour using GitHub workflows. The website was hosted on Vercel (as a hobby project), taking advantage of Vercel's great zero-config hosting capabilities.

Although Preact worked perfectly fine for a few weeks, I saw the number of Zigistry users growing, hence, I thought to do server side rendering (SSR) to give a much needed performance boost. But I found server-side rendering with Preact lacking in ease of use, hence I switched to Next JS.

Next JS is just great, it works and integrates very well with Vercel. Implementation of SSR was simple and performance was great. By this time, Zig community showed great support for Zigistry, and the number of users on Zigistry were continuously increasing, from 10–20 per day to 400–500 per day.

I soon switched Zigistry to a GitHub organization from https://github.com/rohanvashisht1234/zigistry to https://github.com/zigistry/zigistry.

And saw this on my screen:

page showing paid subscription for Vercel when hosting using an organization

I want Zigistry to be completely investment free (except the domain name). Hence, I switched Zigistry to Astro JS framework, and hosted it onto Netlify, which offers free hosting with a build-time limit - but I exceeded that limit within a few days.

Astro JS is a great web framework for content-driven websites, and my SEO was boosting because of Astro JS, but now came the security parameter, I had to implement security headers because more and more users were coming to Zigistry and implementing CSP in Astro JS is not well supported. Hence I found the perfect frontend framework for me, Marko JS.

For me, Marko JS served as an excellent static site generator, thanks to its static adapter. I can now combine the facility of static site generation with security, with 4 to 5 seconds of build time and small export size.

I hosted this onto Cloudflare and it worked great for a few days, but then I suddenly got a message that the functions folder's size limit is 3MiB for the free plan and 10 MiB for paid. This is the folder that contains the API's source code. I was importing JSON files larger than 3MiB - essentially Zigistry's database. Hence, I had to move my APIs to a hosting service for free, and with a huge file size limit.

A few days ago I was using hugging face to create an AI based search for Zigistry, hence I realized I could shift the entire API to Hugging Face's Docker environment, with Bun serving the backend - and it worked! So now, I had the APIs working on hugging face and the frontend working on Cloudflare.

In conclusion, creating Zigistry really helps me learn a lot of skills and discover new platforms.
Day by day, I continue improving Zigistry - a package and program manager for the Zig programming language.

Top comments (0)