Connectly is a full-featured social media platform built with Django. It provides a real-time, interactive experience for users to connect, share content, and communicate. The application includes a dynamic feed, user profiles, notifications, and a real-time chat system powered by Django Channels and WebSockets.
- User Authentication: Secure user signup, login, and logout functionality.
- Social Feed: A central feed displaying posts from all users in chronological order, with infinite scrolling.
- Posts, Likes, and Comments: Create text-based posts, and interact with them by liking and commenting.
- User Profiles: View user profiles, see their posts, and check follower/following counts.
- Follow System: Follow and unfollow other users to customize your social graph.
- Real-time Notifications: Receive instant notifications for new likes, comments, and follows.
- Live Chat: Engage in one-on-one real-time messaging with other users.
- REST API: Exposes endpoints for authentication and fetching the feed, secured with token authentication.
- Dark Mode: A sleek, user-toggleable dark mode for comfortable viewing.
- Responsive Design: A clean and responsive user interface that works across different screen sizes.
- Backend: Python, Django
- API: Django REST Framework
- Real-time Communication: Django Channels, WebSockets
- Database: SQLite (default), configured with
dj-database-urlfor easy switching. - Message Broker: Redis (for Django Channels)
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Deployment: Gunicorn, Uvicorn, Whitenoise
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/rifatsh3ikh/Connectly.git cd Connectly -
Create and activate a virtual environment:
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies: The project relies on several Python packages. Install them using pip:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory and add the following variables.SECRET_KEY='your-secret-django-key' REDIS_URL='redis://127.0.0.1:6379'
-
Start Redis Server: Ensure you have a Redis server instance running on the default port (
6379). You can download and run it from the official Redis website. -
Apply database migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
The application will be available at http://127.0.0.1:8000/.
The application provides the following REST API endpoints:
- Endpoint:
POST /api/login/ - Description: Authenticates a user and returns an authentication token.
- Body:
{ "username": "your_username", "password": "your_password" } - Response:
{ "token": "your_auth_token" }
- Endpoint:
GET /api/feed/ - Description: Retrieves the latest 20 posts from the feed. Requires authentication.
- Headers:
Authorization: Token your_auth_token - Response: An array of post objects.
[ { "id": 1, "author": { "id": 1, "username": "testuser" }, "content": "This is my first post on Connectly!", "created_at": "2024-01-01T12:00:00Z" }, ... ]
Contributions are welcome! To contribute:
Fork the project
Create a feature branch (git checkout -b feature/your‑idea)
Commit your changes (git commit -m "Add feature")
Push to your branch (git push)
Open a Pull Request
Maintained by rifatsh3ikh