image

written by: Engineering

Ghost Remix

Hello World

Today we’re releasing our first project, GhostRemix, an easily extensible, easy-to-deploy blog built with several popular open source tools.

Why?

Earlier this year we decided to start publishing some of our thoughts on software development. We looked around at the available blogging platforms, and while we found elements we liked, we wanted something that would make it easy to jump into the code ourselves and make a few tweaks. We had a few criteria. First, we didn’t want to reinvent the wheel. If some existing tool served our need, we’d use it. But, we also wanted to be able to easily update the reader-facing UI to our liking. After considering our options, we eventually settled on using Ghost as a headless CMS with Remix. Below we’ll explain how we came to this decision and go through a few key features and design choices.

Features and Choices

Ghost

We first encountered Ghost years ago when it emerged as a lightweight alternative to Wordpress. Ghost had a few things going for it. It’s an MIT-licensed, open source project with an active community. The documentation features guides on self-hosting and headless setups, and the forum seemed like a useful resource for any where we might get stuck. They also had packages for the content and admin APIs. The UI uses Handlebars which wasn’t ideal for us, but we were leaning towards a headless implementation anyway. And since we were mostly concerned with customizing the UI readers saw, it helped that Ghost came with a clean dashboard we could use to write and manage posts.

Ghost also presented an opportunity to be helpful. Though the Ghost team has done a lot of great work to make self-hosting and headless easy, reading through the forums we noticed a few pain points for developers around authentication, comments, and newsletters in headless setups and some common stumbling blocks during deployment. We figured Ghost could provide a strong foundation to build what we wanted, and at the same time, we could create something that would make the lives of some developers in the Ghost community a little easier.

React / Chaka UI / Remix

We wanted to use React for a few reasons. One, we have experience with it, and so do many other developers. This experience combined with a component library like Chakra UI that gives us a set of great-looking building blocks, makes it easy and enjoyable to create interfaces we like. Since we were already using React and the project involved some server calls, we decided to use a React meta-framework. NextJS is the most popular of the bunch. Plenty of developers swear by it, so I’m sure it’s a great tool in many cases*. But NextJS has a lot going on, and we’re building something relatively simple. We read up on Remix, and it seemed very straightforward. And its emphasis on relying as much as possible on the server aligns well with our ideas on web development. You can read more on the differences between Remix and Next here.

SQLite / Prisma / Fly.io

Part of why we considered these tools is that they featured in the Remix example code, and as mentioned before, we’re happy to use what works. But we had also considered these options for reasons outside of their inclusion in Remix’s examples.

SQLite has recently become a popular choice for small applications. Previously the thought was that anything in a production environment needed a “proper” database like PostgreSQL or MySQL (in contrast SQLite is basically just a file). Now frameworks like PocketBase and platforms like Turso (which offers managed libSQL, a fork of SQLite) have shown that SQLite is a viable option for certain kinds of applications. We’re fans of the simplicity of working with SQLite. Ghost recommends MySQL for production, but they’re serving major publications with needs much different than our own. We think SQLite is appropriate for our use case.

Developer experience was one of our key concerns. We wanted to keep it simple — one command to install dependencies and setup services and another to seed. Prisma made it easy to introspect Ghost’s database and print its schema to a file. Having this schema file as a reference was especially useful while writing seed scripts. As a bonus, Prisma comes with a GUI, which is handy for verifying database records.

We’d heard a lot about Fly.io recently as a competitor to Heroku. The internet said Fly offered easy, cheap deployments. We were in. And we have to say, it lived up to the promise. We’ve used many cloud providers, and Fly was one of the easiest to work with. And their rates are reasonable too. If you were fortunate enough to sign up for the Legacy Hobby Plan, there’s no monthly fee, and they don’t collect bills under $5. The new Hobby Plan starts at $5 a month, but after that it still offers the same bill forgiveness as the legacy plan.

Get to it

Big thanks to the teams who built the software that made this project possible. To get started with GhostRemix, check out the documentation here. Since this is an open source project, we welcome contributors.

If you just wanted an easy way to deploy vanilla Ghost from a GitHub repository, we’ve got you covered here.

Happy coding!

What’s Next

The UI is fairly standard now, but we’re working with a designer to add some pizzazz. If you’d like updates on that and other projects we’re working on, you can sign up for our newsletter here. We’ve also launched Dev Design Daily, a blog featuring our thoughts on software trends and articles about our favorite tools. You can check it out here.

*Actually we’re using Nextra, a NextJS static site generator for our documentation website; strongly recommend it.

© 2024
Powered by
GhostRemix