DEV Community

Cover image for Calling All NodeJS Wizards: What Would You Add to the Ultimate Boilerplate?
Ashley Childress
Ashley Childress

Posted on • Edited on

Calling All NodeJS Wizards: What Would You Add to the Ultimate Boilerplate?

šŸš€ TL;DR

I'm kicking off a new NodeJS starter template and crowdsourcing the best tips, packages, and ā€œwhy didn’t anyone tell me?!ā€ stories from the community. Drop your go-to NPM tools, must-have configs, or even horror stories in the comments. Bonus points for anything that saves headaches or sparks ā€œahaā€ moments!


šŸ—ļø Why I’m Building This

It’s hack time again and, okay, this project isn’t exactly going to win any beauty contests - but it’s overdue. I’ve been wanting a solid, ESM NodeJS repo template with all my favorite dev goodies baked in and ready to go: Husky, Prettier, ESLint, Vitest, and more.

āœØšŸ§‘ā€šŸ’» If we haven’t met: I don’t do anything halfway. I’m either all-in, or it sits in my ā€œwhen I have time (that never happens)ā€ pile. So I decided to go all out and create a no-nonsense, highly functional, plug-and-play template - one I wish I’d had at the start of half my projects.


🧭 The Plan (So Far)

Here’s what I’m thinking for v1:

  • Project structure: /src, /tests, /docs
  • Husky hooks:
    • Enforce Jira keys in branch names
    • Warn about big commits
    • Make sure all tests pass (debating how to handle skip...)
    • 85%+ unit test coverage
  • Prettier: Auto-format staged files
    • JS, JSON, Markdown—what else should I include?
  • ESLint (strict):
    • Airbnb + maybe Unicorn
    • Auto-fix
    • No warnings allowed
    • My custom rules:
    • Ban try/catch in test files
    • Block inline ESLint disables
  • CSpell:
    • Preloaded dictionaries + project-specific terms
  • Conventional commits / Semver / CHANGELOGS:
    • I’m a noob here - I know commitlint, but would love advice!
  • Vitest:
    • Unit + integration test scaffolding
  • Docs:
    • Simple, clean, GitHub-flavored Markdown
    • My goal is plug-and-play scaffold with an ELI5 "why" baked in
  • GitHub Copilot:
    • Starter instructions included

šŸ¤– If the last one surprises you, see my last few posts!


šŸ¦† For the Backend Ducks (and Frontend Folks Too!)

I’m a backend duck-typist at heart, so the first release will be vanilla JS (think REST/GraphQL/MVC logic), not frontend. But if you’ve got killer ideas for TypeScript or React setups, hit me up anyway! I’ll collect your suggestions for a ā€œfuture featuresā€ list.


šŸ§™šŸ» Share your wisdom below!

Stories, links, random ā€œdon’t do thisā€ advice - all welcome.

Let’s make NodeJS onboarding boringly reliable... and maybe a little less boring. 🫶


šŸ›”ļø RAI Disclaimer

Everything I share here is my own perspective—created with the help of AI tools (GitHub Copilot, ChatGPT, and their friends), but always with a human in the loop. I do my best to catch accidental bias and fact-check, but if you ever spot something odd, let me know! AI isn’t perfect, and neither am I.

TL; DR: AI helped, but you can blame me for the chaos! 🫠

Top comments (6)

Collapse
 
walter_johnson_ac90e6d485 profile image
Walter Johnson

I'll offer this story.

As a senior architect, I get to pick the tools, frameworks, and technologies for the projects I'm involved in. I've written several front-ends in AngularJS, Angular, Knockout, jQuery, and plain JavaScript. I'd always want to build something with React given all the hype around it. So I went looking for how to start a react project.

As any react developer knows, there are dozens of starter projects and starter templates. All of them have a goal of trying to set up a developer to begin writing code as fast as possible. I've used the vite starter template, BulletProof react, create-react-app, etc. You name it, I probably ran the npx run or git clone to get started.

I think the biggest thing I hated about the whole experience was that all of these starter templates would include a plethora of libraries I'd never used before and offered no explanation of why the library was included. Axios, zod, zustand, react-query; these were included as part of my "intro" to react and I'd never touched any of them. And with names that descriptive, I spent more time researching the package and its alternatives than I did writing code.

All that to say this. If you're creating a boilerplate, the most important piece is going to be the documentation.

  • What is the package and why is it in the boilerplate?
  • What are some alternatives, if any, to the packages you chose?
  • Is there anything in the project that depends on the package being present? Or can I chuck it if I don't need it? (like, if all I want to do is create a Pomodoro timer, I don't need AJAX or a data store)

There's more to the journey, but this is already long-winded enough.

I'd suggest adding plop or yeoman to your boilerplate. You can write your own templates for components, unit tests, etc. When creating a new piece or feature to add to your project involves creating more than one file, or a file with a specific structure, these tools are a must have. A quick yo component in a front-end framework will save you time and energy.

Collapse
 
anchildress1 profile image
Ashley Childress

That’s a great perspective—thanks for sharing!

Honestly, I hadn’t really thought much about the code itself yet, but you’re spot on about the packages. Up until a few months ago, I hadn’t touched frontend since college (which feels like a lifetime ago!). Having an intern this summer was actually perfect: gave me a chance to guide him and gave me cover while I figured out what half the dependencies were doing. Definitely not the most glamorous stage of a project!

You reminded me of something funny: I’ve started plenty of projects from scratch, but can count on one hand how many times I’ve used a starter. The idea of trying one didn’t even cross my mind for this 🤯 🤣 Guess I prefer to see where my own ideas take me first. Maybe I’ll regret that, but it’s part of the fun.

Really appreciate all your insights here! It’s a solid reminder of what to watch out for, and I’ve added all your points to my ever growing checklist. Please, if you think of anything else, send more my way!

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

this is extremely impressive, seriously. every time i've hacked together my own setup, something always trips me up months later and i end up regretting skipping some early config. you ever find there's a tradeoff between enforcing strict rules and onboarding new folks fast enough

Collapse
 
anchildress1 profile image
Ashley Childress • Edited

Thanks! šŸ˜„ This is one of those bits I’ve built a hundred times, always tweaking it mid-stream, so it’s been on my ā€œjust ship it alreadyā€ list for a while. That and it's the perfect opportunity to get my hands on some new toys that I've been trying to find an excuse to use anyway.

On strict rules: I used to be skeptical, but honestly, once you find something that works it makes onboarding smoother for everyone (new folks and seasoned devs alike). Have you ever tried this approach (I mean formatting first, and then styles after)? It took me a bit to buy in, but now I’d never go back.

Most of it’s automated, so during onboarding, I just give the ā€œSorry, new formatter. Turn auto-format off if you have toā€ speech. For new devs, the rules are actually a secret weapon: they push you to spot and fix problems you’d otherwise miss. It’s usually a low-impact, safe space to practice debugging (time-boxed, of course).

✨ Fun twist: I actually discourage using AI for this, at least for junior devs.

Experienced devs? Fire away - knock it out in 30 seconds or less. But strict rules are worth a few grumbles on the team. I’ll take that over chaos any day!


šŸ™‹ā€ā™€ļø If anyone wants the epic-saga version, I’ll happily write a follow-up with all the gory details and what finally convinced me to make the switch.

Collapse
 
sebs profile image
Sebastian Schürmann

github.com/sebs/superminimal/

node types, typescript, tsx

Collapse
 
anchildress1 profile image
Ashley Childress

Awesome - thank you! I'll check it out 🧐