The connective tissue
that makes apps work.
Infrastructure patterns for databases, auth, deployment, and all the other stuff that's hard to get right. Copy. Paste. Ship.
Why Sinew?
Stop copy-pasting from old projects or chasing tutorials. Get production-ready code that you own.
No Dependencies
You own the code. No packages to update, no breaking changes to chase. Just copy and customize.
Production-Ready
Battle-tested patterns from real applications. Not toy examples—code you can actually ship.
Framework-Aware
Patterns tailored for Next.js, Remix, SvelteKit, and more. Not generic—optimized for your stack.
Type-Safe
Full TypeScript support with proper types. IDE autocompletion and type checking out of the box.
CLI + Web
Use the CLI for quick setup or browse the web and copy directly. Whatever fits your workflow.
Community-Driven
Open source and accepting contributions. Help make these patterns even better.
Get started in seconds
Three commands. That's all it takes.
Initialize in your project
npx sinew initSets up your project configuration for Sinew patterns.
Add the patterns you need
npx sinew add database/connection-poolingCopies production-ready code directly into your project.
Ship it
The code is yours. Customize it, extend it, or use it as-is. No lock-in, no dependencies.
Or just browse the patterns and copy what you need.
Popular Patterns
The most used patterns to get you started.
Connection Pooling
Database connection pooling for serverless and edge environments. Prevents connection exhaustion and handles cold starts gracefully.
sinew add database/connection-poolingOAuth Setup
Production-ready OAuth authentication with Auth.js (NextAuth v5). Includes GitHub and Google providers with database session storage.
sinew add auth/oauth-setupRate Limiting
API rate limiting with sliding window algorithm using Upstash Redis.
sinew add api/rate-limitingType-safe Env
Runtime-validated environment variables with Zod and TypeScript.
sinew add environment/type-safe-envDocker Config
Multi-stage Docker builds optimized for Next.js.
sinew add deployment/dockerVitest Setup
Unit and integration testing with Vitest and React Testing Library.
sinew add testing/vitest-setupAll Categories
Production-ready code for the hard parts of web development.
Database
3 patternsConnection pooling, ORMs, and serverless-ready database patterns
Authentication
3 patternsOAuth, sessions, and role-based access control
Testing
4 patternsUnit, integration, and end-to-end testing
Payments
3 patternsStripe integration and subscriptions
Monitoring
3 patternsError tracking and observability
Deployment
3 patternsDocker, CI/CD, and production-ready configs
Free. Open source. Forever.
Sinew is MIT licensed and community-driven. Contributions welcome.
Your support helps keep this project free and maintained.