This repository contains the code used in TPSI lessons to simulate different graph behaviours
The backend is created using typescript, Express.js and the WS package. The service is hosted on the Plesk platform of the school's servers at https://graphsimulator.barsanti.edu.it
Links for further informations about configurations:
The backend also serves a simple web page to inspect the network state providing the actions of all the users in realtime and also a visual representation of the network.
The repository also contains a starter project to interact with the backend service.
Download the repository and setup the serverUrl string in the Main.java file to point to the school's backend.
Additional info in the Client README
- Send a message
{
"message": "Messaggio da inviare!"
"to": ["B1", "B2"]
}
- List Connected Users
{
"command": "list-users"
}
- Set neighbours
{
"command": "set-neighbours",
"neighbours": ["B2", "C1", "A3"]
}
- Set state
{
"command": "set-state",
"message": "the state you want"
}
- Get adjacency list of the network's graph
{
"command": "get-graph"
}
- List users in realtime (receive an event each time a user connects/disconnects from the server or it changes its state)
{
"command": "realtime-list-users"
}
- Track all users actions in realtime (receive an event each time a user connects/disconnect/send a message or an action to the server)
{
"command": "realtime-list-actions"
}
- Get adjacency list of the network's graph in realtime (receive an event each time a user connects/disconnects/updates his neighbours)
{
"command": "realtime-get-graph"
}
We thank Michele Porcellato, Martin Meneghetti, and Carlo Ghiraldo for developing the code.