This project is currently under development.
A production-ready backend system built using Spring Boot and Redis that simulates a real-time social media virality engine with strict guardrails to prevent spam and uncontrolled bot activity.
- Bot Reply → +1
- Human Like → +20
- Human Comment → +50
- Each post allows a maximum of 100 bot replies
- Ensures fair usage and prevents bot flooding
- A bot cannot interact with the same user more than once every 10 minutes
- Implemented using Redis TTL (Time-To-Live)
- Nested comments limited to 20 levels
- Prevents deep recursive threads
- Ensures thread-safe updates
- Handles concurrent requests efficiently
- Java 17
- Spring Boot
- Spring Data JPA
- Redis
- MySQL
- MapStruct
- Lombok
POST /api/comments/{postId}
GET /api/comments/{postId}
POST /api/posts/{postId}/like
post:{id}:virality_score post:{id}:bot_count cooldown:bot:{botId}:human:{userId}
{
"authorId": 1,
"authorType": "BOT",
"targetUserId": 2,
"content": "AI generated reply"
}- Clone the repository
- Start Redis server
- Configure MySQL database
- Run the Spring Boot application
- Designing real-time systems using Redis
- Implementing rate limiting and cooldown mechanisms
- Handling concurrent requests safely
- Building scalable backend architectures
Nabeel Khan