A complete, production-ready Next.js 15 application for Teer predictions with admin panel, user subscriptions, and automated prediction generation.
- π Free Access: View latest Teer results
- π Advanced Predictions: AI-powered predictions based on 30-day frequency analysis
- π³ Flexible Subscriptions: Multiple subscription packages (1-30 days)
- π± WhatsApp Integration: Easy communication for payment verification
- π Secure Payments: Manual verification with proof upload
- π’ House Management: CRUD operations for Teer houses
- π Results Management: Upload results individually or via CSV (30-day bulk upload)
- π§ Auto-Predictions: Generate predictions with frequency analysis
- Common numbers (top 10 frequent)
- Direct numbers (recent high-frequency)
- House numbers (consistent patterns)
- Ending numbers (last digit analysis)
- Hot/Cold numbers (trending analysis)
- π° Payment Management: Approve/reject payments with proof images
- π― Payment Methods: Configure payment QR codes and UPI details
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Database: MySQL with Prisma ORM
- Authentication: NextAuth.js v5
- Styling: Tailwind CSS + shadcn/ui
- Validation: Zod
- Notifications: Sonner (toast)
- File Handling: Built-in upload system
- CSV Parsing: PapaParse
teer-prediction-app/
βββ actions/ # Server actions
β βββ admin/ # Admin-only actions
β β βββ houses.ts
β β βββ results.ts
β β βββ predictions.ts
β β βββ payment-methods.ts
β β βββ payments.ts
β βββ auth.ts # Authentication actions
β βββ subscription.ts # User subscription actions
βββ app/ # Next.js app directory
β βββ admin/ # Admin panel routes
β βββ api/ # API routes
β βββ auth/ # Authentication pages
β βββ dashboard/ # User dashboard
β βββ predictions/ # Predictions page
β βββ results/ # Results page
β βββ subscription/ # Subscription page
β βββ error.tsx # Global error handler
β βββ layout.tsx # Root layout
β βββ not-found.tsx # 404 page
β βββ page.tsx # Home page
βββ components/ # React components
β βββ ui/ # shadcn/ui components
β βββ error-boundary.tsx
β βββ toaster.tsx
βββ lib/ # Utility functions
β βββ validations/ # Zod schemas
β βββ errors.ts # Error handling
β βββ file-upload.ts # File upload utilities
β βββ predictions.ts # Prediction algorithm
β βββ prisma.ts # Prisma client
β βββ utils.ts # Helper functions
βββ prisma/
β βββ schema.prisma # Database schema
βββ public/
β βββ uploads/ # File upload directory
βββ types/
β βββ next-auth.d.ts # TypeScript definitions
βββ .env.example # Environment variables template
βββ middleware.ts # Route protection
βββ package.json
- Node.js 18+ and npm
- MySQL database
- Git
- Clone the repository
git clone <repository-url>
cd teer-prediction-app- Install dependencies
npm install- Set up environment variables
cp .env.example .envEdit .env with your values:
DATABASE_URL="mysql://user:password@localhost:3306/teer_db"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="generate-a-random-32-char-string"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_WHATSAPP_NUMBER="919999999999"- Generate NextAuth secret
openssl rand -base64 32- Set up database
npx prisma migrate dev
npx prisma generate- Seed initial data
npx prisma db seed- Run development server
npm run devVisit http://localhost:3000
- Register a new account via the UI
- Connect to MySQL:
mysql -u root -p teer_db- Update user role:
UPDATE User SET role = 'ADMIN' WHERE email = 'your-email@example.com';Default packages (can be managed by admin):
| Package | Days | Price |
|---|---|---|
| 1 Day | 1 | βΉ29 |
| 3 Days | 3 | βΉ59 |
| 7 Days | 7 | βΉ149 |
| 15 Days | 15 | βΉ249 |
| 30 Days | 30 | βΉ399 |
The system generates predictions using frequency analysis of the last 30 days:
- Common Numbers: Top 10 most frequently appearing numbers
- Direct Numbers: Recent high-frequency matches
- House Numbers: Numbers with 15-40% appearance rate
- Ending Numbers: Analysis of last digit patterns
- Hot Numbers: Frequently appearing in last 7 days
- Cold Numbers: Rarely appearing or overdue
Comprehensive error handling throughout:
- β Try/catch in all server actions
- β Zod validation with user-friendly messages
- β Toast notifications for success/errors
- β Global error boundary
- β Prisma error handling
- β File upload validation
- β Custom error classes
GET /api/packages- Get active subscription packagesGET /api/payment-methods- Get active payment methods
All pages under /dashboard require authentication
All routes under /admin require admin role
Supported file types:
- Images: JPEG, PNG, WebP (max 5MB)
- CSV: CSV files for bulk results upload
Upload directories:
public/uploads/payment-qr- Payment QR codespublic/uploads/payment-proofs- Payment proof screenshotspublic/uploads/csv- CSV files
Key models:
- User: Authentication and user management
- House: Teer houses
- Result: Daily Teer results
- Prediction: Generated predictions
- SubscriptionPackage: Subscription plans
- Subscription: User subscriptions
- PaymentMethod: Payment QR codes and UPI
- Payment: Payment records and proofs
# Development
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linter
npm run lint
# Database operations
npx prisma migrate dev
npx prisma generate
npx prisma studio
npx prisma db seedSee DEPLOYMENT.md for detailed deployment instructions for Hostinger Cloud Hosting.
Quick deployment checklist:
- Set up MySQL database
- Configure environment variables
- Run database migrations
- Build application
- Start with PM2
- Configure Nginx
- Set up SSL
For bulk results upload, use this CSV format:
date,firstRound,secondRound
2024-01-01,45,67
2024-01-02,23,89- date: YYYY-MM-DD format
- firstRound: 0-99 or empty
- secondRound: 0-99 or empty
- π Password hashing with bcrypt
- π‘οΈ CSRF protection via NextAuth
- π SQL injection prevention via Prisma
- β Input validation with Zod
- π File upload restrictions
- π« Role-based access control
- π Secure session management
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
MIT License
For issues or questions:
- Check error logs in browser console
- Review server logs:
pm2 logs teer-app - Verify environment variables
- Check database connection
- Fork the repository
- Create feature branch
- Make changes with tests
- Submit pull request
- Email notifications for payment status
- Advanced analytics dashboard
- Mobile app (React Native)
- Automated payment gateway integration
- Multi-language support
- Export predictions as PDF