A movie recommendation application, that uses the weather in your location to
recommend movies.
This was also our submission for the second round (round of 11 π»π) of the ALX SE Face-Off Cup
community competition.
Challenge name: API Innovation
We use this to know the user's location, such that we can later get the weather reading
in that location for the application to work. The user is prompted visibly from the
browser, and can choose not to give their location.
Should the user decline this location request, the application then uses a default
location
We use the OpenWeatherMap API to get the current weather
in the user's location (or the default location).
Though we fetch the complete weather details from the API, the current implementation
uses the temperature at said location to recommend films.
We also fetch weather icons (such as: βοΈ, β
, ...)from the API such that we can
render then to the home screen along with the temperature in degrees Celsius
truncated to one decimal place. The icons fetched from OpenWeatherMap are actually
tiny .png
files.
We use the TMDB API for the movie-related features
The bulk of the application lay here, as expected.
Firstly, the connection between the temperature and the film recommended are based
on some internal assumptions of what we liked to see--a gloomy day may require a little
adventure to lighten up the day, for instance.
We fetch films based on genres--we use TMDB's complete (and short) list
of genres and genre ids.
Because the returned data often contains duplicate films, as one film can belong to
more than one genre, we do employ logic on the backend to pluck out those duplicates
before we show them on the home screen.
Currently, making the api request and getting back the data, and fetching the film posters
takes about 5 - 7 seconds, so in place of the would-be posters, skeleton previews are rendered
as the data is being fetched.
wget https://raw.githubusercontent.com/josfam/projectquickinstall/main/sunema-install.sh && sudo chmod +x sunema-install.sh && source ./sunema-install.sh
After (maybe) entering your password, all you have to do is wait while the project gets setup.
After the project has been setup, you will see two terminals open automatically.
One is for the frontend vite server, one is for the backend flask server.
Keep these terminals open while you use the program
Here's an example of the two terminal contents
The command will also open a browser on your computer, where you can proceed to try the application
That's fine.
If you are running this project locally, and you do not have the necessary API keys,
The application still works just fine.
The only caveat is that you will be viewing pre-selected sample films--loaded from our database in your browser.First, create an account on both TMDB and OpenWeatherMap.
Then go to the API pages for TMDB, and OpenWeatherMap and request your API keys...