this is a simple app made in react/js, it makes requests on differents APIs to have a constent flow of informations!
We were interested in this language and framework and JS looked pretty usefull to make web request and handling the back-end part, as for React it is flexible and easy to make beautifull front-end while handling some back-end part
- choco install -y --force nodejs
- npm install react-scripts --save
- npm start
- Open new terminal
- cd client
- npm start
- docker-compose build
- docker-compose up
if you need to do functional testing please refer to functionalTests.md if you wish to do testing or you just want to understand how the program works.
The server is located on the port 8080 of the machine's localhost.
If you wish to run the server just type npm start
on your terminal and voila!
To see informations about widgets you can call http://localhost:8080/about.json
on your browser.
A JSON file will be returned to you that will tell you wich services have been implemented, if you implement a service, please update that route in src/index.mjs
Here is a list of the actual services, how to use them and how to extract data from them, all these data will be a simple JSON.
All the calls have to be with the method GET and will return a 200 on success, otherwise see the on error
section
/time
Gives you the time from this place, always funny to know.
params
place
=(City or country to check) => default: Toulouse
return value
{
city:
The city (or the capital of the targeted country)
region:
The region of the targeted place
country:
The targeted country
date:
The current date in the targeted city
time:
Current time in targeted city
}
on error
The response code is 404
in case no city was found
/weather
Gives you the weather from this place, so you can be jealous because its raining in you country >:).
params
place
=(City or country to check) => default: Toulouse
return value
{
weather:
The current weather in this country
icon:
A link to a cute image that shows the weather
temperature:
The actual temperature in this place in Celsius
feelslike:
The temperature you feel when you actually go out (in Celsius)
humidity:
The humidity of the air in per cent
}
on error
The response code is 404
in case no city was found
/RandomJoke
This route gives you a random "dad joke" from a wide variety
return value
{
setup:
the setup of the joke
punchline:
The punchline of the joke AKA the funny
}
/newWorld
This route gives you the status of the server from the MMO new world
params
name
=(The name of the server you want to know the status)
return value
{
name:
The name of the server
status:
The status of the server
}
/zeldaSearch
Gives you informations about an item from any TLoZ game
params
name
=(The name of the item)
return value
{
name:
The name of the item
description:
A small description about the item
}
on error
The API may be instable and return a 404
to you, i can't do anything about that
/zeldaItem
Gives you informations about a random item from any TLoZ game
return value
{
name:
The name of the item
description:
A small description about the item
}
on error
The API may be instable and return a 404
to you, i can't do anything about that
/trendingCrypto
Gives you the price of the current trending crypto B)
return value
{
currency:
it is a tab containing multiple cryptos
currency.name:
the name of the crypto
currency.price:
the price of the crypto
}
/subscriptions
Gives you the price of the current trending crypto B)
params
mail:
The user's mail, he must have been logged-in using OAuth2 session.
return value
{
subs:
list of the user's subscriptions
subs.name:
The name of the channel
subs.description:
The description of the channel
subs.image.url:
The thumbnail of the channel.
}
on error
400:
The mail haven't been provided
401:
The provided mail haven't been logged in with OAuth2 meaning he is unauthorized, or that the key has expired, meaning he should get a new one
404:
The request failed and the package i used crashed, alas i can't do anything about it, just try sending another request.