Modern Social Media Backend + Real-time Chat – Scalable, Fast, and Beginner-Friendly
A fully async, non-blocking social media backend built to handle thousands of concurrent connections without breaking a sweat. Powered by FastAPI, asyncpg, Redis, and WebSockets — every route, every query, every cache hit runs on the event loop. Features refresh token rotation with family-based revocation, real-time notifications via Redis Pub/Sub, IP & user-based rate limiting, Redis caching across 11+ endpoints with automatic invalidation. CPU-heavy work (bcrypt, JWT) is offloaded to the thread pool so the server never stalls. Production-grade, real-time, and built for scale.
This API packs a lot. For the full breakdown of every feature — async architecture, auth, chat, caching, media, DevOps, and more — see docs/FEATURES.md.
Want to run the API, test it, or make your own changes? Start with docs/SETUP.md to clone the repository and set up the environment.
Now that your setup is running, explore every endpoint this API has to offer! Check out docs/API_GUIDE.md for a detailed walkthrough of all 61 REST endpoints and the real-time WebSocket chat system.
💡 Quick Start: Visit
http://localhost:8000/docsfor the built-in Swagger UI — test endpoints right from your browser!
Want to know how this project runs in the cloud? Read docs/AZURE_DEPLOYMENT.md for the Azure VM, PostgreSQL, Blob Storage, Redis, and CI/CD setup behind the live deployment.
Ready to verify everything works? Check out docs/TESTS.md for a complete guide on running the test suite.
Quick Test Run:
- 🐳 Inside Docker (Recommended):
docker compose exec api pytest pytests/ -v - 💻 Locally: Install dependencies and run
pytest pytests/ -v
All tests use a separate test database—your dev data stays safe! 🛡️
Real benchmark evidence from deployed runs, with charts + clear conclusions.
What you get inside:
- 📈 smoke/load behavior snapshots from Grafana,
- ⏱️ request rate, p95 latency, and top slow-endpoint patterns,
- 🧠 interpretation of whether limits are coming from infrastructure saturation or endpoint-level defects.
Want to observe real-time performance and run synthetic traffic on API? Start with docs/MONITORING_AND_LOAD_TESTING.md for Prometheus, Grafana, OpenTelemetry, and k6 setup.
Backend developer? Frontend developer? Either, there's a clear path for you. See CONTRIBUTING.md for role-specific setup guides, code conventions, and PR instructions.
ANITS College, Vizag
Thanks for checking out the project. If you use this API , let me know—would love to hear you ❤️