r/node • • 10h ago

How do you guys test your backends in production?

4 Upvotes

I'm a junior engineer working in a small team. We've been building a product for around 8 months using Express.js, and shipping features has always been our biggest priority.

One thing I've been noticing lately is that as our codebase grows, shipping a new feature occasionally breaks something that was previously working. Sometimes we don't even realize it until a user reports it.

We have a handful of basic tests, but nothing comprehensive enough to give us confidence when shipping new features or refactoring existing code.

I want to change that.

I've heard about unit testing, integration testing, end-to-end testing, smoke testing, and load testing, but my practical experience beyond basic tests is pretty limited.

I'd love to understand:

- What kinds of tests do you actually write for your backends?

- How do you decide what to test and what not to test?

- How do you introduce testing into an existing codebase without slowing down development significantly?

- What tools and frameworks do you use?

- How do you structure your testing suite and integrate it into CI/CD?

I'd particularly appreciate practical resources, open-source repositories with good testing practices, or engineering articles that demonstrate how these things are done in real projects.

I don't want to write tests just to increase a coverage percentage. I want to reach a point where we can ship features and refactor code without constantly worrying about what we might have broken.

Would love to hear how you guys approach this in your daily work.


r/node • • 14h ago

Fastify as a separate API in a Next.js starter: useful boundary or needless overhead?

0 Upvotes

I maintain create-tigra, an MIT-licensed npm generator, and would like a Node-focused review of its backend defaults.

The scaffold has a Next.js 16 frontend and an independently deployable Fastify 5 API. Request handling follows route → controller → service → repository → Prisma/MySQL. Redis supports rate limits, login lockouts, and IP blocks. Auth/session code, integration tests, CI, and Docker configuration are included.

Source: https://github.com/blessandsoul/create-tigra-public

The frontend supplies forms and API/auth wiring; application pages are yours to build. The part I most want challenged is the cost of the backend structure before a project has much business logic.

Would you keep the separate API for a small project? Which layer or integration would you simplify first? What auth/session or installer edge case would you want a regression test for before trusting the scaffold?

Recommendations, honest criticism, and a code roast are welcome, especially with a file or example to discuss. The public baseline has known dependency advisories documented in KNOWN_ISSUES.md; passing tests is not a claim that it can be deployed unchanged.


r/node • • 17h ago

I open-sourced a zero-dependency TypeScript verifier for Telegram Mini App initData (HMAC-SHA256 + 6 tests)

1 Upvotes

Most Telegram Mini App tutorials use a simple === hash check and skip replay timestamps or positive user ID checks.

So I extracted our standalone TypeScript verifyInitData helper + 6 native node --test unit tests into a small open-source repo for anyone building Telegram Mini Apps on Node.js.

Checks included:

• WebAppData HMAC-SHA256 key derivation.

• crypto.timingSafeEqual comparison.

• Replay timestamp window (-60s to 3600s).

• Positive integer user.id validation.

GitHub (free code + tests): https://github.com/Arvelius-Agency/telegram-initdata-guard-ts

Happy to answer any questions about Telegram Mini App authentication or replay protection.