Para ler esse texto em pt-br, use esse link.
This project aims to be a REST API, that logs and show info about usage of Raul Hacker Club space.
The prerequisites to use this project are:
A client capable of HTML requisitions, as GET and POST. The recommended service is cURL a simple and lightweight command line tool for transfering data to a server, but if you just want to use the GET requisitions a web browser like firefox is enough.
Besides that, we'll also need python and flask installed. If you need help installing these, the best place are the projects' installing page.
The first step is to run flask with our project, to do so, go to the clonec repo path and run:
export FLASK_APP=ohDeCasa-api.py
followed by flask run
To know which members are at RHC in these moment, run the following comand:
curl localhost:5000/status
the result will be a json containing the users at the space and a field called isOpen, showing wheter the place is available for visits or not.
If an user arived at the Hacker Club and wants to show others he is there, he just needs to use the checkin endpoint with his user name. For the checking-in the user ielson, it's just to run this command:
curl -H "Content-type: application/json" -d "{\"user\":\"ielson\"}" localhost:5000/checkin
resulting in checked-in user and check-in time.
The check-out function works works reversing what the check-in function does, and it's syntax are the same, you just need to pass the user name to checkout endpoint, like this:
curl -H "Content-type: application/json" -d "{\"user\":\"ielson\"}" localhost:5000/checkout