This blog isn’t powered by WordPress, Ghost, or any third-party CMS. I built it using Node.js, Express, MongoDB, and EJS all from scratch.
Here’s a peek under the hood at how it works.
/public for CSS, JS, and images├── server.js
├── routes/
│ └── articles.js
├── views/
│ └── articles/
│ ├── index.ejs
│ └── show.ejs
├── models/
│ └── article.js
├── public/
│ └── scripts/
│ └── NumberFormatter.js
/)In server.js:
app.get('/', async (req, res) => {
const articles = await Article.find().sort({ createdAt: 'desc' });
res.render('articles/index', {
articles,
formatWithAbbreviation
});
});
/articles)In routes/articles.js, I handle:
EJS templates handle the views, and Mongoose manages the database logic.
I wrote a tiny utility: NumberFormatter.js.
// Example usage
formatWithAbbreviation(12400); // "12.4K"
This keeps the blog clean and modern, especially for stats like views or likes.
app.use('/public', express.static('./public'));
All my CSS, JS, and media live in /public, and Express serves them directly.
This blog isn’t just a writing platform—it’s a playground for learning full-stack web development. I control every part of the stack, from server logic to templating and deployment.
If you’re thinking of building your own blog from scratch, I say go for it. It’s the best way to truly understand how the web works.