mohit-rathee / web-chat

A lightweight web-based chat application offering real-time communication through WebSockets. Features include end-to-end encryption, media sharing, and local caching for offline use.
https://web-chat.onrender.com
GNU General Public License v3.0
1 stars 0 forks source link

create structure for browser storage #2

Closed mohit-rathee closed 1 year ago

mohit-rathee commented 1 year ago

how tables and databases gonna look like Make it efficient and super complex

mohit-rathee commented 1 year ago

About channels/people 's messages:

1st way: Store all channel/people 's metadata into single table and then store all messages into single table (this is the minimal approach to solve this problem) 2nd way:

Store all channel/people 's metadata into single table and then store messages from diff channel/people into diff tables (this too is an easy one but this may take additional storage)

About diff server's :

1st way:
we can create diff databases for each server and have same kind of layout in every server and when different severs coexists we can easily distinguish between diff database 2nd way: we can define single database and inside that we have to use additional queries (this could be a threat as if we want to get data for single server we are actually doing a lot under the hood )

mohit-rathee commented 1 year ago

we need to add extra table to mange media too which store media id ,media metadata, media hash | ID | METADATA | HASH | | 0 | image.jpg | 3e..9d | | 1 | app.py | 5g..2e |

mohit-rathee commented 1 year ago

For different servers at same time: | ID | NAME | ADMINS | |ae..fe| AlienX | 1,2,4,5| |xf..ce| BEN10 | 1,3 |

Admins are just id's in users table Here id is a unique identifier, may be uuid. Name can be anything.

mohit-rathee commented 1 year ago

server is sending following details on Load():

mohit-rathee commented 1 year ago

done centuries ago