A production-grade, full-stack real-time messaging platform. Built with Django, React, WebSockets, and industry-standard engineering practices.
- ๐ด Real-time messaging โ Persistent WebSocket connections via Django Channels & Daphne (ASGI)
- ๐ JWT authentication โ Stateless auth with access/refresh token rotation (SimpleJWT)
- ๐ง OTP email verification โ 6-digit OTP-based account activation on signup
- ๐ Google OAuth 2.0 โ One-click sign-in with Google account via OAuth authorization code flow
- ๐ Forgot/Reset password โ OTP-based secure password recovery
- ๐ฌ Contact management โ Auto-discovery of contacts from message history
- ๐ฅ Health check endpoint โ Production deployment monitoring at
/api/health/ - ๐ณ Dockerized CI pipeline โ Tests run in Docker containers on every push/PR via GitHub Actions
- ๐ Deployed on Render โ ASGI server (Daphne) with
render.yamlinfrastructure-as-code
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite 7, React Router v7, Zustand, TailwindCSS |
| Backend | Django, Django REST Framework |
| Real-time | Django Channels, Daphne (ASGI / WebSocket server) |
| Auth | SimpleJWT, Google OAuth 2.0, OTP email verification |
| Backend Testing | Django Test Client, Coverage.py, Codecov |
| Frontend Testing | Vitest, React Testing Library, jsdom |
| Code Quality | Ruff (all rules), Prettier, ESLint |
| CI/CD | GitHub Actions (Tests CI, Docker build & push) |
| Containerization | Docker (Dockerized test environment on CI) |
| Deployment | Render (ASGI), render.yaml infrastructure-as-code |
dragonfly/
โโโ .github/
โ โโโ workflows/
โ โ โโโ tests_ci.yml # CI: runs backend + frontend tests on every PR
โ โ โโโ build_and_push_docker_image.yml
โ โ โโโ build_and_push_producction_image.yml
โ โโโ ISSUE_TEMPLATE/
โ
โโโ zserver/ # Core Django application
โ โโโ models/
โ โ โโโ user_profile.py # Custom User, UnverifiedUser, OTP models
โ โ โโโ message.py # Message model
โ โโโ views/
โ โ โโโ user_profile.py # Auth, signup, Google OAuth, password reset
โ โ โโโ message.py # Messages, contacts, all-users
โ โโโ serializers/ # DRF serializers with business logic
โ โโโ tests/ # Comprehensive automated test suite
โ โโโ consumers.py # WebSocket consumer (JWT-authenticated)
โ โโโ urls.py # All API route definitions
โ
โโโ frontend/ # React + Vite SPA
โ โโโ src/
โ โโโ components/ # Reusable UI components
โ โโโ pages/ # Route-level page components
โ โโโ store/ # Zustand global state management
โ โโโ hooks/ # Custom React hooks
โ โโโ services/ # Axios API service layer
โ โโโ types/ # TypeScript-compatible type definitions
โ
โโโ zproject/ # Django project config (settings, ASGI, routing)
โโโ tools/dockerfiles/ # Dockerfiles for CI test environment
โโโ docs/ # Developer documentation
โโโ render.yaml # Render deployment config (IaC)
โโโ pyproject.toml # Ruff linting config
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/user-profile/ |
Public | Register a new user (triggers OTP email) |
POST |
/api/sign-up-otp/ |
Public | Verify OTP โ activate account + return JWT |
POST |
/api/sign-in/ |
Public | Login with email/password โ return JWT tokens |
GET |
/api/user-profile/ |
JWT | Get authenticated user's profile |
PUT |
/api/user-profile/ |
JWT | Update authenticated user's profile |
DELETE |
/api/user-profile/ |
JWT | Delete authenticated user's account |
POST |
/google-login/ |
Public | Google OAuth 2.0 login โ return JWT |
POST |
/api/forgot-password/ |
Public | Send OTP for password reset |
POST |
/api/reset-password/ |
Public | Reset password using OTP |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/api/messages/ |
JWT | Fetch message history with a contact |
POST |
/api/messages/ |
JWT | Persist a sent message |
GET |
/api/contacts/ |
JWT | Get all users you've messaged |
GET |
/api/all-users/ |
JWT | Get all registered users |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/token/ |
Public | Obtain JWT token pair |
POST |
/api/token/refresh/ |
Public | Refresh access token |
POST |
/api/token/verify/ |
Public | Verify a token |
GET |
/api/health/ |
Public | Health check for deployment monitoring |
| Protocol | Endpoint | Auth | Description |
|---|---|---|---|
WS |
/ws/chat/?token=<JWT> |
JWT (query param) | Real-time bidirectional messaging |
Dragonfly enforces quality at every layer of the stack:
Backend
- Automated tests run via Django's test client, tracked with
coverage.py - Coverage reports uploaded to Codecov on every CI run
- Ruff with all rules enabled for linting + formatting
Frontend
- Unit and integration tests with Vitest + React Testing Library
- ESLint + Prettier enforced on CI
CI Pipeline (GitHub Actions)
- Backend: Docker container is built, tests run inside it, coverage uploaded to Codecov, Ruff linter verified โ all on every push/PR to
main - Frontend: Dependencies installed, ESLint run, Vitest test suite executed โ on every push/PR to
main - Docker images built and pushed to Docker Hub
See docs/setup-dev-environment.md for the full setup guide.
Quick start:
# 1. Clone the repo
git clone https://github.com/jitendra-ky/dragonfly.git
cd dragonfly
# 2. Copy and configure environment variables
cp .env.example .env
# Edit .env with your settings
# 3. Backend setup
pip install -r requirements/development.txt
python manage.py migrate
python manage.py runserver
# 4. Frontend setup (in a separate terminal)
cd frontend
cp .env.example .env
npm install
npm run devWe appreciate everyone ๐ who has contributed their time, skills, and passion to make Dragonfly better. Your efforts help drive this project forward โ thank you!
We welcome contributions from everyone! Please review our CONTRIBUTING.md and CODE_OF_CONDUCT.md before getting started.
- Fork & Clone โ Fork this repo and clone it locally
- Branch โ Create a new branch for your changes
- Implement & Test โ Make your changes and run the test suite
- Pull Request โ Open a PR against
mainfor review
For details, see CONTRIBUTING.md.
