A comprehensive Kolkata pandal registration application built with Next.js featuring interactive Google Maps, Google Places autocomplete, reCAPTCHA security, and Firebase database integration.
- reCAPTCHA v3 integration for bot protection
- Server-side token verification with score validation
- Form validation with Zod schema
- Secure Firebase authentication and storage
- Google Maps integration with Kolkata pandal locations
- Clickable markers for pandal selection
- Real-time data from pujo.club API
- Marker animations on selection
- Google Places Autocomplete for address input
- Country restriction to India
- Real-time address suggestions
- Map-based address selection
- Firebase Firestore for data storage
- Automatic age calculation from date of birth
- Secure data validation and storage
- Responsive design for mobile and desktop
- Real-time formatting for phone numbers and currency
- Form validation with error messages
- Loading states and user feedback
- Ticket-style user profile generation
- Framework: Next.js 15.5.3 with App Router
- Frontend: React 19.1.0
- Database: Firebase Firestore
- Validation: Zod + React Hook Form
- Styling: Tailwind CSS 4 + shadcn/ui
- APIs: Google Maps API, Google Places API, reCAPTCHA v3, Pujo.club API
- Language: TypeScript 5
- Pandal locations with real-time data from pujo.club API
- Click map markers to auto-fill address
- Visual feedback with bouncing animations on marker selection
- Centered on Kolkata with appropriate zoom level
- Name - Text input with minimum 2 characters validation
- Date of Birth - Date picker with automatic age calculation
- Address - Google Places autocomplete (India only) or map selection
- Income Per Annum - Currency formatted input (USD)
- Phone Number - US format: +1 (555) 1234 567
- Email - Email validation with regex pattern
- reCAPTCHA v3 - Invisible bot protection
Create a .env.local file:
# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY="your_firebase_api_key"
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="your_project.firebaseapp.com"
NEXT_PUBLIC_FIREBASE_PROJECT_ID="your_project_id"
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="your_project.appspot.com"
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="your_sender_id"
NEXT_PUBLIC_FIREBASE_APP_ID="your_app_id"
# Google Maps API
NEXT_PUBLIC_GOOGLE_API_KEY="your_google_maps_api_key"
# reCAPTCHA v3
NEXT_PUBLIC_RECAPTCHA_SITE_KEY="your_recaptcha_site_key"
RECAPTCHA_SECRET_KEY="your_recaptcha_secret_key"npm install- Create a new Firebase project at Firebase Console
- Enable Firestore Database
- Configure Firebase security rules
- Get your Firebase configuration keys
- Add Firebase configuration to environment variables
Google Maps API:
- Go to Google Cloud Console
- Enable Maps JavaScript API and Places API
- Create API key and restrict to your domain
- Add to
NEXT_PUBLIC_GOOGLE_API_KEY
reCAPTCHA v3:
- Go to reCAPTCHA Admin
- Create new site (v3)
- Add site and secret keys to environment variables
npm run devdemo_form/
├── app/
│ ├── api/
│ │ ├── user/[id]/ # User data API routes
│ │ └── route.ts # Form submission API
│ ├── user/[id]/
│ │ └── page.tsx # User ticket display page
│ ├── layout.tsx # Root layout with Google Maps
│ └── page.tsx # Main registration form
├── components/
│ ├── ui/ # Reusable UI components
│ │ ├── button.tsx
│ │ ├── input.tsx
│ │ └── ...
│ ├── MyForm.tsx # Main form component
│ ├── MapView.tsx # Interactive map component
│ ├── AddressInput.tsx # Google Places autocomplete
│ └── RecaptchaComponent.tsx # reCAPTCHA wrapper
└── lib/
├── firebase.ts # Firebase configuration
├── form-schema.ts # Zod validation schema
├── address-extract.ts # Address parsing utilities
└── utils/
└── constantValues.ts # Application constants
Firebase Firestore collection structure:
interface UserData {
id: string; // Document ID
name: string; // User full name
dob: string; // Date of birth
age: string; // Calculated age
address: string; // Full address
incomePerAnnum: string; // Annual income
phoneNumber: string; // Phone number
email: string; // Email address
createdAt: string; // Registration timestamp
}- Google Maps JavaScript API with Places library
- Async loading with Next.js Script component
- Centered on Kolkata coordinates (22.5726, 88.3639)
- Optimized zoom level for city-wide view
- Real-time data from pujo.club API (https://pujo.club/data.json)
- Red dot markers for each pandal location
- Click interaction to select pandal address
- Bounce animation on marker selection
- Google Places Autocomplete for manual address input
- Country restriction to India only
- Dual input method: map selection or manual typing
- Address component extraction for city, state, pincode
- Invisible reCAPTCHA execution
- Server-side score verification (threshold: 0.5)
- Action validation for form submission
- Bot protection without user interaction
- Connect your GitHub repository to Vercel
- Add all environment variables in Vercel dashboard
- Configure Firebase security rules for production
- Set up domain restrictions for Google APIs
- Deploy automatically on push to main branch
- Configure Firebase security rules
- Set up proper API key restrictions
- Enable Firebase App Check for additional security
- Configure CORS settings for your domain
- Test reCAPTCHA functionality in production environment
- Fill registration form with validation
- Select pandal location via interactive map
- Complete reCAPTCHA verification
- Submit form and receive confirmation
- Access personalized ticket with QR code
- Unique ticket ID generation
- QR code for mobile verification
- Professional ticket design
- User profile information display
- Downloadable format support
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License