Skip to content
Nyaguthii-CPublic

About

A FullStack chat app built on Django and Django Channels

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

83 Commits

Folders and files

Repository files navigation

LetsChat

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.


Features

  • 🔐 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)

Tech Stack

  • 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.)

Setup Instructions

1. Clone the Repo

git clone https://github.com/Nyaguthii-C/LetsChat.git
cd LetsChat

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Setup Environmental Variables .env

GETSTREAM_API_KEY=valuehere
GETSTEAM_PASSWORD=valuehere
POSTGRES_DB=valuehere
POSTGRES_USER=valuehere
POSTGRES_PASSWORD=valuehere
DJANGO_SECRET_KEY=valuehere
DEBUG=TrueOrFalse
REDIS_URL=valuehere

5. Configure Database

Set up PostgreSQL and update .env (see .env.example).

6. Run Migrations

python manage.py makemigrations
python manage.py migrate

7. Collect static files

python manage.py collectstatic

7. Run Server (supporting asgi)

daphne config.asgi:application

Running Tests

pytest

API Documentation

Access Swagger UI at:

http://localhost:8000/swagger/

🐳 Docker Setup (Optional, Recomended for Consistency)


1. Build and Run the Containers

```bash
sudo docker-compose up --build
  1. Access App
API: http://localhost:8000

Swagger Docs: http://localhost:8000/swagger/
  1. Common Docker Commands

Stop all services

docker-compose down

View logs from web app

docker-compose logs -f web

Bash into the web container

docker-compose exec web bash

Project Structure

LetsChat/
├── apps/
│   ├── users/
│   ├── chat/
│   └── notifications/
├── config/
├── staticfiles/
├── manage.py
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
└── .env

Author

Nyaguthii Carol

About

A FullStack chat app built on Django and Django Channels

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages