Talkit is a full-stack collaborative learning platform where learners and helpers can ask questions, discuss solutions in real time, and track progress through activities and achievements.
It is designed for communities that need both structured Q&A workflows and live communication in one product. The frontend delivers a fast, app-like experience, while the backend provides secure APIs, asynchronous task processing, and WebSocket-powered real-time updates.
This monorepo includes:
- Frontend: Next.js 15 app (App Router, TypeScript, Tailwind)
- Backend: Django 5 + Django REST Framework + Channels (WebSockets)
- Background services: Celery + Redis
- Database: PostgreSQL (pgvector image)
- Containerized development with Docker Compose
.
|-- client/ # Next.js frontend
|-- server/ # Django backend
|-- docker-compose.yaml
|-- .env.example
`-- README.md
Talkit uses a split architecture with a React-based client and a Django backend.
- User interacts with the Next.js frontend.
- Frontend sends HTTP requests to Django REST endpoints.
- Django reads/writes application data in PostgreSQL.
- Redis supports caching, channels (WebSocket layer), and Celery broker/result storage.
- Django Channels handles real-time events (chat/notifications) over WebSockets.
- Celery workers process background jobs (tasks defined in app modules).
- client/
- Next.js App Router UI, route groups, and client state management.
- server/
- Django API, auth/session logic, business rules, and WebSocket entrypoint.
- postgres
- Primary relational data store.
- redis
- Cache + pub/sub + background queue backend.
- celery worker/beat (local or optional process)
- Asynchronous and scheduled workloads.
- config/
- Platform wiring (settings, URLs, ASGI, Celery).
- users/
- User/account domain and auth-related endpoints.
- questions/
- Question workflows, serializers, tasks, and filters.
- chat/
- Messaging models, views, and WebSocket consumer.
- notifications/
- Notification domain and real-time delivery integration.
- achievements/, activities/, common/
- Shared platform features and supporting domain logic.
Use this path when you are new to the codebase.
- Start at client/src/app/layout.tsx and client/src/app/page.tsx for app shell and entry page.
- Open route-group folders in client/src/app/(auth), client/src/app/(helper), and client/src/app/(learner).
- Check reusable UI in client/src/components/ui and feature components in client/src/components/helper and client/src/components/learner.
- Review shared logic in client/src/lib, client/src/hooks, client/src/contexts, and client/src/providers.
- Track API usage from client/src/lib/api to find backend endpoint dependencies.
- Start with server/config/settings.py and server/config/urls.py.
- Pick domain app folder (server/users, server/questions, server/chat, server/notifications).
- Follow each domain in this order:
- models.py for data schema
- serializers.py or serilizers.py for request/response mapping
- views.py and urls.py for endpoint surface
- services.py and tasks.py for business/background logic
- consumer.py for WebSocket behavior (where present)
- Check cross-domain behavior in signals.py files.
- Validate expected behavior in each app's tests.py.
- Add or change API route: server//urls.py + server//views.py
- Change DB structure: server//models.py then run migrations
- Update async job: server//tasks.py + server/config/celery.py
- Update real-time socket behavior: server/chat/consumer.py or server/notifications/consumer.py
- Update global UI shell: client/src/app/layout.tsx
- Update page-level UI: client/src/app/**
- Update reusable UI primitives: client/src/components/ui/**
Choose one of the two workflows:
- Docker workflow (recommended)
- Local workflow (manual frontend + backend)
- Docker Desktop
- Docker Compose
- Node.js 18+
- npm 9+
- Python 3.11+
- PostgreSQL 15+
- Redis 7+
Create a root .env file using .env.example as a base.
Current .env.example contains:
DEBUG=True
SECRET_KEY=your-secret-key-here
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id-here
NEXT_PUBLIC_GITHUB_CLIENT_ID=your-github-client-id-here
Recommended additions for local development:
# Django database URL (local)
DATABASE_URL=postgres://sudeis:<your-password>@localhost:5433/talkit_db
# Redis URLs (optional, defaults exist in Django settings)
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
REDIS_CACHE_URL=redis://localhost:6379/1
CHANNEL_REDIS_URL=redis://127.0.0.1:6379/2
# Optional backend integrations
GOOGLE_CLIENT_ID=
GOOGLE_API_KEY=
GEMINI_API_KEY=
EMAIL_HOST=
EMAIL_PORT=587
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
CLOUDINARY_URL=
Note: Docker Compose also injects service-level environment variables for container networking.
From repository root:
docker compose up --buildServices:
- Frontend: http://localhost:3000
- Backend: http://localhost:8000
- Swagger docs: http://localhost:8000/swagger/
- ReDoc: http://localhost:8000/redoc/
- PostgreSQL: localhost:5433
- Redis: localhost:6379
Stop all services:
docker compose downFrom server:
python -m venv .venv
# Windows PowerShell
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python manage.py migrate
python manage.py runserverBackend runs at: http://127.0.0.1:8000
If you want to run the Django ASGI app with Uvicorn instead of runserver:
pip install uvicorn
uvicorn config.asgi:application --host 0.0.0.0 --port 8000 --reloadThen open: http://127.0.0.1:8000
From client:
npm install
npm run devFrontend runs at: http://localhost:3000
From server:
celery -A config worker --loglevel=infoOptional scheduler:
celery -A config beat --loglevel=info- Django REST routes are mounted under:
/users//questions//chat//notifications/
- OpenAPI docs:
/swagger//redoc/
- WebSockets are served through Django Channels ASGI app.
npm run dev
npm run build
npm run start
npm run lint
npm run formatpython manage.py migrate
python manage.py createsuperuser
python manage.py test- If frontend cannot reach backend in Docker, verify
NEXT_PUBLIC_API_URLand ensure all compose services are healthy. - If backend cannot connect to database locally, verify
DATABASE_URLand PostgreSQL port. - If WebSockets or Celery fail, ensure Redis is running and Redis URLs are correct.
- On Windows, Celery may need the solo pool; this is already handled in Django settings.
Add your project license here (for example, MIT).