
Template details
Router.so
Open source, self-hostable form backend for headless form handling and lead routing, built with Next.js and PostgreSQL.
About this template
Router.so is an open source form backend that accepts form submissions on a headless endpoint contract and routes each lead onward, with optional first-class forms published at forms.router.so, embedded in an approved website, or rendered through a bundled WordPress block and shortcode.
What is Router.so?
Router.so is headless form handling and lead routing for marketing-minded developers, maintained as an open source project in the routerso/router GitHub repository. It receives form submissions through a headless endpoint and routes them as leads, using Resend to deliver email. The application runs on Next.js with a PostgreSQL database, and the repository carries roughly 382 GitHub stars.
Key Features
- Headless endpoint contract — forms post to a headless endpoint that routes submissions without a fixed UI, so the endpoint contract stays stable even when optional first-class forms are enabled.
- First-class forms layer — optional forms can be turned on without changing the headless endpoint behavior, with implementation notes in the repository's forms documentation.
- Three publishing targets — a form can be published on forms.router.so, embedded into an approved website, or rendered through the included WordPress block and shortcode.
- Next.js application — the repo is a Next.js codebase using pnpm as its package manager, with
pnpm devstarting the local development server. - Tailwind CSS and shadcn/ui — styling comes from Tailwind CSS with shadcn/ui components, per the project's repository topics.
- Resend email delivery — outbound lead notification uses Resend, and a Resend account plus API key is a documented prerequisite.
- PostgreSQL persistence — a PostgreSQL database (Vercel Postgres is recommended) backs the app, with migrations generated via
pnpm db:generateand applied viapnpm db:migrate. - Docker Compose option — self-hosting can skip manual setup entirely by running
docker compose upafter configuring environment variables.
Who should use Router.so?
- Marketing developers who need form submissions routed to leads without hand-writing backend endpoints for every landing page.
- Agencies shipping client sites that want one self-hosted form backend they control instead of a per-site third-party form service.
- WordPress site owners who want the same routing logic on static pages and WordPress pages, using the bundled block and shortcode.
- Self-hosters who already run Vercel and PostgreSQL and can supply their own Resend API key.
Use cases
- Landing page lead capture: point a Next.js or static landing page form at the headless endpoint and let Router.so route each submission as a lead.
- Agency client work: run one self-hosted instance across multiple client sites and keep submissions in your own PostgreSQL database.
- WordPress and non-WordPress mix: publish a form on forms.router.so or embed it in an approved website while the WordPress block renders the same form inside a WordPress site.
How does self-hosting work?
Self-hosting requires a Resend account, a Vercel account, and a PostgreSQL database. Configure the environment variables (RESEND_API_KEY, NEXTAUTH_SECRET, NODE_ENV, POSTGRES_URL) after copying .env.example to .env.local, then either install with pnpm install --frozen-lockfile, run pnpm db:generate and pnpm db:migrate, and start with pnpm dev, or run docker compose up. Deploying to Vercel means pushing to GitHub, connecting the repository, and setting the same environment variables in the Vercel dashboard.
Pros and cons
- Open source and self-hosted, so form data lands in your own PostgreSQL database.
- One backend serves a hosted form page, embedded forms, and WordPress block/shortcode output.
- npm and yarn installs ignore the security pins in
pnpm.overrides, so pnpm is effectively required. - Node.js 20.9.0 or newer is required.
- You must supply your own Resend, Vercel, and PostgreSQL accounts before the app runs.
Pricing
Router.so is released as open source software that you self-host. The page lists no subscription tiers or paid plans; running it requires your own Resend account for email and a PostgreSQL database.
Alternatives
Formspree is a hosted form backend that requires no self-hosting or database, whereas Router.so is an open source app you deploy yourself.
FAQ
Is Router.so free?
Router.so is open source and self-hosted, with no paid tiers listed on the page. You still need accounts with Resend, a host such as Vercel, and a PostgreSQL database, so infrastructure costs are yours.
What Node.js version does Router.so need?
The repository requires Node.js 20.9.0 or newer. It also expects pnpm, because the pnpm.overrides block in package.json pins transitive dependencies to patched versions that npm and yarn would otherwise ignore.
Can I use Router.so with WordPress?
Yes. Router.so ships a WordPress block and shortcode so forms can be rendered inside a WordPress site, in addition to being published on forms.router.so or embedded in an approved website.
Does Router.so work without Docker?
Yes. Run pnpm install --frozen-lockfile, generate and run database migrations with pnpm db:generate and pnpm db:migrate, then start the server with pnpm dev. A Docker path exists too: docker compose up.
















