DEV Community

Cover image for My journey of making a side project which makes passive incomes
Chris
Chris

Posted on

My journey of making a side project which makes passive incomes

Hello, I want to share my story of how I have created my side project of html2pdf.app. You can see from the domain that it is the HTML to PDF conversion API.

Working as a full-time developer I was living quite a normal and good life. But one thought from time to time was coming to my head - creating my own project which makes money.

I decided to do something for a very specific niche, to avoid high competitiveness and where I have some experience. So I came up with the idea that a HTML to PDF API conversion service online would be a great one to start with.

Almost in every company where I worked, I had to implement some PDF generation feature and in old times it was very challenging to do.

How did I start

When I was starting a new project I decided to learn something new at the same time. Also if my project would not be successful at least I could learn something useful.

Being a PHP developer for a long time I had also experience with JavaScript and at that time the NodeJS framework was quite interesting to me. Also, I knew that there is a Headless Chrome engine which is very convenient to use with the Puppeteer library.

I noticed that using Headless Chrome converted PDFs are high quality and quite similar compared to the HTML. I understood that Headless Chrome has the power and I need to leverage it!

Since I have a full-time job and family, it was a challenge for me to find time to develop my side project. So I started to work on weekends, very slowly but I was moving forward.

NodeJS framework was unfamiliar to me and took significantly more time to do the same things which I could do with PHP. I did not know even how to use the debugger, or how to structure my app from the beginning. But after some time I was feeling more comfortable in this stack.

Tech stack

These are technologies that I have chosen to use. One thing which I would change is perhaps choosing golang instead of NodeJS.

  • NodeJS/TypeScript + ExpressJS/NestJS frameworks;
  • Mysql for permanent data storage;
  • MongoDB for storing conversions logs;
  • Redis for caching;
  • RabbitMQ for async jobs and async communication between microservices;

Also, I integrated third-party services like sentry, mailgun, stripe, mailerlite which are very helpful and make developer's life easier.

Microservices architecture

Since I chose microservices architecture things became even more complicated. It took a bit of time to set up multiple services to make communication among them proper.

So from my practice, I would suggest once you are doing a startup/side project and are focusing on how to make money not gain experience in a new field, skip new/fancy technologies, and create a monolith system, which could be scaled further.

The diagram below illustrates the relations between the microservices of my project.

HTML to PDF API microservices relations schema

Where to get customers?

So finally I launched my service totally free. My plan was to get new customers and make sure that my service is useful to somebody. And actually, it was useful, new clients were registering, and I do not know how I became on the first page of a Google Search by keyword “HTML to pdf API”. I also set up Google AdWords to get more new customers.

First paid customer

After some time I noticed that customers who are using the HTML to PDF conversion service are very grateful, some of them even asked how to send money for using the service. So I decided to monetize the service and establish a small company to make everything legal.

I left a free plan for the clients with limited conversions per month and also created paid plans, and things started moving forwards. I was very happy when I could cover server expenses and pay taxes without using my own money.

Currently, I have over 50 paying clients, not many but still a good achievement for me making passive incomes.

Challenges I faced

First of all, NodeJS has no static typing so it was very uncomfortable for me, even an IDE didn’t show autocompletion.

I was struggling with this for some time and decided to use TypeScript, so rewrote all the code in this language. It took some time to rewrite and set up the project to use TypeScript but it was definitely worth it.

Headless Chrome scalability and AWS Lambda

Another challenge I encountered was scalability because I was using a headless chrome engine just directly installed into the server where applications run.

From time to time I noticed that one instance of Headless Chrome sometimes crashed when there are more requests. So after some attempts to solve this problem, I decided to try the AWS Lambda function and the results were stunning.

It scales automatically and is able to handle high loads. Setting up a working Lambda function and Puppeteer library was a bit challenging but I managed it successfully.

Conclusion

As I wanted to learn and develop a project at the same time, I decided to use microservices architecture to gather more experience and this was a mistake.

I spent a lot of time making microservices work and increased the complexity of the whole infrastructure. If I could give a suggestion for someone who is starting a startup I wouldn’t recommend chasing cutting-edge technologies and definitely do not start with microservices.

Create an MVP first, and check how your audience is reacting to your product and what changes you need to make after the feedback. Then when you see that your project could be beneficial do some cleanups, refactoring, splitting things into microservices, etc.

No doubts, I learned a lot of new things and got an experience that I could not get at work working on regular projects.

There are many things that could be improved and make service better, but overall, I am happy to have created this project and had this experience.

I feel like I am growing as a professional by learning new things, and solving problems at the same time making my side project better.

That was my story, hope you enjoyed reading it. If somebody is interested more to know technical details I could answer with pleasure in the comments.

Top comments (0)