A modern, scalable adult content platform with AI-powered image and text generation, built for AWS deployment with cost optimization in mind.
- AI Content Generation: NSFW image generation using Stable Diffusion
- Text Generation: Adult-themed text content using DialoGPT
- Premium Subscriptions: Stripe-powered subscription management
- Affiliate Program: Built-in affiliate tracking and commission system
- User Management: JWT-based authentication with user profiles
- Content Storage: AWS S3 with CloudFront CDN
- Scalable Infrastructure: Auto-scaling EC2 instances with spot pricing
- Cost Optimized: Aurora Serverless, intelligent S3 tiering, spot instances
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β CloudFront ββββββ Application ββββββ RDS Aurora β
β (CDN) β β Load Balancer β β Serverless β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
ββββββββββ΄βββββββββ
β β
βββββββββββββββ βββββββββββββββ
β Backend β β Model Serverβ
β (FastAPI) β β (GPU/Spot) β
βββββββββββββββ βββββββββββββββ
β β
βββββββββββββββ βββββββββββββββ
β Redis β β S3 β
β (Cache) β β (Storage) β
βββββββββββββββ βββββββββββββββ
- Spot Instances: Up to 90% savings on GPU instances
- Aurora Serverless: Pay only for database usage
- S3 Intelligent Tiering: Automatic cost optimization
- CloudFront: Reduced bandwidth costs
- Auto Scaling: Scale down during low usage
Estimated Monthly Costs:
- Development: $50-100
- Production (low traffic): $200-400
- Production (high traffic): $800-1500
- Create an AWS account
- Configure AWS CLI:
aws configure - Ensure you have permissions for:
- EC2, VPC, ALB
- RDS, S3, CloudFront
- IAM, ECR
- Auto Scaling
git clone https://github.com/Jblast94/spicy-hub.git
cd spicy-hub
cp .env.example .envEdit .env file with your settings:
# Required: Update these values
STRIPE_SECRET_KEY=sk_live_your_stripe_key
STRIPE_PUBLISHABLE_KEY=pk_live_your_stripe_key
JWT_SECRET=your-super-secret-jwt-key
AWS_ACCESS_KEY_ID=your_aws_key
AWS_SECRET_ACCESS_KEY=your_aws_secret# Make deploy script executable
chmod +x deploy.sh
# Run full deployment
./deploy.sh# Start local environment
docker-compose up -d
# Access the application
open http://localhostspicy-hub/
βββ backend/ # FastAPI backend
β βββ main.py # Main application
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Backend container
β βββ alembic/ # Database migrations
βββ frontend/ # HTML/JS frontend
β βββ index.html # Single page application
βββ model-server/ # AI model server
β βββ main.py # Model serving API
β βββ requirements.txt # ML dependencies
β βββ Dockerfile # Model server container
βββ terraform/ # Infrastructure as code
β βββ main.tf # AWS resources
β βββ user_data.sh # EC2 initialization
βββ nginx/ # Reverse proxy config
β βββ nginx.conf # Nginx configuration
βββ docker-compose.yml # Local development
βββ deploy.sh # Deployment script
βββ .env.example # Environment template
Copy .env.example to .env and configure:
# Database
DATABASE_URL=postgresql://user:pass@host:5432/db
# Authentication
JWT_SECRET=your-secret-key
# Payment Processing
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PUBLISHABLE_KEY=pk_live_...
# AWS Services
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
S3_BUCKET=your-bucket-name
# AI Models
MODEL_SERVER_URL=http://model-server:8000- Create a Stripe account
- Get your API keys from the dashboard
- Configure webhook endpoints for subscription events
- Set up products and pricing in Stripe dashboard
- Create S3 bucket for content storage
- Set up IAM user with appropriate permissions
- Configure CloudFront distribution (optional)
- Set up RDS Aurora Serverless database
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down# Deploy infrastructure
cd terraform
terraform init
terraform plan
terraform apply
# Deploy application
./deploy.sh- Free: 5 generations per day
- Premium ($9.99/month): Unlimited generations, higher quality
- Pro ($19.99/month): Priority processing, custom models
- 30% commission on referrals
- Real-time tracking and analytics
- Automated payouts via Stripe
- External affiliate integration
- Pay-per-generation credits
- Custom content requests
- NFT marketplace integration
- Premium model access
- JWT-based authentication
- Password hashing with bcrypt
- Rate limiting on API endpoints
- CORS protection
- Age verification (18+)
- Content moderation filters
- NSFW warnings
- Secure file storage in S3
- HTTPS encryption
- Database encryption at rest
- PII data anonymization
- GDPR compliance features
- Application health endpoints
- Database connectivity checks
- Model server status monitoring
- S3 storage availability
- User registration and engagement
- Generation success rates
- Revenue and conversion tracking
- System performance metrics
- High error rates
- System resource usage
- Failed payments
- Model server downtime
# Run load tests
k6 run load-test.yml# Test backend endpoints
curl -X POST http://localhost:8080/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"password123"}'Database Connection Errors
- Check DATABASE_URL environment variable
- Ensure PostgreSQL is running
- Verify network connectivity
Model Loading Failures
- Check GPU availability
- Verify model cache directory permissions
- Ensure sufficient disk space
Stripe Integration Issues
- Verify API keys are correct
- Check webhook endpoint configuration
- Ensure test/live mode consistency
# Enable debug logging
export DEBUG=true
docker-compose up- Multiple backend instances behind load balancer
- Separate model server instances for different models
- Redis cluster for session management
- CDN for static content delivery
- GPU instances for model server
- High-memory instances for large models
- SSD storage for faster I/O
- Spot instances for non-critical workloads
- Auto-scaling based on demand
- S3 intelligent tiering
- CloudFront caching
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
# Clone your fork
git clone https://github.com/yourusername/spicy-hub.git
# Install dependencies
cd backend && pip install -r requirements.txt
cd ../model-server && pip install -r requirements.txt
# Run tests
pytestThis project is licensed under the MIT License - see the LICENSE file for details.
This platform is intended for adult content generation and must comply with:
- Local and international laws
- Age verification requirements (18+)
- Content moderation guidelines
- Platform terms of service
Users are responsible for ensuring compliance with applicable laws and regulations.
- Documentation: Check this README and inline code comments
- Issues: Report bugs via GitHub Issues
- Discussions: Use GitHub Discussions for questions
- Email: Contact support@spicyhub.com
- β Basic AI generation
- β User authentication
- β Payment processing
- β AWS deployment
- π Video generation
- π Advanced model fine-tuning
- π Mobile app
- π API marketplace
- π VR/AR integration
- π Blockchain/NFT features
- π Multi-language support
- π Advanced analytics
Built with β€οΈ for the adult content creator community