# Redis Cloud - Visual Setup Guide ## 🎯 Your Mission: Get Redis URL in 5 Minutes --- ## 📋 What You'll Get At the end, you'll have this: ``` redis://default:abc123xyz@redis-12345.c1.us-east-1.ec2.cloud.redislabs.com:12345 ``` --- ## 🚀 Step 1: Sign Up (2 minutes) ### Go to: https://redis.com/try-free/ **You'll see:** ``` ┌─────────────────────────────────────┐ │ Redis Cloud - Try Free │ │ │ │ [Sign up with Google] │ │ [Sign up with GitHub] │ │ │ │ Or use email: │ │ Email: [________________] │ │ Password: [________________] │ │ │ │ [Create Free Account] │ └─────────────────────────────────────┘ ``` **Click:** "Create Free Account" or use Google/GitHub **✅ No credit card needed!** --- ## 🗄️ Step 2: Create Database (2 minutes) ### After login, you'll see dashboard: ``` ┌─────────────────────────────────────────────┐ │ Redis Cloud Dashboard │ │ │ │ [+ New Database] │ │ │ │ Your Databases: │ │ (empty - let's create one!) │ └─────────────────────────────────────────────┘ ``` **Click:** "+ New Database" --- ### Choose Plan: ``` ┌─────────────────────────────────────────────┐ │ Select Your Plan │ │ │ │ ┌─────────────────┐ │ │ │ FREE │ ← Choose this! │ │ │ $0/month │ │ │ │ 30MB storage │ │ │ │ 30 connections │ │ │ └─────────────────┘ │ │ │ │ [Continue] │ └─────────────────────────────────────────────┘ ``` **Click:** "FREE" then "Continue" --- ### Configure Database: ``` ┌─────────────────────────────────────────────┐ │ Database Configuration │ │ │ │ Name: [swiftops-otp___________] │ │ │ │ Cloud: [AWS ▼] │ │ Region: [US East (N. Virginia) ▼] │ │ │ │ ✓ Auto-generate password │ │ │ │ [Activate Database] │ └─────────────────────────────────────────────┘ ``` **Fill in:** - Name: `swiftops-otp` (or anything you like) - Cloud: AWS (or any) - Region: US East (or closest to you) **Click:** "Activate Database" **⏳ Wait 30-60 seconds...** --- ## 🔑 Step 3: Get Connection Details (1 minute) ### Database is ready! You'll see: ``` ┌─────────────────────────────────────────────┐ │ swiftops-otp │ │ Status: ● Active │ │ │ │ Public endpoint: │ │ redis-15438-c212.ap-south-1.ec2... │ │ │ │ [Connect using Redis CLI, Client...] │ │ │ └─────────────────────────────────────────────┘ ``` **Click:** "Connect" button ### A popup will show: **Option A - Full URL (easiest):** ``` ┌─────────────────────────────────────────────┐ │ Connection String: │ │ ┌─────────────────────────────────────┐ │ │ │ redis://default:abc123xyz@redis-... │ │ │ │ [Copy] │ │ │ └─────────────────────────────────────┘ │ └─────────────────────────────────────────────┘ ``` **Just click Copy!** ✅ **Option B - Separate Fields:** ``` ┌─────────────────────────────────────────────┐ │ Host: redis-15438-c212.ap-south-1... │ │ Port: 15438 │ │ Username: default │ │ Password: abc123xyz456 │ └─────────────────────────────────────────────┘ ``` **Build URL manually:** ``` redis://USERNAME:PASSWORD@HOST:PORT ``` **Example from your database:** ``` redis://default:abc123xyz456@redis-15438-c212.ap-south-1.ec2.cloud.redislabs.com:15438 ``` **✅ Copy this entire URL!** --- ## 🤗 Step 4: Add to HuggingFace (1 minute) ### Go to your Space: ``` https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE ``` ### Click "Settings" tab: ``` ┌─────────────────────────────────────────────┐ │ [Files] [Settings] [Community] │ │ │ │ Variables and secrets │ │ ┌─────────────────────────────────────┐ │ │ │ [+ New secret] │ │ │ │ │ │ │ │ Existing secrets: │ │ │ │ • DATABASE_URL │ │ │ │ • CLOUDINARY_URL │ │ │ └─────────────────────────────────────┘ │ └─────────────────────────────────────────────┘ ``` **Click:** "+ New secret" --- ### Add Redis URL: ``` ┌─────────────────────────────────────────────┐ │ Add a new secret │ │ │ │ Name: │ │ [REDIS_URL_________________] │ │ │ │ Value: │ │ [redis://default:abc123xyz@redis-12345...] │ │ │ │ [Cancel] [Save] │ └─────────────────────────────────────────────┘ ``` **Fill in:** - Name: `REDIS_URL` (exactly like this!) - Value: Your full Redis URL from Step 3 **Click:** "Save" --- ## ✅ Step 5: Verify (30 seconds) ### Restart your Space: - Click "Factory reboot" or push new code - Wait for Space to start ### Check logs for: ``` ✅ OTP Service using Redis storage (redis://default:***@redis-12345...) ``` ### Test health endpoint: ``` https://YOUR_SPACE.hf.space/health ``` Should show: ```json { "components": { "redis": { "status": "connected", "storage_type": "redis", "memory": "2.5M / 30M" } } } ``` --- ## 🎉 Done! Your OTP service is now using Redis Cloud! **What you have:** - ✅ Free Redis database (30MB) - ✅ 99.99% uptime - ✅ Automatic backups - ✅ SSL encryption - ✅ No maintenance needed **Cost:** $0 forever **Setup time:** 5 minutes **Maintenance:** None --- ## 🆘 Troubleshooting ### "Connection refused" **Check:** 1. Is password correct? (no spaces, exact copy) 2. Is endpoint correct? (full domain name) 3. Is port correct? (usually 5 digits) **Test locally:** ```bash redis-cli -u "YOUR_REDIS_URL" ping # Should return: PONG ``` ### "Still using memory storage" **Check:** 1. Did you name it exactly `REDIS_URL`? (case-sensitive!) 2. Did you restart the Space after adding secret? 3. Check Space logs for error messages ### "Authentication failed" **Fix:** - Username should be `default` (not your email) - Password should be from Redis Cloud dashboard - Format: `redis://default:PASSWORD@HOST:PORT` --- ## 📞 Need Help? **Redis Cloud:** - Dashboard: https://app.redislabs.com/ - Docs: https://docs.redis.com/latest/rc/ - Support: https://redis.com/company/support/ **HuggingFace:** - Docs: https://huggingface.co/docs/hub/spaces - Forum: https://discuss.huggingface.co/ --- **Happy coding!** 🚀