A real-time chat application built with Django REST Framework and React.
- Frontend: React (TypeScript, Tailwind CSS)
- Backend: Django REST Framework, Django Channels (WebSocket)
- Database: PostgreSQL
- WebSocket Layer: Redis
- Proxy: NGINX
- Containerization: Docker
- Orchestration: Kubernetes
- Docker
- Docker Compose
- Kubernetes (e.g., Minikube, Docker Desktop, or a cloud provider)
- kubectl
- Clone the repository:
git clone https://github.com/akash720/real-time-chat-app.git cd real-time-chat-app
- Start all services:
docker-compose up --build
- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Build Docker images and restart deployments:
From root project directory, run:
docker build -t chat-frontend:latest ./frontend && kubectl rollout restart deployment chat-frontend docker build -t chat-backend:latest ./backend && kubectl rollout restart deployment chat-backend docker build -t chat-nginx:latest ./nginx && kubectl rollout restart deployment chat-nginx
- Scale all deployments (if needed):
kubectl scale deployment --all --replicas=1
- Apply manifests (if not already applied):
kubectl apply -f k8s/
Access the application on your localhost using the default ports after deployment.
Create the required secrets before deploying:
kubectl apply -f k8s/secrets.yaml
- Django 4.2
- Django REST Framework
- Django Channels
- channels-redis
- psycopg2-binary
- daphne
- django-cors-headers
- django-rest-swagger
- djangorestframework-simplejwt
- gunicorn
- whitenoise
- React 18
- TypeScript
- Tailwind CSS
- axios
- react-router-dom
- @headlessui/react, @heroicons/react
.
├── backend/ # Django backend
├── frontend/ # React frontend
├── nginx/ # NGINX config
├── k8s/ # Kubernetes manifests
├── docker-compose.yml # Local dev orchestrator
└── README.md # Project documentation
- Frontend: Serves the React SPA, communicates with backend via REST/WebSocket.
- Backend: Django REST API, WebSocket endpoints via Channels, handles auth, chat, and persistence.
- NGINX: Proxies frontend, API, and WebSocket traffic.
- PostgreSQL: Stores user and message data.
- Redis: WebSocket layer for Django Channels.
- Kubernetes: Orchestrates all services for production.
MIT