How minhduc29/gmu-connect works
Project type and purpose
• gmu-matchmaker is a full-stack web application combining a React/Vite single‐page-app frontend with a Django REST + Channels backend.
• It provides user authentication (JWT), user profiles, posts, and real-time chat via WebSockets.
File structure
• Top-level split: “frontend/” (React code) and “backend/” (Django project).
• backend/
• Django project under backend/backend/ (settings, ASGI/WGI entrypoints, JWT middleware)
• Four Django apps: users, profiles, posts, chat
• Dockerfile & docker-compose.yml for container orchestration
• frontend/
• Vite-powered React app (package.json, vite.config.js, index.html)
• src/ holds pages, components (Layout, NavBar, ProtectedRoute), services (REST + WebSocket clients), context (AuthContext), utils, and CSS styles
README
• README.md only contains the project name; no additional architectural notes. All inferences come from the file layout and dependencies.
a. Main components
• Frontend SPA (React + Vite)
• Backend monolith (Django REST framework + Django Channels)
• Database (e.g., Postgres or SQLite as defined in settings)
• Channel layer / message broker (e.g., Redis) for WebSocket routing
• External clients (Web browser, mobile)
b. Relationships & interactions
• Browser ↔ HTTP REST (Axios or fetch via api.js) ↔ Django REST endpoints (users/profiles/posts)
• Browser ↔ WebSocket (websocketService.js) ↔ Django Channels consumers via ASGI
• Django apps ↔ ORM ↔ Database
• Channels layer ↔ Redis broker ↔ multiple worker instances
c. Architectural patterns / design principles
• SPA front/back separation
• Layered backend (URL routing → views/consumers → serializers → models → DB)
• JWT authentication middleware for stateless sessions
• Pub/Sub model for chat via Channels + Redis
d. Key technologies & libraries
• Frontend: React, Vite, Context API, JSX, CSS modules
• Backend: Python 3, Django, Django REST Framework, Django Channels
• Middleware: Custom JWT auth
• Datastore: PostgreSQL/SQLite
• Broker: Redis (channels_redis)
• Containerization: Docker & docker-compose