This is a replica of a movie streaming website similar to Netflix or Disney+.
This Project has been assigned by Boolean S.r.l. It's also my first large VueApp that makes use of dynamic API and user inputs.
Boolean established the milestones to follow for the project.
Milestones 1 through 3 focus on the fetching and manipulation of the correct data from TheMovieDatabase API and displaying them correctly on screen. Milestone 4 implements the UI (aesthetics) and UX. There are also two additional bonus Milestones (5 and 6) that allows displaying of additional info about a movie or tv series and adds filters for them. This requires more advanced manipulation of the API that I will leave for the end once all of the non-optional milestones work properly.
I created the vue project and connected to a remote repo on GitHub. Next I focused on analysing the macro-structure of the Project and began planning my components top down. This division is done in a very abstract way because I am not thinking of the design or the micro-components.
- HeaderComponent: this component will contain the logo, some user info, search bars and any settings I will decide to add afterwards.
- MainComponent: as the name suggests, this is the main component that will display the movies/tv series.
- FooterComponent: additional links, support links and other company info will go here.
These three all are added to the structureComponent folder. Next I began planning the components within each of these sections. Considering that right now I am focusing only on the functional part of the website, the only component I need in this case is the ContentComponent.vue within the MainComponent. I added it to the components folder.
Last I decided to create a utilityComponents folder for some generic and resusable utility elements. Currently the only one I need for the first three milestones is a search bar. I plan to turn into an expandible search bar so I called it SearchBar_ExpandibleComponent.vue.
The first Milestone requires to implement a search bar that will send a query API request and then manipulate this data through the app to display it properly.
I added an input field in Search Bar that takes in a string typed by the user and emits it to its parents all the way to App.vue. Finally in App.vue it is captured by a function called setNewQuery that sends an axios call to the TheMovieDatabase API through the query string typed by the user. On top of sending user queries, at the first load of the page and whenever the user deletes their input, the setNewQuery function sends a generic API request that in our case requests a list of the current trending movies.
The setNewQuery function directs the axios query towards two arrays: movieSearchResuls and tvSearchResults. These two arrays, as the name suggests, contain the results of the API results. These two arrays are sent separately to the MainComponent as props. MainComponent contains two ContentComponent, one taking the data for movies, the other for tv series.
I planned the structure this way to allow reusability and scalability. Tv Series and Movies can be handled as unique instances of the same component and allows future scalability in case we wanted to have more specific arrays such as: Latest Releases, Documentaries, etc.
The second milestone requires adding a flag for each movie/tv series based on the original language of the production. To accomplish this I added a new API endpoint (from https://countryflagsapi.com/) that generates flags based on country codes. The original API results contain country code as well, so it works with some minor corrections needed. Certain country codes from the TMDB API don't match the ones in countryflags api, so I created an additional function that corrects these mistakes before sending the API request to countryflags: flagID.
The third milestone requires adding the cover/poster for each movie and display their rating in stars.
0.6.3: Added Variable to make sure that the explore page is created only once at the first load of the page
Create the actual Web Layout
- personal-reset.scss
- style.scss
- utilities.scss
- variables.scss
Add Movie Cover and Stars (rating)
- (TODO) Need to implement fix with alternative images
- Added InteractiveCardComponent for each movie/tv series
- Added a rating system for each item
- TOTAL_STARS in data allows to easily switch between 5 and 10 stars by simply modifying one attribute
Dynamically add language flag based on original language
Dynamically retrieve movies and tv series through a search function
npm installnpm run servenpm run buildnpm run lint