How bunchhq/bunch works
Project type and purpose
• From the file tree and README, this is the server-side of “Bunch,” a cross-platform chat application. It’s a Django monolithic backend exposing REST endpoints (serializers, views, routers) and supporting real-time messaging (ASGI, Django Channels).
File structure
• Top-level “server/” directory holds the Django project named “orchard” (ASGI/WGSI settings, URLs) and three Django apps:
• users — user model, serializers, views, tests
• bunch — chat logic (channels, messages, permissions), serializers, views, tests
• core — any shared utilities or site-wide features
• Key config: pyproject.toml, requirements.txt for dependencies; manage.py entry point; .github/workflows/django.yml for CI.
• ASGI config suggests WebSocket support via Django Channels and a channel layer (likely Redis).
Elements
• Labels: “Web/Mobile Client,” “Django ASGI Server,” “Django REST API,” “Redis Channel Layer,” “PostgreSQL DB”
Detailed breakdown of components
• Client tier:
• Authentication UI → /users/login/
• Chat UI → WS://server/ws/chat/
• Application tier (Django project “orchard”):
• Users app: user registration, authentication, profile (models, serializers, viewsets)
• Bunch app: channel management, messaging, permissions (WebSocket consumers, REST endpoints)
• Core app: shared utilities, site-wide views
• Infrastructure tier:
• Redis channel layer (pub/sub for messages)
• PostgreSQL database (persistent storage)
• CI/CD pipeline (GitHub Actions)
Final advice
• Endpoints (e.g., /api/users/, /api/bunch/) and WebSocket routes.