DEV Community

Cover image for Backend Generator
Leshawn Rice
Leshawn Rice

Posted on

3

Backend Generator

Every time I make a backend in express, there’s always a small period of time at the start where I’m writing the same code just to get the backend setup.

Error methods, authentication middleware, a user model, the database, basic login/register routes. All of these are essentially the same across my express backends save for the database schema.

As I started up on configuring the backend for my latest project, I thought to myself, “Why don’t I just automate this?”

Now, there are already tools available to generate an express backend for you, but as I’ve been working with ansible a lot lately at work, I figured I’d write a playbook to quickly generate an express backend with some basic user input.

The result is express-generator.

express-generator is essentially an ansible playbook run by a bash script that just takes some input to pass as variables to ansible. It’s lightweight, quick, and super easy to use: just download the source code, run bash setup.sh, then the next time you wanna create a backend in express, simply run express-generator from the command line and voila!

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay