Spaces:
Sleeping
Sleeping
| # 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!** π | |