A comprehensive full-stack web application for managing gambling referral links and promotional campaigns with a dark neon theme, calendar functionality, and Telegram integration.
- Dark Neon Theme: Cyberpunk-inspired UI with glowing borders and text effects
- Promo Calendar: Manage time-sensitive casino promotions (48-hour events)
- Automatic Link Detection: Auto-populate affiliate URLs when adding casino promotions
- Telegram Integration: One-click HTML copy buttons optimized for Telegram posting
- Admin Dashboard: Three-tab interface (Overview, Calendar, Link Management)
- Click Tracking: Analytics dashboard with comprehensive statistics
- Database Seeding: Pre-populate with all GambleCodez referral links
- Responsive Design: Mobile-friendly interface
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS with custom neon styling
- shadcn/ui component library
- TanStack React Query for state management
- Wouter for client-side routing
- Node.js with Express.js
- TypeScript with ES modules
- PostgreSQL with Drizzle ORM
- Replit Auth with OpenID Connect
- Session management with PostgreSQL store
- PostgreSQL (Neon serverless compatible)
- Drizzle ORM with type-safe queries
- Automatic migrations via drizzle-kit
- Node.js 20+
- PostgreSQL database
- Replit account (for authentication)
Create a .env file in the root directory:
# Database
DATABASE_URL="postgresql://username:password@host:port/database"
# Replit Auth (required)
REPLIT_DOMAINS="your-domain.com"
REPL_ID="your-repl-id"
SESSION_SECRET="your-long-random-secret-key"
ISSUER_URL="https://replit.com/oidc"
# Server
NODE_ENV="production"
PORT=3000- Clone and install dependencies:
git clone <your-repo>
cd gamblecodez
npm install- Setup database:
npm run db:push- Build the application:
npm run build- Start the server:
npm startThe application will be available at http://localhost:3000
npm run dev# Push schema changes
npm run db:push
# Check TypeScript
npm run checkβββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utility functions
β β βββ pages/ # Route components
βββ server/ # Express backend
β βββ db.ts # Database connection
β βββ routes.ts # API endpoints
β βββ storage.ts # Data layer
β βββ replitAuth.ts # Authentication
βββ shared/ # Shared types and schemas
β βββ schema.ts # Database schema
βββ scripts/ # Utility scripts
- Login: Use Replit authentication to access admin panel
- Dashboard Overview: View statistics and quick actions
- Promo Calendar:
- Add time-sensitive casino promotions
- Set start/end dates (typically 48 hours)
- Auto-detect GambleCodez affiliate links
- Copy Telegram-formatted posts
- Link Management:
- Add/edit/delete referral links
- Categorize (US, Non-US, Everywhere, Faucet, Socials)
- Tag with KYC status and VPN requirements
- Export all links for Telegram
After login, click "Seed Database with GambleCodez Links" to populate with:
- 24 US casino links
- 16 Non-US casino links
- 9 Everywhere links
- 4 Faucet links
- 7 Social media links
- 3 Featured promotions (GetZoot, Bitsler.io, Winna)
- Install Fly CLI:
curl -L https://fly.io/install.sh | sh- Deploy:
fly launch
fly deploy- Setup Node.js environment
- Install PostgreSQL
- Configure reverse proxy (nginx recommended):
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}- Setup PM2 for process management:
npm install -g pm2
pm2 start npm --name "gamblecodez" -- start
pm2 startup
pm2 savedocker build -t gamblecodez .
docker run -p 3000:3000 --env-file .env gamblecodez- Go to Replit Developer Console
- Create a new app or use existing
- Set redirect URL:
https://your-domain.com/api/callback - Copy REPL_ID and add to environment variables
- Set REPLIT_DOMAINS to your domain
- Uses PostgreSQL-backed sessions for reliability
- 7-day session expiry with automatic refresh
- CSRF protection enabled
- Secure cookies in production
- users: Replit auth user profiles
- sessions: Session storage for authentication
- links: Referral links with categories and metadata
- promo_events: Time-sensitive promotional campaigns
us: US-accessible casinosnon-us: International casinos (VPN required)everywhere: Global access casinosfaucet: Free-play faucet sitessocials: Social media links
kyc: Requires identity verificationno-kyc: No verification neededvpn: VPN/proxy friendly
--neon-cyan: hsl(187, 100%, 50%)
--neon-magenta: hsl(300, 100%, 50%)
--neon-yellow: hsl(60, 100%, 50%)
--neon-green: hsl(120, 100%, 50%)
--neon-orange: hsl(30, 100%, 50%)
--neon-blue: hsl(240, 100%, 50%)- Update
shared/schema.ts - Add to category enum in components
- Update API validation
- Run
npm run db:push
Database Connection
# Check DATABASE_URL format
DATABASE_URL="postgresql://user:pass@host:5432/dbname"Build Errors
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm installPort Conflicts
# Check if port is in use
lsof -i :3000
# Kill process if needed
kill -9 <PID>Enable debug logging:
DEBUG=express:*
NODE_ENV=development- Total links count
- Active promotions
- Social media links
- Click tracking per link
Recommended tools:
- Uptime: UptimeRobot, Pingdom
- Performance: New Relic, DataDog
- Logs: Logtail, Papertrail
- Fork the repository
- Create feature branch:
git checkout -b feature/new-feature - Commit changes:
git commit -am 'Add new feature' - Push to branch:
git push origin feature/new-feature - Submit pull request
MIT License - see LICENSE file for details
- Multi-user support with role-based permissions
- Advanced analytics with charts and graphs
- Email notification system for promotions
- API rate limiting and caching
- Mobile app with React Native
- Integration with more casino APIs
For issues or questions:
- Check existing issues on GitHub
- Create new issue with detailed description
- Include environment details and error logs
GambleCodez - Professional referral link management for the digital age π°