Skip to content

Latest commit

 

History

History
116 lines (91 loc) · 3.3 KB

File metadata and controls

116 lines (91 loc) · 3.3 KB

Lytecord

A discord clone written in... Python??

image

How to run

Clone the repo:

git clone https://github.com/blaiyz/Lytecord.git
cd Lytecord

Optionally create a virtual environment:

pip install virtualenv
virtualenv venv
source venv/bin/activate

Server

Create a self signed certificate (you should be able to run this on linux/wsl):

openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout server.key -out server.crt -subj "/CN=<YOUR IP>" -addext "subjectAltName=IP:127.0.0.1"

Note

Make sure the CN argument is the exact one the clients will use in order to connect to the server. i.e. if you want to be accessible across your local network, you must use your IP address in that network (127.0.0.1 will not work). Similarly, use your domain name if you want to be accessible globally.

Share the server.crt file with the clients. Yes, really.

IF YOU ARE RUNNING WITHOUT DOCKER:

Install dependencies:

pip install -r requirements.txt

Download and install MongoDB and create a database called Lytecord, and then run:

python -c “from setup_database import create_indexes; create_indexes()”

Now start the server with:

python -m server

IF YOU ARE RUNNING WITH DOCKER:

Create a .env file with the following structure (these will be used when creating the database):

MONGO_USER=<USERNAME>
MONGO_PASSWORD=<PASSWORD>

Note

When you remove the mongodb container or want to change the MongoDB username/password, remove the generated data directory to avoid problems in the future.

And then run:

docker-compose up -d

Your server should now be running (at port 24827 by default).

Client (App)

Install dependencies:

pip install -r requirements.txt

Receive the server.crt file from the server host and place it in the root repo directory.

Open src/shared/protocol.py and change the HOST global to the server host's address/domain name.

Now start the app:

python -m app

Used Icons

Click here to see the list
Paper clip icons created by GOFOX - Flaticon
Community icons created by KP Arts - Flaticon
Image placeholder icons created by Graphics Plazza - Flaticon
Error icons created by Gregor Cresnar - Flaticon
Join icons created by Fathema Khanom - Flaticon
Add icons created by Freepik - Flaticon
Hashtag icons created by Mayor Icons - Flaticon