Privacy-first, self-hosted form management for organizations that value data sovereignty.
Intelligent Forms is an enterprise-ready, open-source form management system designed for organizations that prioritize data privacy and control. Built with Next.js 14, it provides dynamic form creation, robust user management, role-based access control, and offline-first functionality.
- π Privacy-First - Self-hosted solution ensuring complete data sovereignty
- π± Offline Functionality - IndexedDB-powered offline form submissions with automatic sync
- π₯ Multi-User Support - Role-based access control (Admin, Manager, User)
- π― Dynamic Forms - Flexible form builder with multiple field types
- π Real-Time Analytics - Comprehensive statistics and submission tracking
- π API Integration - External API webhooks for form submissions
- π Export Capabilities - PDF, CSV, and JSON export formats
- π¨ Modern UI - Clean, responsive interface with consistent blue/white/black branding
- π Enterprise Security - bcrypt password hashing, JWT authentication, RBAC
- Frontend: Next.js 14 (App Router), React 18, TypeScript
- Backend: Next.js API Routes, Prisma ORM
- Database: PostgreSQL 13+
- Authentication: NextAuth.js with JWT
- Styling: Tailwind CSS (Blue/White/Black theme)
- Validation: Zod
- Icons: Lucide React
- Package Manager: npm or pnpm
- Node.js >= 18.0.0
- npm >= 9.0.0 or pnpm >= 8.0.0
- PostgreSQL >= 13.0.0
- Git
1. Clone the repository
git clone https://github.com/jnkindi/intelligent-forms.git
cd intelligent-forms2. Install dependencies
Using npm:
npm installOr using pnpm:
pnpm install3. Configure environment variables
Create a .env file in the root directory:
# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/intelligentforms?schema=public"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secure-random-secret-key-change-in-production"
# App
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_API_URL="http://localhost:3000/api"
NODE_ENV="development"
TZ="UTC"Important: Generate a secure NEXTAUTH_SECRET:
openssl rand -base64 324. Set up the database
# Using createdb command
createdb intelligentforms
# Or using psql
psql -U postgres -c "CREATE DATABASE intelligentforms;"5. Generate Prisma Client and push schema
Using npm:
npm run db:generate
npm run db:pushOr using pnpm:
pnpm db:generate
pnpm db:push6. Start the development server
Using npm:
npm run devOr using pnpm:
pnpm devVisit http://localhost:3000 to access the application.
On first launch, you'll be redirected to the setup wizard (/setup) where you'll:
- Organization name (required)
- Tagline
- Description
- Contact email and phone
- Support email
- Website URL
- Physical address
- Full name (required)
- Email address (required)
- Password (required, minimum 6 characters)
- Confirm password
- Review all entered information
- Complete setup with one click
After setup, you'll be redirected to /login to sign in with your admin credentials.
- Navigate to Admin β User Management
- Click Add User
- Fill in user details:
- Full name *
- Email address *
- Job title (optional)
- Role (Admin/Manager/User) *
- Password *
- Click Create User
- ADMIN: Full system access, manage all users and roles
- MANAGER: Create USER role only, manage forms
- USER: Limited to assigned forms only
- Go to Admin β User Management
- Click the edit icon next to a user
- Update user details
- Click Save Changes
Control which users can access specific forms with granular permissions:
- Go to Admin β User Management
- Click on a user to expand details
- View current form access assignments
- Assign access with permission levels:
- VIEW: Read-only access to form and submissions
- EDIT: Can modify form structure and view submissions
- FULL: Complete control including settings and API integration
Global Form Access: Assign null formId to grant access to ALL forms.
Customize your organization's branding (Admin only):
- Navigate to Admin β Organization Settings
- Configure:
- Basic Information: Name, tagline, description
- Contact Information: Contact email/phone, support email, website, address
- Click Save Changes
- Click Create Form from dashboard
- Fill in form details:
- Title and description
- Choose type (Form or Survey)
- Add multiple field types:
- Text input
- Text area
- Number
- Phone
- Date
- Single-choice (radio)
- Multiple-choice (checkbox)
- Configure required/optional
- Set custom placeholders
- Save the form
- Multiple field types with validation
- Required/optional fields
- Custom placeholders
- Field ordering
- Form types: Forms and Surveys
Forms support offline submission using IndexedDB:
- Automatic offline detection
- Local storage of submissions
- Background sync when connection restored
- Encrypted data storage option
- Queue management for failed submissions
How it works:
- User fills out form while offline
- Data saved to IndexedDB locally
- When connection restored, automatically syncs to server
- Submission appears in database
Forward form submissions to external systems:
- Navigate to form settings
- Configure webhook:
- URL
- HTTP method (GET, POST, PUT, PATCH)
- Custom headers
- Field mapping
- Save configuration
Features:
- Detailed logging with request/response capture
- Error tracking and retry mechanism
- Enable/disable without deleting configuration
- View API call history and status
Comprehensive statistics including:
- Total submissions by form
- Submission trends (last 7 days, all time)
- Active vs. inactive forms
- Response rates and completion metrics
- User activity tracking
- API call success rates
Export submission data in multiple formats:
- PDF: Beautifully formatted document with branding
- CSV: Spreadsheet-compatible format
- JSON: Developer-friendly structured data
All protected endpoints require NextAuth session authentication.
GET /api/organization/setup- Check if setup is completedPOST /api/organization/setup- Complete initial organization setupGET /api/organization- Get organization details (authenticated)PATCH /api/organization- Update organization (Admin only)
GET /api/users- List all users (Admin/Manager only)POST /api/users- Create new user (Admin/Manager)GET /api/users/[id]- Get user detailsPATCH /api/users/[id]- Update userDELETE /api/users/[id]- Delete user (Admin only)
GET /api/form-access- List form access records (Admin/Manager)POST /api/form-access- Assign form access to userPATCH /api/form-access/[id]- Update access levelDELETE /api/form-access/[id]- Revoke form access
GET /api/forms- List forms (respects user permissions)POST /api/forms- Create new formGET /api/forms/[id]- Get form detailsPATCH /api/forms/[id]- Update formDELETE /api/forms/[id]- Delete form
GET /api/forms/[id]/submissions- Get form submissionsPOST /api/forms/[hash]/submit- Submit form (public)GET /api/forms/[id]/export/pdf- Export as PDFGET /api/forms/[id]/export/csv- Export as CSVGET /api/forms/[id]/export/json- Export as JSON
1. First-Time Setup
- Visit
http://localhost:3000 - Complete 3-step setup wizard
- Verify redirect to login page
2. Authentication
- Login with admin credentials
- Verify session persistence
- Test logout functionality
3. Dashboard
- Check statistics cards display correctly
- Verify quick actions work
- Confirm recent forms list
4. User Management
- Create new users with different roles
- Edit user information
- Toggle user active/inactive status
- Delete users (Admin only)
5. Form Creation
- Create form with multiple field types
- Test form validation
- Publish and access public form
6. Form Submissions
- Submit form while online
- Submit form while offline (test sync)
- View submissions in dashboard
- Export to PDF/CSV/JSON
7. Organization Settings
- Update organization details
- Verify changes reflect across app
8. Production Build
Using npm:
npm run build
npm startOr using pnpm:
pnpm build
pnpm startExpected: Build completes with 25/25 pages generated. Note: 4 pages (login, add-form, api-logs, save-data-externally) will show pre-rendering warnings - this is expected for dynamic client pages.
Using npm:
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Lint all codenpm run format- Format with Prettiernpm run clean- Clean build artifacts
Using pnpm:
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Lint all codepnpm format- Format with Prettierpnpm clean- Clean build artifacts
Using npm:
npm run db:generate- Generate Prisma Clientnpm run db:push- Push schema to databasenpm run db:migrate- Create and run migrationsnpm run db:studio- Open Prisma Studio (GUI)npm run db:seed- Seed with sample data (optional)
Using pnpm:
pnpm db:generate- Generate Prisma Clientpnpm db:push- Push schema to databasepnpm db:migrate- Create and run migrationspnpm db:studio- Open Prisma Studio (GUI)pnpm db:seed- Seed with sample data (optional)
Using npm:
npm run build
npm run startOr using pnpm:
pnpm build
pnpm startDATABASE_URL="postgresql://user:pass@host:5432/intelligentforms?schema=public"
NEXTAUTH_URL="https://your-domain.com"
NEXTAUTH_SECRET="your-super-secure-random-secret"
NEXT_PUBLIC_APP_URL="https://your-domain.com"
NEXT_PUBLIC_API_URL="https://your-domain.com/api"
NODE_ENV="production"vercel --prodAdd PostgreSQL via Vercel Postgres or external provider.
railway upIncludes PostgreSQL database.
See Dockerfile in repository for containerized deployment.
Deploy on cloud VMs with PM2 or Docker.
- Authentication: NextAuth.js with JWT (30-day sessions)
- Password Hashing: bcrypt (10 rounds)
- SQL Injection Prevention: Prisma ORM with parameterized queries
- Input Validation: Zod schemas for all user input
- CSRF Protection: NextAuth built-in protection
- Role-Based Access Control (RBAC): Granular permissions
- Active Status Check: Inactive users cannot login
- Self-Protection: Users cannot delete/deactivate themselves
This project is licensed under the MIT License.
Copyright Β© 2025 Jacques Nyilinkindi
β
Commercial Use - Use in commercial products and services
β
Modification - Modify the source code to fit your needs
β
Distribution - Share and redistribute the software
β
Private Use - Use privately for your organization
β
Contribution - Contribute back to the project
π License and Copyright Notice - Include the original license and copyright notice in all copies
In Plain English: You can use Intelligent Forms for anything - personal projects, commercial products, or internal company use. You can modify it, sell it, or give it away. The only requirement is to keep the license notice. However, the author takes no responsibility for any issues that may arise from using this software.
We welcome contributions! To contribute:
- Fork the repository
- 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
Guidelines:
- Follow existing code style
- Write TypeScript for type safety
- Use Zod for runtime validation
- Use Prisma for database operations
- Write meaningful commit messages
- Update documentation for new features
- GitHub Issues: Report bugs and request features
- GitHub Discussions: Ask questions and share ideas
- Documentation: This README covers all features
Need help setting up Intelligent Forms for your organization? I offer professional services:
Services Include:
- Infrastructure setup and deployment
- Custom branding and theming
- Integration with existing systems
- Staff training for administrators
- Ongoing technical support packages
- Custom feature development
Contact: jacques@jnkindilogs.xyz
Built with modern open-source technologies:
- Next.js - The React Framework for the Web
- Prisma - Next-generation ORM
- NextAuth.js - Authentication for Next.js
- Tailwind CSS - Utility-first CSS framework
- TypeScript - JavaScript with syntax for types
- Zod - TypeScript-first schema validation
- Lucide - Beautiful & consistent icon toolkit
- Email: jacques@jnkindilogs.xyz
- GitHub: https://github.com/jnkindi/intelligent-forms
- Issues: https://github.com/jnkindi/intelligent-forms/issues
- Discussions: https://github.com/jnkindi/intelligent-forms/discussions
Color Scheme:
- Primary: Blue (#0ea5e9 and variants)
- Background: White and light grays
- Text: Black and dark grays
- Accents: Blue for buttons, links, badges
All pages maintain consistent blue/white/black branding throughout the application.
Made with β€οΈ for organizations that value data privacy and sovereignty
Version: 2.0.1
Last Updated: October 25, 2025
License: MIT
Copyright: Β© 2025 Jacques Nyilinkindi