The goal of this assignment is to write a simple web service implementing some complex functionality based on open services providing REST APIs. You are to create a service that:
- Provides clients with a static HTML page containing a form for submitting query parameters.
- Receives a request from the client.
- Queries a public REST service (various endpoints) and processes the service response to construct your own reply.
- Optionally makes additional calculations/transformations (e.g., calculates averages, sums, derives additional values, formats different results, etc.).
- Returns the result to the client (a static HTML page with the results).
You can freely choose the functionality and services you use, depending on your interests and curiosity. Example:
A client provides a city and time range (e.g., date and hour), the server queries a weather service for weather and temperature for the given period (current, hourly average, daily average) and returns all this data to the client in a simple HTML page. Optionally, the server queries a public currency API and includes currency exchange rates in the response.
Usually, the most creative solution wins (not necessarily the most elaborate code)!
You can find a list of various public APIs, e.g.:
https://publicapis.dev/
- The client (browser) sends a request based on data from a form (static HTML) and receives a simple response generated by your service. Pure HTML is enough, no styling or frontend frameworks required (pretty look is not needed, just function).
- The service should make multiple API requests (e.g., to different APIs or several endpoints within one API). Your solution should not be limited to only one call.
- The response to the client must be processed by your server, and the server must query a public REST API (no responses returned directly from the API to the client).
- The server must be run as a standalone application outside the IDE (or technology launcher).
- Optionally (not required), you can deploy your service in the cloud (e.g., Heroku). This is not graded, but may be of interest to you.
- You can use any programming language/technology (of course, Python + FastAPI is encouraged). Ensure a reasonable abstraction level (direct handling of HTTP requests/responses is okay, but you can use generators/parsers, etc.).
- The service must expose its API only according to REST principles.
- Implementing at least basic REST API security is part of the evaluation.
- Using only free, public APIs with no registration required (no developer keys).
- Additionally (not required): Prepare HTTP request tests using POSTMAN or SwaggerUI (client-server and server-public_api).
- Handle asynchronous requests to the external service (where possible).
- Handle errors and exceptions from services (e.g., if there is a communication error, send a clear message to the client, not just the server error).