Git Product home page Git Product logo

chatapp's Introduction

Real time Chat App

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.

API Endpoints

1. Get Messages by Room

Endpoint: GET /api/messages/room

Description:

Retrieves messages for a specific chat room.

Parameters:

  • q (Query parameter): Room name for which messages are to be retrieved.

Example: GET /api/messages/room?q=example_room

2. Get All Messages

Endpoint:

GET /api/messages

Description:

Retrieves all messages from all chat rooms.

Example:

GET /api/messages

3. Search Messages

Endpoint: GET /api/messages/search

Description:

Searches messages based on a provided search term.

Parameters:

  • q (Query parameter): Search term.

Example:

GET /api/messages/search?q=search_term

4. Get Messages by Username

Endpoint: GET /api/messages/username

Description:

Retrieves messages for a specific user.

Parameters:

  • q (Query parameter): Username for which messages are to be retrieved.

Example:

GET /api/messages/username?q=example_user

5. Search Users

Endpoint: GET /api/users

Description:

Searches users based on a provided search term.

Parameters:

  • q (Query parameter): Search term.

Example:

GET /api/users?q=search_term

Database Schema ๐Ÿ“š

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 : ""
Loading

chatapp's People

Contributors

ondrejkulhavy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.