A chat server made with python and socket
- Install python
- Install node.js
- Install all required python packages with
python -m pip install -r requirements.txtwhile in the main directory - Install all required node.js pacakges with
npm iwhile in thefrontenddirectory
- In the
serverdirectory, editvars.pyto have the desired IP address and port - Run
python server.pywhile in the same directory as the file
- Run the server
- Enter the
clientdirectory - Edit the constants at the top of the file to match the ones in
vars.pyin theserverdirectory - Run
python client.pyand enter a username - To leave, type the chosen dc message
- Run the server
- Edit
vars.pyto match the one inserver.py - Set flask environment variables:
- Windows:
set FLASK_ENV=developmentandset FLASK_APP=main.py - Linux:
export FLASK_ENV=developmentandexport FLASK_APP=main.py
- Windows:
- Execute
flask run - Alternatively, use software such as gunicorn to run the server
- Run the server
- Run the API
- Go into frontend directory
- Development
- Run
npm run start - Navigate to
http://YOUR_CHOSEN_IP:3000/in the web browser of your choice
- Run
- Production
- Run
npm run build - Use some server software (such as nginx) and point the root to the newly created
buildfolder - Navige to
http://YOUR_IP/in the web browser of your choice
- Run