Live Website: FormFarm
FormFarm is a developer-friendly, high-performance form backend service and private alternative to platforms like Formspree. It allows developers to collect, inspect, and manage HTML form submissions effortlessly without writing or maintaining dedicated backend servers for every project.
Simply point any HTML form's action attribute to your unique FormFarm endpoint (/f/YOUR_KEY), and FormFarm automatically handles storage in MongoDB, payload parsing, instant email dispatching, spam filtering, and dashboard telemetry!
-
👤 Full User Authentication & Session Security:
- Secure register, login, and logout workflows.
- Industry-standard password hashing using
bcryptjswith cryptographically secure salts. - Stateless authentication powered by signed,
HttpOnly,SameSite=laxJWT session cookies.
-
📊 Dynamic Neural Dashboard:
- Real-time counter of active form endpoints.
- Chronological activity stream of recent form transmissions.
- Zero-lag, serverless data fetching optimized for high concurrency.
-
🔑 Cryptographic Endpoint Keys:
- Generates secure, collision-resistant 16-character hexadecimal keys via Node.js
crypto.randomBytes(8).
- Generates secure, collision-resistant 16-character hexadecimal keys via Node.js
-
📩 Universal Public Ingestion Endpoint (
/f/[form_key]):- Standard Browser Forms: Accepts traditional HTML form
POSTrequests (application/x-www-form-urlencodedandmultipart/form-data) with automatic HTTP 303 redirect to the confirmation page. - Modern SPAs & AJAX: Full support for
fetch()/ AJAX with JSON payloads (application/json) and comprehensive CORS headers (Access-Control-Allow-Origin: *). - Automatic Field Parsing: Seamlessly captures any input field names without requiring predefined database schemas.
- Non-POST visits redirect to an informative
/endpoint_activetechnical guide.
- Standard Browser Forms: Accepts traditional HTML form
-
🌐 Automated Client Telemetry & Geolocation:
- Real IP Detection: Accurately resolves client IP addresses through proxy and cloud headers (
x-forwarded-for,x-real-ip,cf-connecting-ip). - Country & City Tracking: Automatically determines the submitter's Country and City.
- Device & Browser Telemetry: Captures client
User-Agentheaders. - Telemetry is stored directly in MongoDB and displayed with dedicated globe/pin badges on the dashboard.
- Real IP Detection: Accurately resolves client IP addresses through proxy and cloud headers (
-
👁️ Submission Stream Viewer & Management:
- Reverse sequence indexing (
#1,#2, ...) for instant chronological tracking. - Syntax-highlighted key-value payload inspector.
- Individual packet purge and bulk select-all purge with confirmation safeguards.
- Reverse sequence indexing (
-
📬 Dual-Format Email Notifications (Nodemailer):
- Form owners receive instant email notifications upon every submission.
- Delivers both a rich, dark-themed responsive HTML Email and a clean Plain Text fallback.
- Includes the complete submitted payload alongside the client's IP, City, Country, and User-Agent.
-
🎨 Dark Sci-Fi Cyberpunk UI:
- Custom Vanilla CSS design system with custom properties (
--primary-bg: #000000,--accent-red: #ff0a0a,--header-red: #ff4c4c). - Google Fonts Orbitron (headings and branding) and Inter (body typography).
- High-performance HTML5 Canvas particle background with interactive red interconnecting lines and mouse repulsion/push effects.
- Frosted glassmorphism cards (
backdrop-filter: blur(15px)) and subtle neon red glowing hover states.
- Custom Vanilla CSS design system with custom properties (
-
🧪 Built-In Developer Testing Suite:
test-form.html: Interactive standalone test file with live toggle between Standard POST and AJAX modes.public/test/: High-security 3D parallax Outfit test interface accessible directly athttp://localhost:3000/test/index.html.scripts/verify-e2e.mjs: Automated 13-stage end-to-end integration test runner validating all auth, form, and submission flows.
| Layer | Technologies |
|---|---|
| Framework | Next.js 16 (App Router, Turbopack, React 19) |
| Language | TypeScript 5+ (Strict Type Safety) |
| Database | MongoDB Atlas (Cluster Database: FormFarmDB) |
| Authentication | bcryptjs, jsonwebtoken (HttpOnly Signed Cookies) |
| Email Forwarding | nodemailer (HTML & Text Dispatcher) |
| Icons & Fonts | Bootstrap Icons (bootstrap-icons), Google Fonts (Orbitron, Inter, Outfit) |
| Testing | Node.js E2E Test Suite (scripts/verify-e2e.mjs) |
Experience FormFarm live: http://form.codewithtanim.works/
FormFarm/
├── public/ ← Static Assets & Demonstration Files
│ ├── images/
│ │ └── FormFarm.png ← Logo & Favicon
│ ├── test/ ← Outfit 3D Parallax Client Test Form
│ └── FormFarm.png
├── src/ ← Application Source Code
│ ├── app/ ← Next.js App Router Pages & APIs
│ │ ├── api/ ← Backend REST API Handlers
│ │ │ ├── auth/ ← Authentication (Login, Register, Logout, Me)
│ │ │ ├── forms/ ← Form Management & Submissions Listing
│ │ │ └── submissions/ ← Bulk & Single Submission Purge
│ │ ├── dashboard/ ← Analytics & Recent Activity Dashboard
│ │ ├── endpoint_active/ ← GET Notice Information Page
│ │ ├── f/[form_key]/ ← Public POST Form Ingestion Handler
│ │ ├── forms/ ← Form Management & Copy Endpoint
│ │ │ ├── create/ ← Node Initialization Page
│ │ │ └── [id]/submissions/ ← Incoming Data Stream Viewer
│ │ ├── help/ ← Technical Documentation & Guide
│ │ ├── login/ ← Portal Access Page
│ │ ├── register/ ← Identity Creation Page
│ │ ├── thanks/ ← Submission Successful Page
│ │ ├── globals.css ← FormFarm Dark Cyberpunk Design System
│ │ └── layout.tsx ← Root Layout with Navbar, Footer & Particles
│ ├── components/ ← Reusable React Components
│ │ ├── Footer.tsx ← Animated Credit to CodeWithTanim
│ │ ├── Navbar.tsx ← Dynamic Sticky Glass Navigation
│ │ └── ParticlesBackground.tsx ← Canvas Particle Network (Mouse Repulse)
│ └── lib/ ← Shared Core Utilities & Database
│ ├── auth.ts ← Bcrypt Password Hashing & JWT Verification
│ ├── db.ts ← MongoDB Models, Queries & Unique Indexes
│ ├── mail.ts ← Nodemailer HTML/Text Email Helper
│ └── mongodb.ts ← MongoDB Atlas Client Connection Pool
├── test/ ← Standalone 3D Parallax Test Suite
│ ├── assets/ ← Neural Background Assets
│ ├── index.html ← Test Form Markup
│ ├── script.js ← 3D Tilt & Transition Script
│ └── style.css ← Outfit Glow Styling
├── test-form.html ← Interactive Testing Form (Standard POST & AJAX)
├── scripts/
│ └── verify-e2e.mjs ← 13-Point Automated E2E Test Runner
├── .env ← Environment Credentials
├── package.json
├── tsconfig.json
└── README.md
- Node.js:
v18.0.0or higher - Package Manager:
npm,pnpm, oryarn - Database: MongoDB Atlas Cluster (or local MongoDB server)
-
Clone the Repository:
git clone https://github.com/CodeWithTanim/FormFarm.git cd FormFarm -
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.envfile in the root directory:# MongoDB Atlas Connection MONGODB_USER=FormFarm MONGODB_PASS=your_password MONGODB_ATLAS_DRIVER_CONNECTION=mongodb://FormFarm:your_password@cluster-url/?ssl=true&replicaSet=atlas-shard-0&authSource=admin MONGODB_DB_NAME=FormFarmDB # Authentication Secret JWT_SECRET=your_super_secure_jwt_secret_key # Base URL NEXT_PUBLIC_APP_URL=http://localhost:3000 # (Optional) SMTP Email Notifications SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your_email@gmail.com SMTP_PASS=your_app_password
-
Run Development Server:
npm run dev
Open http://localhost:3000 in your browser.
-
Build for Production:
npm run build npm start
Simply point your <form> element's action to your FormFarm endpoint:
<form action="http://localhost:3000/f/YOUR_UNIQUE_KEY" method="POST">
<input type="text" name="name" placeholder="Full Name" required>
<input type="email" name="email" placeholder="Email Address" required>
<textarea name="message" placeholder="Your Message" required></textarea>
<button type="submit">Send Message</button>
</form>Upon submission, the browser automatically submits the data and redirects to the clean confirmation page.
For Single Page Applications (Next.js, React, Vue, Svelte, or Vanilla JS):
const formData = {
name: "Jane Doe",
email: "jane@example.com",
message: "Hello FormFarm!"
};
const response = await fetch("http://localhost:3000/f/YOUR_UNIQUE_KEY", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify(formData)
});
const result = await response.json();
console.log(result); // { success: true, message: "Submission successful" }| Method | Endpoint | Access | Description |
|---|---|---|---|
| POST | /api/auth/register |
Public | Create a new user account |
| POST | /api/auth/login |
Public | Authenticate user and issue JWT cookie |
| POST | /api/auth/logout |
Authenticated | Invalidate session cookie |
| GET | /api/auth/me |
Authenticated | Retrieve current session payload |
| GET | /api/forms |
Authenticated | List all data nodes owned by user |
| POST | /api/forms |
Authenticated | Create a new form with unique key |
| DELETE | /api/forms/[id] |
Authenticated | Terminate form and cascade delete submissions |
| GET | /api/forms/[id]/submissions |
Authenticated | View incoming data stream & telemetry |
| POST | /api/submissions/delete |
Authenticated | Purge single or bulk submissions |
| POST | /f/[form_key] |
Public (CORS) | Ingest incoming form submission |
| GET | /f/[form_key] |
Public | Redirects to /endpoint_active guide |
Contributions make the open-source community an amazing place to learn and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is created by MD SAMIUR RAHMAN TANIM.
If anyone wants to use this project, they MUST contact MD SAMIUR RAHMAN TANIM to get explicit permission. Unauthorized use, distribution, or copying of this project will result in legal actions.
See the LICENSE file for more details.
