How andreli0/fastapi_websocket_test works
Project type and purpose
• This is a backend‐only Python microservice built with FastAPI, focused on WebSocket testing. It exposes WebSocket endpoints, implements use‐case logic, and uses a simple in-process “domain” layer for connection management.
File structure
• Top level:
• Pipfile, Pipfile.lock, requirements.txt – dependency management
• README.md – project description
• app/ – application source
• app/main.py – FastAPI app instantiation & router registration
• app/modules/websocket/ – feature module
• application/websocket_use_cases.py – business logic entry points
• infrastructure/websocket_controller.py – FastAPI WebSocket route definitions
• infrastructure/websocket_requests.py – request parsing/validation
• infrastructure/websocket_service_impl.py – concrete implementation of service contracts
• app/shared/domain/ – domain layer
• entities/WebSocketConnection.py – represents an active connection
• services/websocket_service_contract.py – abstract interface for connection management
README
• Confirms “websocket testing using fastapi” with no external DB or external services.
• Implies internal in-memory handling of connections.
Diagramming recommendations
• Blue rectangles for infrastructure
• Orange rectangles for application/use‐case
• Green rectangles for domain/contracts