This project is a Flask-based web application with SocketIO integration for real-time chat functionality. It includes user authentication, signup, login, and chat room creation features. The application connects to a MySQL database to store user information, messages, and chat rooms. Users can join existing chat rooms, create new ones, and send/receive messages in real-time. The server-side application is structured with routes for handling user interactions and utilizes SocketIO for handling real-time communication between clients. The project also includes API endpoints for retrieving messages, searching users, and other related functionalities.
Retrieves messages for a specific chat room.
q
(Query parameter): Room name for which messages are to be retrieved.
GET /api/messages
Retrieves all messages from all chat rooms.
GET /api/messages
Searches messages based on a provided search term.
q
(Query parameter): Search term.
GET /api/messages/search?q=search_term
Retrieves messages for a specific user.
q
(Query parameter): Username for which messages are to be retrieved.
GET /api/messages/username?q=example_user
Searches users based on a provided search term.
q
(Query parameter): Search term.
GET /api/users?q=search_term
erDiagram
CHAT_ROOMS {
int room_id PK
varchar(255) room_name
int owner_id FK
}
CHAT_ROOM_ACCESS {
int id PK
int user_id FK
int room_id FK
}
MESSAGES {
int message_id PK
int user_id FK
int room_id FK
varchar(255) content
timestamp created_at
}
USERS {
int user_id PK
varchar(60) username
varchar(255) email "Check for %_@__%.__%"
varchar(255) profile_picture
varchar(255) password_hash
timestamp created_at
}
USERS ||--o{ MESSAGES : ""
CHAT_ROOM_ACCESS }o--|| USERS : ""
CHAT_ROOM_ACCESS }o--|| CHAT_ROOMS : ""
CHAT_ROOMS }o--|| USERS : "owns"
CHAT_ROOMS ||--o{ MESSAGES : ""