Skip to content

Augani/form-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ› οΈ SnapForm

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.

SnapForm Screenshot


πŸš€ Features

Core Form Building

  • ✨ Create forms with customizable titles and descriptions
  • πŸ”§ Support for multiple field types:
    • Text (Single line)
    • Email
    • 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

Live Preview

Styling & Customization

  • 🎨 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)

Customize Your Forms

Data Management

  • πŸ“¦ PostgreSQL database with Prisma ORM
  • πŸ”’ User authentication and authorization
  • πŸ“Š Response collection and management
  • πŸ“ˆ Form analytics and statistics
  • πŸ”„ Form status management (Draft, Active, Inactive)

Secure Data Management

User Experience

  • 🌐 Internationalization support
  • πŸ“± Fully responsive design
  • β™Ώ Accessibility compliant
  • 🎯 Progress bar option
  • πŸ”€ Question shuffling capability
  • πŸ“§ Email collection option
  • πŸ”’ One response per user limit

Responsive Design

Easy To Use

Intuitive Interface

Analytics & Insights

Form Analytics


🧱 Tech Stack

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

πŸ“¦ Getting Started

Prerequisites

  • Node.js 18+
  • Docker and Docker Compose
  • PostgreSQL (handled by Docker)

1. Clone the repo

git clone https://github.com/augani/form-builder.git
cd form-builder

2. Install dependencies

npm install

3. Set up environment variables

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"

4. Start PostgreSQL with Docker

docker-compose up -d

5. Set up your database, generate Prisma client and seed data

npx prisma migrate dev --name init
npx prisma generate
npx prisma db seed

6. Run the development server

npm run dev

πŸ§ͺ Testing

# 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)

πŸ—‚οΈ Project Structure

.
β”œβ”€β”€ 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

πŸ“ˆ Future Enhancements

High Priority

  • Form template system
  • Advanced form logic (conditional questions)
  • File upload support
  • Rich text editor for descriptions
  • Form sharing and collaboration

Medium Priority

  • Form versioning
  • Response export (CSV, Excel)
  • Custom validation rules
  • Form embedding options
  • Webhook integrations

Low Priority

  • Form analytics dashboard
  • A/B testing for forms
  • Form scheduling
  • Payment integration
  • Custom field types

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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! πŸš€


πŸ“§ Contact

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! 😊


πŸ“ License

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! πŸš€

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages