How rishabh10gpt/chatter works
Project Type and Purpose
• The application is a full-stack, real-time chat system that pairs users based on common tags.
• It focuses on WebSocket connections for real-time communication, auto-reconnect features, and capturing geo-location and browser info.
• The stack mainly includes Python (FastAPI, Uvicorn) on the backend and HTML/CSS/JavaScript on the frontend.
Main Components to Identify
a. Frontend:
• Represented by the static files (chat.js, styles.css) and the HTML template (index.html).
• This component handles the user interface and client-side JavaScript for managing WebSocket connections.
b. Backend:
• Located in the app directory (main.py, __init__.py).
• Serves the API endpoints, manages WebSocket connections, and performs tag-based matching.
• Uses FastAPI to configure routes and middlewares.
c. WebSocket Server:
• Although part of the backend, highlight the dedicated handling of WebSocket connections for real-time communication.
d. External Dependencies:
• Uvicorn for running the ASGI server.
• The “requests” library used for IP-based geolocation information.
• That these are integral to starting the application and managing external calls.
Relationships and Interactions
• The browser (client) sending HTTP requests and WebSocket upgrade requests to the Backend.
• The client connecting to the WebSocket server for bi-directional messaging.
• The backend communicating with external APIs (for geolocation, for instance) and handling tag-based matches.
Architectural Patterns & Design Principles
• Separation between frontend and backend.
• Real-time event-driven communication via WebSockets.
• Modular design by differentiating the static assets, templates, and server routes.
• Mention how auto-reconnect and error handling should be visualized as part of the WebSocket management.
Technologies and Frameworks
• “FastAPI” for backend with WebSocket support.
• “Uvicorn” for serving the application.
• “HTML, CSS, JavaScript” on the frontend side.
• Optionally, capture Python version dependency and any other key details from requirements.txt.