Skip to content

arshads28/socialconnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

144 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SocialConnect πŸš€

A Real-Time Social Networking Platform (MVP)

πŸ“Œ Overview

SocialConnect is a web-based social networking platform built with Django and WebSockets, designed to support real-time interaction at scale. It enables users to create profiles, share posts, discover and connect with others, communicate via chat and calls, and participate in public or private virtual rooms.

This project is developed as a production-ready MVP supporting up to 1,000 active users, following industry-standard backend architecture and security practices.


✨ Features

πŸ‘€ User & Profile

  • Secure user registration and authentication
  • Customizable user profiles (avatar, bio, interests)
  • Connection system (send, accept, reject, block)

πŸ“° Public Feed

  • Create posts with text, images, and videos
  • Global feed visible to all authenticated users
  • Pagination / infinite scrolling
  • Admin moderation support

πŸ’¬ Real-Time Communication

  • One-to-one real-time chat (WebSockets)
  • Image sharing in chat
  • Typing indicators & read receipts
  • In-app unread message indicators

πŸ“ž Audio & Video Calls

  • One-to-one voice and video calls
  • WebRTC peer-to-peer communication
  • Call signaling via WebSockets
  • Mute, camera toggle, busy-state handling

🏠 Rooms (Public & Private)

  • Public rooms (visible, no password)
  • Private rooms (password protected)
  • Group text chat
  • Group video calls (up to 6 participants)
  • Host moderation (kick users)
  • Auto-delete rooms when inactive

πŸ› οΈ Technology Stack

Backend

  • Python 3.11+
  • Django 5.x
  • Django REST Framework
  • Django Channels (WebSockets)

Frontend

  • HTML5 (Semantic)
  • CSS3 (Flexbox, Grid)
  • Vanilla JavaScript (ES6+)

Infrastructure

  • PostgreSQL (Database)
  • Redis (WebSocket & caching layer)
  • WebRTC (Audio/Video Calls)
  • AWS S3 / MinIO (Media Storage)
  • Nginx (Reverse Proxy)
  • Docker & Docker Compose (Deployment)

πŸ—οΈ Project Structure


β”œβ”€β”€ apps
β”‚   β”œβ”€β”€ accounts
β”‚   β”‚   β”œβ”€β”€ admin.py
β”‚   β”‚   β”œβ”€β”€ apps.py
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ migrations
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   β”œβ”€β”€ __pycache__
β”‚   β”‚   β”œβ”€β”€ serializers.py
β”‚   β”‚   β”œβ”€β”€ tests.py
β”‚   β”‚   β”œβ”€β”€ urls.py
β”‚   β”‚   └── views.py
β”‚   β”œβ”€β”€ calls
β”‚   β”‚   β”œβ”€β”€ admin.py
β”‚   β”‚   β”œβ”€β”€ apps.py
β”‚   β”‚   β”œβ”€β”€ consumers.py
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ migrations
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   β”œβ”€β”€ __pycache__
β”‚   β”‚   β”œβ”€β”€ routing.py
β”‚   β”‚   β”œβ”€β”€ tests.py
β”‚   β”‚   β”œβ”€β”€ urls.py
β”‚   β”‚   └── views.py
β”‚   β”œβ”€β”€ chat
β”‚   β”‚   β”œβ”€β”€ admin.py
β”‚   β”‚   β”œβ”€β”€ apps.py
β”‚   β”‚   β”œβ”€β”€ consumers.py
β”‚   β”‚   β”œβ”€β”€ context_processors.py
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ migrations
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   β”œβ”€β”€ __pycache__
β”‚   β”‚   β”œβ”€β”€ routing.py
β”‚   β”‚   β”œβ”€β”€ tests.py
β”‚   β”‚   β”œβ”€β”€ urls.py
β”‚   β”‚   └── views.py
β”‚   β”œβ”€β”€ posts
β”‚   β”‚   β”œβ”€β”€ admin.py
β”‚   β”‚   β”œβ”€β”€ apps.py
β”‚   β”‚   β”œβ”€β”€ background.py
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ migrations
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   β”œβ”€β”€ __pycache__
β”‚   β”‚   β”œβ”€β”€ tests.py
β”‚   β”‚   β”œβ”€β”€ threadpool.py
β”‚   β”‚   β”œβ”€β”€ urls.py
β”‚   β”‚   └── views.py
β”‚   └── rooms
β”‚       β”œβ”€β”€ admin.py
β”‚       β”œβ”€β”€ apps.py
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ migrations
β”‚       β”œβ”€β”€ models.py
β”‚       β”œβ”€β”€ __pycache__
β”‚       β”œβ”€β”€ tests.py
β”‚       └── views.py
β”œβ”€β”€ backend
β”‚   β”œβ”€β”€ asgi.py
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ __pycache__
β”‚   β”‚   β”œβ”€β”€ asgi.cpython-312.pyc
β”‚   β”‚   β”œβ”€β”€ asgi.cpython-313.pyc
β”‚   β”‚   β”œβ”€β”€ __init__.cpython-312.pyc
β”‚   β”‚   β”œβ”€β”€ __init__.cpython-313.pyc
β”‚   β”‚   β”œβ”€β”€ settings.cpython-312.pyc
β”‚   β”‚   β”œβ”€β”€ settings.cpython-313.pyc
β”‚   β”‚   β”œβ”€β”€ urls.cpython-312.pyc
β”‚   β”‚   └── urls.cpython-313.pyc
β”‚   β”œβ”€β”€ settings.py
β”‚   β”œβ”€β”€ urls.py
β”‚   └── wsgi.py
β”œβ”€β”€ db.sqlite3
β”œβ”€β”€ logs
β”‚   └── django.log
β”œβ”€β”€ manage.py
β”œβ”€β”€ media
β”‚   └── posts
β”‚       β”œβ”€β”€ 1000065337.jpg
β”‚       β”œβ”€β”€ 1000065709.mp4
β”‚       β”œβ”€β”€ 1000065711.mp4
β”‚       β”œβ”€β”€ 1000187680.jpg
β”‚       β”œβ”€β”€ arsasdfwurtow.jpg
β”‚       β”œβ”€β”€ arsasdfwurtow_L61BVrk.jpg
β”‚       β”œβ”€β”€ images_5bcsZjl.jpeg
β”‚       β”œβ”€β”€ images.jpeg
β”‚       β”œβ”€β”€ images_MmiweKO.jpeg
β”‚       β”œβ”€β”€ images_pHLSltP.jpeg
β”‚       β”œβ”€β”€ images_sQhSWQH_processed.jpg
β”‚       β”œβ”€β”€ mountainsss_processed.jpg
β”‚       β”œβ”€β”€ mountww45er_0dL7s9i_ZC90aqq.jpg
β”‚       β”œβ”€β”€ mountww45er.jpg
β”‚       └── photo_xLA6aTd.jpg
β”œβ”€β”€ staticfiles
β”‚   β”œβ”€β”€ admin
β”‚   β”‚   β”œβ”€β”€ css
β”‚   β”‚   β”œβ”€β”€ img
β”‚   β”‚   └── js
β”‚   β”œβ”€β”€ rest_framework
β”‚   β”‚   β”œβ”€β”€ css
β”‚   β”‚   β”œβ”€β”€ docs
β”‚   β”‚   β”œβ”€β”€ fonts
β”‚   β”‚   β”œβ”€β”€ img
β”‚   β”‚   └── js
β”‚   └── staticfiles.json
└── templates
    β”œβ”€β”€ addpost.html
    β”œβ”€β”€ auth
    β”‚   β”œβ”€β”€ login.html
    β”‚   β”œβ”€β”€ reset_manual.html
    β”‚   └── signup.html
    β”œβ”€β”€ base.html
    β”œβ”€β”€ call_interface.html
    β”œβ”€β”€ chat
    β”‚   β”œβ”€β”€ chat.html
    β”‚   └── inbox.html
    β”œβ”€β”€ components
    β”œβ”€β”€ home.html
    β”œβ”€β”€ includes
    β”‚   └── single_post.html
    β”œβ”€β”€ profile
    β”‚   β”œβ”€β”€ edit_profile.html
    β”‚   └── profile.html
    └── search.html

