Skip to content

Repository files navigation

Formy — The Backend for Forms

Just plug in your forms, we will do the magic.

Formy is a form-backend-as-a-service (form-BaaS). Create a form, get a public CORS-enabled API endpoint, embed it in any HTML/React/Vue frontend, and Formy collects submissions with email notifications, webhooks, and CSV/JSON export.

⚠️Pre-release — This is an early prototype. Active development in progress.


Features

  • Public Submit API — JSON and application/x-www-form-urlencoded support with CORS headers
  • Email Notifications — Get notified via email (powered by Resend) when someone submits
  • Webhooks — Real-time HTTP callbacks on new submissions
  • CSV / JSON Export — Download all form submissions in your preferred format
  • Form Management — Create, update, and delete forms from a clean dashboard
  • Search & Pagination — Find submissions fast with full-text search
  • JWT Authentication — Custom auth with httpOnly cookies and bcrypt password hashing
  • Responsive Dashboard — Full-featured mobile-responsive UI

Tech Stack

LayerTechnology
FrameworkNext.js 16 (App Router)
UI LibraryAnt Design 6 + Tailwind CSS 4
Componentsshadcn/ui + Base UI
DatabasePostgreSQL via Prisma 7
AuthCustom JWT (jose) + bcryptjs
EmailReact Email + Resend
FontsGeist Sans + Geist Mono (via next/font)
IconsLucide React
StateZustand + nuqs (URL query state)

Getting Started

Prerequisites

  • Node.js 20+
  • pnpm
  • PostgreSQL database (local or Neon)

Setup

# Clone the repo
git clone https://github.com/yourusername/formy.git
cd formy
# Install dependencies
pnpm install
# Copy environment variables
cp .env.example .env
# Edit .env with your database URL and secrets# Run database migrations
pnpm prisma migrate dev
# Start dev server
pnpm dev

Environment Variables

VariableDescription
DATABASE_URLPostgreSQL connection string
NEXTAUTH_URLApplication URL (e.g. http://localhost:3000)
NEXTAUTH_SECRETJWT signing secret (min 32 chars)
RESEND_KEYResend API key (for email notifications)
RESEND_FROMSender email address for notifications

API Reference

Submit a form

POST /api/submit
Content-Type: application/json
{
"slug": "your-form-slug",
"name": "John Doe",
"email": "john@example.com",
"message": "Hello!"
}

Or use a regular HTML form:

<formaction="https://your-app.com/api/submit" method="POST"><inputtype="hidden" name="slug" value="your-form-slug" /><inputname="name" placeholder="Your Name" /><inputname="email" type="email" placeholder="Email" /><buttontype="submit">Submit</button></form>

Parameters:

ParamTypeRequiredDescription
slugstringYes*Form slug (from dashboard)
formIdstringYes*Form ID (alternative to slug)

*Either slug or formId must be provided.

Responses:

  • 201{ "success": true } (JSON request)
  • 303 — Redirects to /success page (form-data request)
  • 400{ "error": "formId or slug is required" }
  • 404{ "error": "Form not found" }

Project Structure

app/
├── (auth)/ # Login & Register pages
├── (marketing)/ # Landing page
├── actions/ # Server actions (auth, forms)
├── api/ # API routes (submit, export, auth)
├── dashboard/ # Dashboard pages (protected)
├── lib/ # Server utilities (auth, session, prisma, email, slug)
├── success/ # Post-submission confirmation page
├── generated/prisma/ # Prisma client (gitignored)
├── globals.css # Tailwind + design tokens
└── layout.tsx # Root layout (Antd theme, fonts)
components/
├── dashboard/ # Dashboard components (Home, Forms, FormTabs, etc.)
├── emails/ # React Email templates
├── ui/ # shadcn/ui primitives
├── Header.tsx # Public header
├── Providers.tsx # Client providers wrapper
└── AntdRegistry.tsx # Antd SSR registry
prisma/
└── schema.prisma # Database schema (User, Form, Submission)

Screenshots

PagePreview
Landing(add screenshot)
Login(add screenshot)
Dashboard(add screenshot)
Form Detail(add screenshot)
Integration(add screenshot)

Roadmap

  • Individual submission detail view ✅
  • CSV/JSON export
  • User settings page (password change, account deletion)
  • Rate limiting
  • File upload support
  • Team collaboration
  • Form analytics
  • API tokens

License

MIT

About

Just plug in your forms, we will do the magic

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages