The backend of the social media platform is a RESTful API built using Django Rest Framework, a powerful and flexible framework for building web APIs. The API enables users to create profiles, post messages, follow other users, and engage in real-time conversations through chat and notifications powered by WebSockets. You can see a description of the frontend here.
The system is built with Django's robust authentication system, using JWT authentication to secure user access and ensure that only authorized individuals can interact with the platform's data. Upon registration, users receive a confirmation email to verify their account, further enhancing the security.
Celery and Celery-beat are integrated with Redis to handle background tasks such as generating post trends and creating friend suggestions, ensuring the platform remains responsive and capable of processing complex data asynchronously.
The API includes endpoints for managing user profiles, messages, and followers. Users can create and update profile information, including their username, email, and password. The message endpoint allows users to create, edit, and delete posts with details such as a title, content, and timestamp. The follower endpoint lets users follow and unfollow others, populating their home page with the latest posts from those they follow.
Designed with scalability and performance in mind, the API utilizes optimized queries and efficient data retrieval via Django’s ORM. It also implements rigorous security measures against threats such as cross-site scripting (XSS) and SQL injection.
Deployed on a cloud platform like AWS, the backend is accessible globally and easily integrates with other services. Its powerful foundation supports the development of modern, connected applications.
Overall, with real-time WebSocket features, Celery-driven trends and friend suggestions, and secure JWT-based authentication, the backend provides a comprehensive and scalable solution for building a dynamic social media platform.