This a small application written to learn FastAPI and Python. It uses FastAPI and Websockets to create a small Chat app.
Your passwords are hashed using bcrypt and passlib. The key is currently public so please replace the key if you really want to host a server. Your Account is per Server. Do not trust any Server you do not know and DON'T use your NORMAL Password for servers that you don't own. Because the password is sent in plaintext over either HTTP or HTTPS, the password is encrypted server side, not on your client. So they could just steal it without you knowing. So be careful please.
Install all the dependencies with:
pip install -r requirements.txt
Start the backend with the following command:
uvicorn server.server:app
Then you should run the cli. On the first prompt, type "y" and press enter. Then create a user account. After that you can directly log into the new account. To test the chat, you can open a second terminal with the command from below, create a second account and log into that.
Then just start writing. When you press enter, the message will be send.
python3 cli.py --host localhost:8000