Need help to implement networking in python
Server.py
Load data from file This option will ask the user for a fully qualified path and will load a JSON file containing the information for users and pending messages. The format of the JSON file will be defined based on your implementation and it will the same used to save the data into file (menu option #4).
Functionalities the server must provide: 1)
User Sign Up: adds a user identified by a phone number to the system.
a) Protocol: USR|username|password|display_name
b) Response: 0|OK for success. 1| for an error.
c) The server should validate that the username does not exist
2) User Sign In: verify user credentials
a) Protocol: LOG|username|password
b) Response: i) 0|OK → the credentials are correct.
ii) 1|Invalid Credentials iii) 2|Already Logged In → in case that the user is logged in from another client.
c) This will help the server knowing which user is connected.
d) The server should keep a list of connected clients, which should remove the client/user upon client
disconnection/termination.
------------------------------------------------------
client.py
The client app will run on a standalone application called client.py. Once the application starts, it will display a main menu with the following options:
1. Connect to server
2. Login
3. Send Message
1. Connect to server Will request the server IP and port and will connect the client to the server. Please review the consideration section below for more details about the client/server communications.
3.2. Login Will ask for the user credentials and will authenticate the user to the connected server.
3.3. Send Message Will ask the user for the target username and the message and will send it to the server.