DEV Community

Cover image for Dev.to as a headless CMS
Visakh Vijayan
Visakh Vijayan

Posted on

Dev.to as a headless CMS

It has been long since I wanted to develop a website for blogging. Everytime I sat with it the one thing that disturbed me is that I have to setup everything from scratch - i.e. design databases, choose a framework for writing my APIs, test my APIs and many more. I was never a fan of coupled CMS like Wordpress.

Dev.to

That is when I started writing on Dev.to. The reason why I chose Dev.to over Medium has to be the activity I could see on a daily basis. I know Medium is very popular and is good to make some money writing. The thing was I wasn't sure whether the blog will lead to anything at all, because of the multiple projects I could see that are pending in my list.

I loved writing on Dev.to probably because of it's editor. No clutter, blackish background, markdowns possible. That is all that I ever needed I guess. So I started writing and soon I realized I don't have a nice home page if I wanted to show my blog off to my friends. And that is when I started wandering. And eureka.

The heavy-lifters

Dev.to actually has everything built in for you. They have APIs exposed publicly that you can use to create a nice front-end for your blog. The GET requests are free, while you need an API-Key for the POST/PUT ones I guess. But that didn't much matter to me as I just wanted people be able to read contents for the MVP.

It took well over a day to set things up. So the backend is powered by Dev.To (Thank you :D), the front-end is hosted on Netlify. It was made using ReactJs. The only cost I incurred was the custom domain I bought from GoDdaddy for 199 a year I guess. So that is it. Cheapest blog setup ever I guess. So essentially Dev.to does all the hosting for me. Thank you Dev.to developers for keeping the system in perfect condition always.

Here is the API documentation if you want to give it a go

How it ended

Here is how the blog looks like today. I am pretty sure I will start working on it soon again or atleast I hope.

Here is the desktop and mobile view of the blog.
Blog View

You can access the blog over HERE. I know there are a lot of improvements possible just as you open it. But it satisfied my use-case I guess - almost free blogger.

In my next post I will bring in an even fancier way of doing things using Strapi. Till then -

Happy coding!!!

Discussion (18)

Collapse
sroehrl profile image
neoan • Edited on

Have you considered blua.blue? That way you can write on one platform and then publish to your blog (and dev.to, if you want) using either an API or a webhook. This gets you around the canonical issue: when using dev.to directly to write, search engines will treat your blog as duplicate content. With blua.blue you can set your content accordingly without having to leave it as draft. Additionally, the webhook approach allows you to generate static content rather than "pulling" from an API.

Collapse
bwca profile image
Volodymyr Yepishev

Your post is quite intriguing, but the blue.blue link seems to be broken, at least for me 😞

Collapse
sroehrl profile image
neoan

I apologize, fixed the link

Thread Thread
bwca profile image
Volodymyr Yepishev

Thank you :D

Collapse
vjnvisakh profile image
Visakh Vijayan Author

Nice … will give it a go. Thank you

Collapse
miriamschwab profile image
Miriam Schwab

FYI Strattic is a platform where people can use WP as usual and click a button to deploy the site as a static, headless version.

Collapse
csgeek profile image
csgeek • Edited on

There is a wordpress plugin that does that and likely more than one but the bigger your site is the more annoying that becomes. That being said, a static site is about as secure as you can get.

wordpress.org/plugins/simply-static/

Collapse
miriamschwab profile image
Miriam Schwab

Strattic has incremental builds so when updates are made to a larger site a full, potentially long build doesn't have to happen. And yeah, a static site reduces the attack surface to almost nothing on a site.

Collapse
Sloan, the sloth mascot
Comment deleted
Collapse
miriamschwab profile image
Miriam Schwab

Strattic is an end-to-end service which deploys and configures all parts of the infrastructure: isolated and containerized WordPress hosting environment; the static hosting area; fully configured CDN that is invalidated automatically when changes are deployed from the WP origin. Customer support is top notch too. Disclosure: I'm from Strattic.

Thread Thread
vjnvisakh profile image
Visakh Vijayan Author

heehee

Collapse
kwadoskii profile image
Austin Ofor

Nice, but I would like to point out that your blog is mobile responsive.
Looks great on PC

Collapse
blackr1234 profile image
blackr1234

I just wanted people be able to read contents for the MVP.

Excuse me, what does MVP here stand for?

Collapse
csgeek profile image
csgeek

It's Minimum Viable Product, the minimum amount of work you can put it to release something that is functional. Aka version 1 that is usable.

Collapse
blackr1234 profile image
blackr1234

Oh yes, this is it. I know this term but forgot it, thanks a lot!

Collapse
vjnvisakh profile image
Visakh Vijayan Author

Meaning I can write and you can read for now. No other user actions like commenting, likes, newsletters and so on. Things you find on a normal blog

Collapse
trimud profile image
Yuriy Boev

Most Valuable Product

Collapse
trangchongcheng profile image
cucheng • Edited on

I had build a community by inspired from dev.to, check it out here: mytopic.vn

My stack: nextjs, strapi.

Feel free to leave comment...