I’m done copy-pasting infrastructure code from old projects
Source: Dev.to
Why I stopped copy‑pasting infrastructure code
Infrastructure work is rarely interesting—but it’s always necessary.
Over time I noticed I was solving the same problems again and again:
- Copying configs from old projects and inheriting their mistakes
- Stitching together tutorials that were already drifting out of date
- Adding packages I didn’t really need, just to delete them later
Introducing Sinew
Sinew is a pattern registry of infrastructure code I actually trust in production.
You copy the code into your project—no abstractions, no hidden behavior.
What’s included so far (30+ patterns)
Database
- pooling
- Prisma edge
- Drizzle
Auth
- OAuth
- sessions
- RBAC
API
- rate limiting
- validation
- error handling
Caching
- in‑memory
- Next.js cache
- Redis
Payments
- Stripe
- LemonSqueezy
- Resend
- Nodemailer
- AWS SES
Monitoring
- Sentry
- logging
- OpenTelemetry
Testing
- Vitest
- Playwright
Deployment
- Docker
- GitHub Actions
- Vercel
Environment
- type‑safe env + secrets
You can browse the full list here:
How to use Sinew
# Install the CLI globally
npm install -g sinew
# Add a pattern to your project
sinew add database/connection-pooling
Philosophy
Most infrastructure code doesn’t need to be a package. It just needs to be correct, understandable, and easy to adapt—that’s the goal of Sinew.
Curious what pieces you end up rewriting the most?