Introduction
the modular backend you can copy and paste. 👤
wunshot is scaffolding designed to help you build secure, efficient, feature-filled backends faster.
It is not a package. You do not install it as a dependency.
It is a collection of functions and schemas. Copy the features you want, paste them into your project, and customize them to your needs.
Best practices are baked-in so you spend less time choosing tools and fighting frameworks and more time building. Fully typed, open-source, frontend agnostic, and no vendor lock-in.
Motivation
I was upsetti with SaaS spaghetti 🍝
Pretty much every web application needs some combination of: an email sign-up/newsletter, user authentication, role-based access, analytics, order management, and customer support. The central data point for each of those functionalities is the user. Yet connecting them often comes at the cost of added complexity and/or vendor lock-in.
Right now the options are:
-
Research and select features from a mind-numbing array of SaaS services, many of which have overlapping features. (And then spend extra time trying to synchronize data between them)
-
Use a BaaS that abstracts the database away, making custom functionality or migration off the platform difficult
-
Build a platform from scratch, which requires a lot of knowledge, a lot of work, and a lot of time
Using wunshot gives you the control of building from scratch, but with best-practice guardrails for speed and flexibility.
AI
The future of AI- vibe-coding is unclear and filled with pitfalls.
But, it’s also progressing at a breakneck pace and is already positioned to become the baseline for development in the future.
Due to its copy-paste nature, wunshot is already focused where AI consistently excels: codebases that are well organized, full of comments, and follow common patterns and conventions.
As AI technologies develop, wunshot will continue to adapt. RAG and MCP are backlog items. Once the CLI is ready, a top priority will be building ways for agents to interact with it.
The stack
The best tools for building your backend 🧩
Instead of compatibility, wunshot prioritizes leveraging the features of a select set of core dependencies to their maximum potential.
Each of these has been chosen based on the tight constraints of “serverless first” approach. Optimizing for serverless deployments reasonably ensures that this code can run in any TypeScript environment.
Despite this narrow focus, wunshot is relatively adaptable. The architecture and patterns can be used with any validation library, ORM, and database as long as you feel comfortable handling the associated edge-cases.
TypeScript
Catch errors early and see data return types in the client. It’s like having x-ray vision for your application.
You can use plain ol’ javascript if you prefer, but it will require deleting the included type information.
Valibot
Use declarative type-safe validations for your inputs. Valibot was written from the ground up to ensure quick evaluation and small bundle size.
Zod 4 mini was recently anounced and may be evaluated as an alternative once it’s out of beta.
Drizzle ORM
Write schema files with the power of automatic migrations.
Drizzle ORM provides enough abstraction to make writing database queries feel like native TypeScript, but retains the power of raw sql when needed. It also has a small footprint, making it an ideal choice for code that can run in workers or edge functions.
PostgreSQL
PostgreSQL is popular, flexible, and performant.
array
types have native support. That’s particularly helpful for keeping features efficient & modular- There are a large number of extensions available to handle the needs of any application
- It’s self-hostable or available as a service through several platforms
FAQ
Or questions I imagine someone might ask if I had users 😭
Won’t AI take care of this for me?
Maybe.
Currently, LLM output can’t be entirely trusted - especially with something as vital to your application as user data.
A future release will include a CLI that LLMs could use to create schemas.
A future release may also integrate the schemas directly into a RAG and/or MCP for LLMs to use.
Why copy-pasteable?
The needs for every app will be different. It’s much easier to paste some code into your project and modify it to your needs than it is to learn (and possibly battle with) a framework or to build a platform from scratch.
What frameworks are supported?
Any framework that can use typescript in a server environment.
That includes: Next.js, Remix, TanStack Start, Astro, Nuxt, SolidStart, and more.
You can also use wunshot in Node.js (or Bun or Deno) directly without any framework at all.
Is it production ready?
Your mileage may vary;
wunshot is still in early development. It hasn’t been thoroughly battle-tested.
It’s unlikely that the schemas or functions will “break,” but I’m mainly a frontend developer, so it’s possible there are unforseen consequences due to the structure of the schemas.
Also see the Does it scale? section below.
Does it scale?
Yesn’t.
The limiting factor of wunshot is PostgreSQL. So if PostgreSQL can handle it, wunshot should too.
That means for basic user management, wunshot should scale well. But realtime features like analytics, event tracking, and rate-limiting may start to bottleneck performance.
The goal of wunshot is to provide you with the best generic jumping-off point possible. Part of that goal is to make it just as easy to transition off of wunshot as it is to start with. So if it doesn’t meet your scaling needs, you can switch to a platform that does without too many headaches.
What’s the difference between wunshot and a BaaS?
BaaS platforms and wunshot share many of the same goals, but go about them in different ways.
BaaS platforms are designed to abstract the complexities of the database and user management away. In contrast, wunshot puts the database front-and-center, so you always remain in control of your data.
BaaS platforms limit and charge you based on the number of users you have, wunshot only limits your users by how many PostgreSQL can handle (it’s a lot).
Can I use wunshot with a BaaS?
Yes (within reason).
There are many ways you could incorporate wunshot with a BaaS. They are beyond the scope of the documentation though, so you will be responsible for modifying the functions and schemas to your needs. Also, beware of the possibility of accidentally duplicating data.
What’s the difference between wunshot and a SaaS starter kit/boiler plate?
SaaS starter kits and wunshot both can help you launch your product quickly, but they have some key differences:
-
Starter kits have a UI, wunshot is only focused on backend functionality.
-
Starter kits offload user management to third-party services, wunshot keeps you in control of your database and user data.
-
Starter kits may be filled with bloat or unnecessary features, wunshot lets you copy and paste only the functionality you need.
There will be wunshot starter kits available in future releases, starting with one for Next.js
Can I use wunshot with my existing database?
Yes (within reason).
The project is built using Drizzle ORM and PostgreSQL. If you are not using those tools, work will be required to “translate” the schemas into your ORM/RDBMS of choice.
Copy and paste the functionality you want and tweak it to your needs. The more your app deviates from the provided schemas, the more you will need to tweak.
Will my ORM be supported?
Other ORMs such as Prisma, TypeORM, or Kysely may be supported in the future, but are not the current focus.
See the Stack section for details on why Drizzle is wunshot’s ORM of choice.
Will my RDBMS be supported?
Other SQL RDBMSs such as MySQL or SQLite may be supported in the future, but are not the current focus.
NoSQL databases such as MongoDB may also be supported in the even further future.
Can I use wunshot in my project?
Yes!
wunshot is FSL-1.1-MIT licensed, so you can use it in any project (including commercial ones) other than competing uses. (Learn more about FSL)
Please let me know or leave a star if you do!
Roadmap (to v1)
More like: Highway to the Danger Zone 😎
- Authentication
- Username/Password
- Email/Password
- Magic Code
- OAuth
- MFA/2FA
- Validation w/
ZodValibot - RBAC
- wunshot CLI
- Next.js Starter Kit In Development
Backlog
Feature creep? Never heard of it 🧟
If a feature is listed here, it means I think it’s good enough to be remembered, but I don’t have any specific implementation plans for it. They are not in any meaningful order and are not guaranteed to be delivered.
Modules
- Feature Flags
- Analytics/Tracking
- Consent Management
- Marketing Emails
- Payment Processor Integrations
- Stripe
- Paddle
- Lemon Squeezy
- PayPal
- Apple Pay
- Google Pay
- Square
- Portal
- GoCardless
- Shopify
- Venmo for Business
- Amazon Pay
- Billing
- subscriptions
- metered billing
- per seat billing
- credits based billing
- one-off payments
- OpenTelemetry integration
- Single Sign On
- Multi-tenancy
- Social Media Integrations
- Tracking Pixels
- Unified inbox
AI
- Vector database (of docs/modules/conventions)
- RAG
- MCP
Framework Guides
- Remix/React Router
- Astro
- TanStack Start
- Nuxt
- SolidStart
- Waku
Stack additions
- Realtime db solution
- ClickHouse
- DuckDB
- Timescale
- Redis/Valkey
- Testing
- Playwright