A modern, feature-rich form builder built with Next.js App Router, Tailwind CSS, shadcn/ui, PostgreSQL, Prisma, and Docker. Create beautiful, interactive forms with advanced customization options and analytics.
π‘ Fun Fact: This entire project was built in just 15 hours! (7 hours on day one, 8 hours on day two) β‘οΈ
Built with β€οΈ by Augustus Otu who believes in creating powerful tools that are both beautiful and functional.
- β¨ Create forms with customizable titles and descriptions
- π§ Support for multiple field types:
- Text (Single line)
- Number
- Textarea (Multi-line)
- Select (Dropdown)
- Radio buttons
- Checkboxes
- Date picker
- β Advanced form validation using Zod + React Hook Form
- π Field reordering with drag-and-drop functionality
- π Form analytics and response tracking
- π¨ Theme customization:
- Custom color schemes
- Font family selection
- Border radius control
- Spacing options
- π Multiple form layouts:
- Standard
- Card
- Stepper
- Conversational
- Compact
- Grid
- β¨ Animation effects:
- Fade
- Slide
- Zoom
- Bounce
- Flip
- Scale
- Rotate
- β‘ Animation speed control (Slow, Medium, Fast)
- π¦ PostgreSQL database with Prisma ORM
- π User authentication and authorization
- π Response collection and management
- π Form analytics and statistics
- π Form status management (Draft, Active, Inactive)
- π Internationalization support
- π± Fully responsive design
- βΏ Accessibility compliant
- π― Progress bar option
- π Question shuffling capability
- π§ Email collection option
- π One response per user limit
Tech | Purpose |
---|---|
Next.js 14 | Framework (App Router + TypeScript) |
Tailwind CSS | Utility-first CSS framework |
shadcn/ui | Accessible UI components |
Prisma | Type-safe ORM for PostgreSQL |
PostgreSQL | Robust relational database |
Docker | Containerized development |
React Hook Form + Zod | Form state management & validation |
Jest | Unit testing framework |
i18next | Internationalization |
Husky | Git hooks |
- Node.js 18+
- Docker and Docker Compose
- PostgreSQL (handled by Docker)
git clone https://github.com/augani/form-builder.git
cd form-builder
npm install
Create a .env
file in the root directory with:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/snapform"
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
docker-compose up -d
npx prisma migrate dev --name init
npx prisma generate
npx prisma db seed
npm run dev
# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch
# Run tests with coverage
npm test -- --coverage
Tests are written using Jest and @testing-library/react, focusing on:
- Component rendering
- Form validation (yet to be implemented because of time constraints)
- User interactions (yet to be implemented because of time constraints)
- API endpoints (yet to be implemented because of time constraints)
- Database operations (yet to be implemented because of time constraints)
.
βββ app/ # Next.js App Router
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ forms/ # Form management
β β βββ themes/ # Theme customization
β β βββ public-forms/ # Public form endpoints
β βββ [locale]/ # Internationalized routes
βββ components/
β βββ form-builder/ # Form building components
β βββ ui/ # Reusable UI components
βββ lib/ # Utilities and configurations
βββ prisma/ # Database schema and migrations
βββ types/ # TypeScript type definitions
βββ __tests__/ # Test files
βββ i18n/ # Internationalization files
βββ messages/ # Translation files
- Form template system
- Advanced form logic (conditional questions)
- File upload support
- Rich text editor for descriptions
- Form sharing and collaboration
- Form versioning
- Response export (CSV, Excel)
- Custom validation rules
- Form embedding options
- Webhook integrations
- Form analytics dashboard
- A/B testing for forms
- Form scheduling
- Payment integration
- Custom field types
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
π Developer's Note: I'm always excited to see what amazing features the community can add to this project! Let's make form building even more delightful together! π
For questions, suggestions, or just to chat about form builders (or anything tech-related!), feel free to reach out at [email protected] or connect via GitHub.
π P.S.: I love hearing from fellow developers and form enthusiasts! Don't hesitate to drop a message - I promise to respond! π
This project is licensed under the MIT License - see the LICENSE file for details.
π Thanks for checking out SnapForm! I hope it helps you create amazing forms that your users will love! If you use it in your projects, I'd love to hear about it! π