This is a local web application created for 42 students at 42Firenze to locate their peers. It currently displays which PCs are occupied and by whom.
You can find your peer either from:
- Table
- Graphical representation of clusters.
- Graphical representation of each cluster on a single page.
The search bar is very permissive. It makes a partial lookup on these informations:
- Intra username
- Cluster position c
<id>
r<row>
p<pc>
(e.g.c1r2p3
,c1
,r2
orp3
)
/
: Homepage + where there is table and graphical representation of clusters/cluster?id=<cluster_id>
: Graphical representation of a single cluster. Ifid
is invalid or not provided, you'll get redirected to homepage
- [GET]
/api/peers/
: get information about all peers locations - [GET]
/api/peers/mock
: get fake generated peers data. It acceptsdensity
parameter which accepts range from0.0
to1.0
- [GET]
/api/clusters/
: get all clusters configurations - [GET]
/api/clusters/<:id>
: get the cluster's configuration - [GET]
/api/clusters/<cluster_id>/generate
: download the image of a single cluster's graphical representation.
If you want to test this application you'll simply need to:
-
Rename
.env.example
which contains everything you need into.env
and modify it to your needs.- If you don't have a backend which returns the peers list, you can use
/api/peers/mock
endpoint for test purposes (e.g. http://localhost:9001/api/peers/mock?density=0.5
- If you don't have a backend which returns the peers list, you can use
-
Configure the clusters inside
clusters.json
file -
Install npm packages with:
npm install
-
And finally you can start the application with:
npm start