🟡 Pleno — Chat em tempo real com FastAPI WebSocket e interface web embutida
sequenceDiagram
participant U1 as Usuário 1
participant S as FastAPI
participant U2 as Usuário 2
U1->>S: WS connect /ws/alice
S-->>U1: ack
S-->>U2: 🟢 alice entrou
U1->>S: send mensagem
S-->>U2: [alice]: mensagem
U1->>S: disconnect
S-->>U2: 🔴 alice saiu
- Python 3.11+
- FastAPI
- WebSockets
- Uvicorn
pip install -r requirements.txt
uvicorn main:app --reload
# Acesse http://localhost:8000chat-websocket-py/
├── main.py
├── manager.py
└── requirements.txt