Skip to content

Shankar-105/Social-Media-Api

Repository files navigation

🚀 Social Media Api

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.


Python FastAPI SQLAlchemy PostgreSQL WebSockets Badge JWT Badge Docker Redis Grafana Prometheus k6

🌟 Features — Everything Inside

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.


🚦 Getting Started — Simplified with Docker!

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.


📖 How to Use the API — Complete Endpoint Reference

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/docs for the built-in Swagger UI — test endpoints right from your browser!


☁️ Azure Deployment — How the app is hosted

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.


🧪 Testing — Comprehensive Test Suite!

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! 🛡️


📸 Benchmark Proof — RPS, P95 Graphs and What They Mean

docs/BENCHMARK.md

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.

📊 Monitoring and Load Testing

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.


🤝 Contributing

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.


👨‍💻 Built by Bhavani Shankar Mukka 🎓

ANITS College, Vizag

Thanks for checking out the project. If you use this API , let me know—would love to hear you ❤️


Releases

No releases published

Packages

 
 
 

Contributors