Skip to content

A modern, feature-rich form builder application that allows users to create, share, and analyze forms with real-time polling capabilities.

Notifications You must be signed in to change notification settings

bigsparsh/formiK

Repository files navigation

Formik

A modern, feature-rich form builder application that allows users to create, share, and analyze forms with real-time polling capabilities.

Formik Landing Page

Features

Form Builder

Create beautiful, responsive forms with a variety of field types:

  • Text Fields - Customizable with different styles (bold, italic, underline) and font sizes
  • Text Inputs - Support for text, textarea, email, and number inputs
  • Options - Multiple choice and multi-select questions
  • Rating Groups - Star ratings with customizable labels
  • File Uploads - Support for PDF, PPT, XLSX, JPEG, and PNG files
  • Images - Add visual elements to your forms

Form Creation

Live Polling

Create real-time polls with instant analytics:

  • WebSocket-powered live updates
  • Share polls via unique links
  • View response percentages in real-time
  • Perfect for presentations and quick consensus gathering

Live Polling

Dashboard

Comprehensive dashboard to manage all your forms:

  • View form statistics (forms created, responses received)
  • Access your published forms
  • Continue working on draft forms
  • Browse globally shared forms

Dashboard

Google Sheets Integration

Automatically export form responses to Google Sheets:

  • Seamless integration with Google Drive
  • Auto-formatted spreadsheets with headers
  • Real-time response syncing

Google Sheets Integration

Draft System

Never lose your work with Redis-powered drafts:

  • Auto-save your forms while creating
  • Resume editing from any device
  • View draft statistics before publishing

Draft Forms

Form Responses

Collect and analyze responses:

  • Track user submissions
  • View response data per field
  • Support for authenticated responses

Form Responses

Form Settings

Customize your form behavior:

  • Set response limits
  • Add custom response messages
  • Tag your forms for organization
  • Configure star ratings

Form Settings

Tech Stack

Frontend

  • Next.js 14 - React framework with App Router
  • React 18 - UI library
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • Framer Motion - Smooth animations
  • Recoil - State management
  • Radix UI - Accessible component primitives

Backend

  • Next.js API Routes - Serverless API endpoints
  • Prisma - Type-safe database ORM
  • PostgreSQL - Primary database
  • Redis (Valkey) - Draft storage and caching
  • NextAuth.js - Authentication

Real-time

  • Socket.io - WebSocket server for live polling
  • Express - WebSocket server framework

Integrations

  • Google APIs - Sheets and Drive integration
  • Vercel Blob - File storage

Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm
  • PostgreSQL database
  • Redis instance

Environment Variables

Create a .env file with the following variables:

# Database
POSTGRES_PRISMA_URL="your-postgres-connection-string"
POSTGRES_URL_NON_POOLING="your-postgres-direct-connection-string"

# Authentication
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-nextauth-secret"

# Google OAuth
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"

# Google Sheets
SHEET_PRIVATE_KEY="your-google-service-account-private-key"
SHEET_CLIENT_EMAIL="your-google-service-account-email"

# Redis
REDIS_URL="your-redis-connection-string"

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/formik.git
cd formik
  1. Install dependencies:
pnpm install
  1. Generate Prisma client:
pnpm prisma generate
  1. Run database migrations:
pnpm prisma db push
  1. Start the development server:
pnpm dev
  1. (Optional) Start the WebSocket server for live polling:
cd websocket
pnpm install
pnpm dev

Open http://localhost:3000 to view the application.

Project Structure

formik/
├── app/                    # Next.js App Router pages
│   ├── api/               # API routes
│   ├── auth/              # Authentication pages
│   ├── dashboard/         # User dashboard
│   │   ├── drafts/       # Draft forms
│   │   ├── global/       # Public forms
│   │   ├── liveform/     # Live polling
│   │   └── myforms/      # User's forms
│   └── form/              # Form pages
│       ├── create/       # Form builder
│       └── [formId]/     # Form viewer
├── actions/               # Server actions
├── classes/               # Manager classes
├── components/            # React components
├── lib/                   # Utility functions
├── prisma/                # Database schema
├── recoil/                # State atoms
├── types/                 # TypeScript types
└── websocket/             # Socket.io server

Scripts

Command Description
pnpm dev Start development server
pnpm build Build for production
pnpm start Start production server
pnpm lint Run ESLint

Database Schema

Key models:

  • User - Authenticated users
  • Form - Form definitions with settings and tags
  • Field - Form fields with type-specific properties
  • Option - Choices for option fields
  • Response - User form submissions
  • RatingMapping - Rating group configurations
  • GoogleSheet - Linked Google Sheets

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

License

This project is private and not licensed for public distribution.

Author

Sparsh Singh - @bigSparsh


Built with ❤️ using Next.js and modern web technologies.

About

A modern, feature-rich form builder application that allows users to create, share, and analyze forms with real-time polling capabilities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published