Skip to content

Repository files navigation

Form Backend Service

A modern, fast, and secure form backend service built with Next.js and Supabase. This service allows you to easily collect form submissions from any static HTML site without writing backend code.

Features

  • API Endpoints: Automatically generate unique API endpoints for your forms.
  • Supabase Integration: Securely stores all form submissions in a Supabase database.
  • CORS Enabled: Accepts cross-origin requests from any domain.
  • Webhook Support: Send form data directly to Google Sheets or Zapier/Make via Webhooks.
  • Custom Redirects: Redirect users to your own "Thank You" page after submission.
  • Dashboard: A beautiful, easy-to-use dashboard to manage your endpoints and view submissions.

How to use in your HTML

Simply point your HTML form's action attribute to your generated endpoint ID:

<form method="POST" action="https://your-domain.com/api/submit/YOUR_ENDPOINT_ID">
  
  <!-- Add name attributes to all inputs -->
  <input type="text" name="name" placeholder="Full Name" required>
  <input type="email" name="email" placeholder="Email Address" required>
  
  <!-- Optional: Custom Redirect after submission -->
  <input type="hidden" name="_next" value="https://your-website.com/thank-you.html">

  <button type="submit">Submit</button>
</form>

Note: All input fields must have a name attribute in order for the data to be captured.

Webhook Support (Google Sheets)

You can connect your endpoints to a Google Apps Script Webhook. Whenever a form is submitted, the data will be forwarded to your webhook URL in JSON format, containing:

  • endpoint_id
  • form_data
  • submitted_at

Local Development

  1. Clone the repository
  2. Run npm install
  3. Setup your .env.local with Supabase credentials:
    NEXT_PUBLIC_SITE_URL=http://localhost:3000
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
  4. Run npm run dev to start the local server.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages