The PERN stack

pernFor the last year or so, I’ve been working in a pretty standard Javascript stack – Mongo, Node, Express, React. Modeled on the so-called MEAN stack, this has the advantage of a native Javascript data store along with some reasonably mature tooling. But I wondered – why didn’t this have its own four letter acronym? Could it be that people realized something wasn’t quite right? Truth be told, I never really warmed to Mongo – what would this look like with a traditional relational database?

And so it is with great pleasure that I present the PERN stack, composed of Postgres, Express, React, and Node. The reference code has a backend API and a simple frontend React app which allows you to create an account, login, and log out. It also has an awesome acronym – hoping to get the amazing Michael Whelan to do the O’Reilly book cover.

Seriously, though, this was a fun project. There’s still plenty to do, but there were a couple of good lessons along the way. There were little things, like the fact that ES7 async/await makes all your asynchronous code so much better – if you’re still working in Bush-era Javascript idioms, it’s time to start re-evaluating some of your life choices. There were obvious things, like that the tooling exists, and that language/engine choice isn’t destiny – just because you’re working in a Javascript stack, doesn’t mean you can’t have your RDBMS too. And most importantly, that building something by yourself, from scratch, will teach you way more about why things are the way they are than working in someone else’s code base.

Still, reference code is key, and this is my personal contribution. Enjoy!

Enter your email address to follow this blog and receive notifications of new posts by email.

3 thoughts on “The PERN stack

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s