A real-time chat application built with Django, Django Channels, PostgreSQL, and WebSockets. Supports user registration, authentication, private messaging, and live notifications, all containerized with Docker and tested using TDD.
- 🔐 User authentication with profile
- 💬 One-on-one real-time chat using Django Channels
- 🛎️ Live in-app notifications for new messages
- 📄 API documentation via Swagger (drf-yasg)
- 🧪 Test-driven development using
pytest - 🐘 PostgreSQL database
- 🐳 Dockerized for consistent dev environment
- 🖼️ LetsChat FrontEnd (login/signup/chat UI)
- Backend: Django, Django REST Framework
- Real-Time: Django Channels, Redis (for WebSocket layer)
- Database: PostgreSQL
- Docs: Swagger / drf-yasg
- Testing: Pytest, pytest-django
- DevOps: Docker, Docker Compose
- Frontend: Vite, TypeScript, React, shadcn-ui,Tailwind CSS ( initially scaffolded using lovable.dev, with custom integration and enhancements.)
git clone https://github.com/Nyaguthii-C/LetsChat.git
cd LetsChat
python -m venv venv
source venv/bin/activatepip install -r requirements.txtGETSTREAM_API_KEY=valuehere
GETSTEAM_PASSWORD=valuehere
POSTGRES_DB=valuehere
POSTGRES_USER=valuehere
POSTGRES_PASSWORD=valuehere
DJANGO_SECRET_KEY=valuehere
DEBUG=TrueOrFalse
REDIS_URL=valuehere
Set up PostgreSQL and update .env (see .env.example).
python manage.py makemigrations
python manage.py migratepython manage.py collectstaticdaphne config.asgi:applicationpytestAccess Swagger UI at:
http://localhost:8000/swagger/
1. Build and Run the Containers
```bash
sudo docker-compose up --build
- Access App
API: http://localhost:8000
Swagger Docs: http://localhost:8000/swagger/- Common Docker Commands
docker-compose downdocker-compose logs -f webdocker-compose exec web bashLetsChat/
├── apps/
│ ├── users/
│ ├── chat/
│ └── notifications/
├── config/
├── staticfiles/
├── manage.py
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
└── .env