#blog

Hello World


Live, at last.

 

Welcome to my first ever blog post in my recently launched personal website.

I plan to be very active here, averaging at least one post per week. Basically every rant that is too long for twitter, goes in here.

The topics will consist of anything related to programming and technology, occasionally even beyond that.

Read along to learn more about why and how I built it.

 

Why not Medium ?

Valid question. Using another blogging service seems like the trend these days for developers, with Medium leading the pack. But I didn't pick that path for a couple of reasons.

First of all, I wanted more customizability. I wanted something simple in design and functionality, catered to my needs. Which is a trade off you have to make when opting for a generic blogging service.

Another motivator: it was a fun little side project. Even though I didn't really use an unfamiliar tech stack (more on that below), I still had to dive into interesting unexplored issues, and learnt a few things. I also enjoyed the freedom of building something with no precise requirements; the application could be whatever I wanted it to be.

In addition, I like to own my stuff. The material on here is my intellectual property. I had to go with cloud hosting (I'm not yet willing to have a running server in my house), so it's not 100% "mine". But other than that, everything from the source code to the domain name is owned and managed by me.

A couple of months ago, Medium was blocked by the local government here, for the most absurd of reasons which are not even worth mentioning. It took weeks (months?) of complaints before it was finally unblocked. I feel safer having my own service. If anything like that happens, it's because of something I personally did (or forgot to do).

 

How It Started

Launching a personal website has been something I wanted to do for years. Actually, I think I wrote the first line of code for this project way back in 2018. I had been using Flask for several months, and the example from its documentation consisted of a small blog application. So it hit me: "What if I build something like this for myself, but with more features?".

And I started doing just that. But if you're a developer, you know how it goes with side projects. The excitement wears off after a while, life gets in the way, and before you know it, it's been months without writing a single line of code in it.  And so I bounced back and forth making small updates to it every now and then. It wasn't until 2 months ago, more out of necessity than anything else, that I decided I need to wrap this up.

 

Credits

As I mentioned earlier, my initial inspiration to build this website came from the Flask docs. Therefore, the starting codebase was very similar to it. Next, I added my own features, based on my other projects, Miguel Grinberg's Flask Mega-Tutorial, Brad Traversy's content (the CKEditor with which I'm currently writing this post), and online blog posts. I also used an existing css template for the landing page, but unfortunately I don't remember where exactly I found it, in order to credit them properly.

So yeah, even though there's tweaks of mine everywhere in the codebase, large parts of the project are heavily inspired by other people's work.

 

Tech Stack

Alright, on to the cool stuff. What was it built with ? What can it do ? The README of the repo does a good job at listing those, but I'd like to stress a few points.

For the backend framework, as you might have guessed, I used Flask. It is the one I'm most comfortable with, and I think it's just perfect for projects like this, where you don't need much out of the box.

For the main database, I'm using SQLite. I know what you're thinking...SQLite in production, that's crazy right ? But I don't expect to have many concurrent users performing write operations, so it should be totally fine. And if this site happens to go viral, I'll have other things to worry about (or celebrate). I'm also using an Elastic database for full text search. Which actually gave some headache during deployment, due to its high RAM requirements for my low spec VPS.

On the front end, it's just some custom css and Bootstrap. I do use a bit of vanilla JS on my own (other than Bootstrap's), but nothing too fancy. I missed a good chance to overkill the site with React, I know.

On the production server I have set up nginx and gunicorn, one serving the static files and the other handling the Python code.

I don't expect to be adding new features as we go, other than possible bug fixes, since the whole point of this application is to be something simple to use and clean-looking. But we'll see.