Skip to content
New Project

Router.so - Headless Forms and Lead Routing

Router.so is headless form handling and lead routing for marketing-minded developers.

DeployView Demo

Router.so / Open Source Form Backend

Description

This is a simple router for forms. Watch a Demo

Self-Hosting router

Prerequisites

Before starting, ensure you have the following:

  • An account with Resend
  • An account with Vercel
  • A PostgreSQL database (we recommend Vercel Postgres)

Environment Variables

After creating your accounts, update your .env.example to be .env.local for running the application locally. Then, update the keys for each value.

Step-by-Step Instructions

  1. Clone the Repository

    git clone https://github.com/routerso/router.git
    cd router/main

Without Docker

  1. Install Dependencies

    This project uses pnpm (see packageManager in package.json). Install with pnpm so the pnpm.overrides security pins are applied — installing with npm or yarn ignores them and pulls vulnerable transitive dependencies.

    pnpm install --frozen-lockfile
  2. Set Up Environment Variables

    Ensure your .env file is correctly configured as mentioned above.

  3. Generate the Database Migrations

    pnpm db:generate
  4. Run the Database Migrations

    pnpm db:migrate
  5. Start the Development Server

    pnpm dev

With docker

  1. Set Up Environment Variables

    Ensure your .env file is correctly configured as mentioned above.

  2. **Run Docker Command

    docker compose up

Deploying to Vercel

  • Push your code to a GitHub repository.
  • Connect your repository to Vercel.
  • Set the environment variables in Vercel's dashboard under "Settings > Environment Variables".

Dependency Maintenance

Run pnpm audit to check for known vulnerabilities.

The pnpm.overrides block in package.json force-resolves transitive dependencies that a direct dependency still pins to a vulnerable version (for example, next pins postcss 8.4.31, and tailwindcss reaches a vulnerable glob via sucrase). Each entry can be removed once the parent package ships a release that depends on a patched version on its own — re-run pnpm audit after removing one to confirm.

Requires Node.js >= 20.9.0.

Additional Resources

  • Vercel Documentation
  • Resend Documentation

For any issues or questions, please open an issue on the GitHub repository.

GitHub
Ownerrouterso
Repositoryrouter
Use Cases
SaaS
Marketing Sites
Stack
Next.js
Tailwind
Database
Postgres
Auth
NextAuth.js

Related Templates

Stripe Subscription Starter

The all-in-one subscription starter kit for high-performance SaaS applications, powered by Stripe, Supabase, and Vercel.
Stripe Subscription Starter thumbnail

Admin Dashboard

Get started building your admin dashboard with Vercel's starter, complete with Tailwind CSS, PostgreSQL, and Auth.
Admin Dashboard thumbnail

Next.js Starter for WordPress Headless CMS

next-wp is a Next.js application for Headless WordPress. Includes functions for fetching posts, categories, tags, pages, and featured media.
Next.js Starter for WordPress Headless CMS thumbnail
DeployView Demo