---

## βš™οΈ Setup Instructions (Local Development)

### 1️⃣ Clone Repository

```bash
git clone https://github.com/<arshads28>/socialconnect.git
cd socialconnect

2️⃣ Create Virtual Environment

python -m venv venv
source venv/bin/activate   # Linux/macOS
venv\Scripts\activate      # Windows

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Configure Environment Variables

Create a .venv file:

DEBUG=True
SECRET_KEY=your-secret-key
DATABASE_URL=postgres://user:password@localhost:5432/socialconnect
REDIS_URL=redis://127.0.0.1:6379

5️⃣ Run Migrations

cd backend
python manage.py makemigrations
python manage.py migrate

6️⃣ Create Superuser

python manage.py createsuperuser

7️⃣ Start Development Server

uvicorn backend.asgi:application --reload --host 0.0.0.0 --port 8000

for production

gunicorn backend.asgi:application -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000

for frontend use local

npx expo start --dev-client --clear

to built app for apk for configuration run this : npx expo prebuild

eas build -p android --profile preview eas build -p ios --profile preview

or

eas build -p ios --profile development

eas build -p android --profile development npx expo start --dev-client --clear


πŸ”Œ WebSocket & Real-Time Support

  • WebSocket connections handled via Django Channels
  • Redis required for channel layer
  • Secure WebSockets (WSS) enforced in production
  • WebRTC signaling managed through WebSocket consumers

πŸ”’ Security Features

  • Password hashing (Argon2 / PBKDF2)
  • CSRF & CORS protection
  • Secure WebSocket authentication
  • Input sanitization to prevent XSS
  • Rate limiting for login and messaging
  • No local media storage in production

πŸ“ˆ Performance & Scalability

  • Supports 1,000 concurrent users
  • WebSocket latency < 300ms
  • Database indexing for performance
  • Modular Django app architecture
  • Redis & PostgreSQL can be scaled independently

πŸ§ͺ Testing

  • Unit tests for models and services
  • Integration tests for chat flows
  • Manual testing for WebRTC
  • Load testing using tools like Locust

🚫 Out of Scope (MVP)

  • Push notifications (Email/SMS/Mobile)
  • Post likes & comments
  • User mentions and hashtags
  • Call recording
  • AI-based recommendations

πŸ“¦ Deliverables

  • Source code (GitHub)
  • Database schema (ER Diagram)
  • setup.md – Local setup guide
  • deployment.md – Production deployment guide

πŸ“„ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Arshad Backend Developer | Django | WebSockets | WebRTC


to make build locally just apk

npm install

npx expo prebuild --clean

cd android .\gradlew assembleDebug

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors