KorryKatti / Mirage

a chat app which doesn't store messages on the server
MIT License
9 stars 19 forks source link

[ Enhancement ] Refactoring the code, Touching up the file structure. #45

Open nub-rin opened 5 hours ago

nub-rin commented 5 hours ago

As discussed in issue #42 I have made an example enhancement to show you. Kindly refer to the screenshot below.

Changes

Proposed file structure, not yet worked on refactoring image

Does it still work after file changes? Yes.

image

Basic idea is just to split up code into even smaller files and their designated folder, for example the server in the backend and all the other things related to it etc to make the code more readable and easier to work on.

Let me know if this sounds cool to you so that I can start working on it further.

KorryKatti commented 4 hours ago

@nub-rin , copy paste the client.py , userinfo.json and client folder which has encryption data to two other locations , change the username for each of it in the json file and check if messages are going through.

looks good overall

nub-rin commented 4 hours ago

@KorryKatti Works Flawlessly! Also found something in server.py. There is no use of user_file and get_username() in server.py.

Here is a screenshot of it working.

Multiple Users

image

Codebase

image

Just have to change the file name of userjson in specific client file but I guess with future implementation of #42 it will not be necessary.

EDIT:

Messages.txt

(Whoever created the room in this case user, it'll update their specific message.txt) image