This project is a social networking application API built using Django Rest Framework (DRF). The API includes user authentication, search functionality, and friend request management.
-
User Authentication:
- Signup with email (case insensitive).
- Login with email and password (case insensitive).
-
User Search:
- Search users by email or name (paginated, 10 records per page).
- Exact email match returns the associated user.
- Partial name match returns all matching users.
-
Friend Management:
- Send, accept, and reject friend requests.
- List of friends (accepted friend requests).
- List of pending friend requests (received but not yet accepted/rejected).
- Limit of 3 friend requests per minute per user.
- Docker
- Docker Compose
- Git
-
Clone the Repository:
git clone https://github.com/kiranrokkam09/social_media.git cd social_media
-
Build and Run Docker Containers:
docker-compose up --build
-
Create a Superuser (optional): To create an admin user for accessing the Django admin interface:
docker-compose exec web python manage.py createsuperuser
-
Signup:
POST /signup { "email": "user@example.com", "password": "your_password" }
-
Login:
POST /login { "email": "user@example.com", "password": "your_password" }
- Search Users:
GET /search/?q=search_string
-
Friend Suggestions:
GET /suggestions
-
Send Friend Request:
POST /sendrequest/id
-
Accept Friend Request:
PATCH /acceptrequest/id
-
Reject Friend Request:
DELETE /rejectrequest/id
-
List Friends:
GET /friends
-
List Pending Friend Requests:
GET /requests
The Postman collection link for testing all API endpoints is given Below. Postman Link
See requirements.txt
for a list of dependencies.
- Ensure Docker and Docker Compose are installed and running on your machine.
- Use the Postman collection for quick testing and evaluation of the API endpoints.