You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redis Playground showcases 15 comprehensive Redis feature groups through a clean, modular ASP.NET Core API built with modern .NET patterns and cloud-native principles.
🏗️ Technology Stack
Component
Technology
Runtime
.NET 9 with Minimal APIs
Orchestration
Microsoft Aspire
Redis Client
StackExchange.Redis
Documentation
OpenAPI/Swagger
Architecture
Clean Architecture
📦 Feature Categories
🎯 Category
📊 Features
Core
Cache, Strings, Collections
Real-time
Pub/Sub, Streams
Spatial
Geospatial Operations
Modern
JSON, Analytics, ML
Tools
Locks, Utilities, DevOps
🌟 Project Architecture
graph TB
A[🎯 AppHost<br/>Aspire Orchestration] --> B[🌐 ApiService<br/>Main API]
A --> C[📦 Redis Container<br/>Data Layer]
B --> D[📂 15 Endpoint Modules]
B --> E[🔧 Service Defaults]
D --> F[📋 Models & DTOs]
D --> G[🧪 HTTP Test Collections]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#ffebee
style D fill:#e8f5e8
sequenceDiagram
participant C as 👤 Client
participant A as 🌐 API Service
participant R as 📦 Redis
participant M as 📊 Monitoring
C->>A: HTTP Request
A->>R: Redis Operation
R-->>A: Data Response
A->>M: Telemetry
A-->>C: JSON Response
Note over A,R: Aspire handles<br/>service discovery
Note over M: OpenTelemetry<br/>observability
Loading
⚡ Quick Start
📋 Prerequisites
✅ Required
🔧 .NET 9 SDK
🐳 Docker Desktop
💻 Git (for cloning)
🌟 Recommended
🎨 VS Code with REST Client
🔍 Redis CLI tools
📊 Aspire Dashboard browser
🚀 Option 1: Aspire Orchestration(Recommended)
# 🎯 One-command startup with full observability
git clone https://github.com/fkucukkara/RedisPlayground.git
cd RedisPlayground
dotnet run --project RedisPlayground.AppHost
# 🐳 Start Redis container
docker run -d -p 6379:6379 --name redis-playground redis:latest
# 🌐 Run API service directly
dotnet run --project RedisPlayground.ApiService
📍 Manual Access: API available at http://localhost:5528
✨ Quick Validation
Run this quick test to verify everything is working:
# 🧪 Test basic cache operation
curl -X POST "http://localhost:5528/cache/hello" \
-H "Content-Type: application/json" \
-d '"World"'# 🔍 Retrieve cached value
curl "http://localhost:5528/cache/hello"
Expected Response:"World"
📖 API Reference
🔧 Core Operations
📦 Basic Cache & Strings
# 🗄️ Distributed Cache (IDistributedCache)GET /cache/{key} # Retrieve cached valuePOST /cache/{key} # Store with 5min TTL DELETE /cache/{key} # Remove from cache# 🔤 String Operations & CountersGET /strings/{key} # Get string valuePOST /strings/{key} # Set string valuePOST /strings/{key}/increment # Atomic increment/decrementGET /strings/{key}/length # Get string length
📚 Collections & Data Structures
# 🗂️ Hash Operations (Key-Value maps)GET /hashes/{key} # Get all hash fieldsPOST /hashes/{key}/{field} # Set hash fieldGET /hashes/{key}/{field} # Get specific field# 📝 List Operations (Queues & Stacks) GET /lists/{key} # Get list rangePOST /lists/{key}/push # Push to listPOST /lists/{key}/pop # Pop from list# 🎯 Set Operations (Unique collections)GET /sets/{key} # Get set membersPOST /sets/{key}/add # Add to setPOST /sets/{key}/union # Set union operation# 🏆 Sorted Set Operations (Leaderboards)GET /sorted-sets/{key}/leaderboard # Get rankings by scorePOST /sorted-sets/{key}/add # Add scored memberGET /sorted-sets/{key}/rank/{member} # Get member rank
🚀 Advanced Features
⚡ Real-time & Streaming
# 📡 Pub/Sub MessagingPOST /pubsub/publish/{channel} # Publish message to channelGET /pubsub/subscribe/{channel} # Subscribe to channel (SSE)GET /pubsub/channels # List active channels# 🌊 Redis Streams (Event sourcing)POST /streams/{stream}/add # Add entry to streamGET /streams/{stream}/read # Read stream entriesPOST /streams/{stream}/group/create # Create consumer group
🌍 Location & Spatial
# 📍 Geospatial OperationsPOST /geo/{key}/add # Add location with coordinatesGET /geo/{key}/radius # Find points within radiusGET /geo/{key}/distance # Calculate distance between pointsGET /geo/{key}/nearby # Get nearby locations
flowchart TD
A[🎯 Start Here] --> B[📚 Redis Basics]
B --> C[🔧 .NET Integration]
C --> D[🏗️ Aspire Setup]
D --> E[🧪 Test with Playground]
E --> F[🚀 Build Your App]
B --> B1[Strings & Cache]
B --> B2[Lists & Sets]
B --> B3[Hashes & Sorted Sets]
C --> C1[StackExchange.Redis]
C --> C2[IDistributedCache]
C --> C3[Dependency Injection]
D --> D1[Service Discovery]
D --> D2[Container Orchestration]
D --> D3[Observability]
style A fill:#e1f5fe
style F fill:#e8f5e8