feat: implement real-time chat feature with WebSocket support

- Add WebSocket endpoint for bidirectional messaging
- Create chat message model with user and timestamp fields
- Implement message broadcasting to all connected clients
- Include input validation and rate limiting for chat messages
This commit is contained in:
2025-08-28 18:30:47 +00:00
parent 60c8861c3a
commit be0745a393
4 changed files with 2862 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
<nav>
<div class="nav-container">
<a href="/" class="logo">Rant</a>
<div class="nav-links">
<a href="/">Home</a>
<a href="/chat">Chat</a>
<a href="/search">Search</a>
{% if current_user %}
<span>
<a href="/profile/{{ current_user.id }}">Profile</a>
<a href="/notifications">Notifications {% if notif_count > 0 %}<span style="color: var(--error);">({{ notif_count }})</span>{% endif %}</a>
</span>
<span>
<a href="/logout" class="btn btn-secondary">Logout</a>
</span>
{% else %}
<span>
<button class="btn btn-secondary" onclick="showModal('login')">Login</button>
<button class="btn" onclick="showModal('register')">Sign Up</button>
</span>
{% endif %}
</div>
</div>
</nav>