Step 1: I've Created a function ('youtube_search') to get the response from the YouTube based on the query we've given. This api uses google-api-client. This youtube_search function will take two parameters namely 'product name' and 'max results' and it will return the response including the details like videoID, Title, Date Posted, Description etc..
Step 2: To serve the Database(MySQL) and requests, I've choosen Django, a MVC(Model View Control) framework developed in Python language.
Project Structure: ->project(in our case 'reviews') - Project Configuration directory contains server configurations, database configurations.
->settings.py - filesystem configuration and database configuration
->urls.py - contains the active urls those are relative with the base url
->wsgi.py - wsgi server file
->web-application directory( in our case 'videoreviews') - Contains files related with our web application.
->migrations(dir) - will contain database migrations for our application.
->admin.py - an interface file to register our database tables, to see them in admin panel of our website.
->urls.py - (optional) to simplify the structure we've created a local urls file for our application.
->models.py - this is the file which holds the schema for the database tables.
->views.py - this is the main controller file for our application, this will serve the requests and this is where we write our total backend functionality.
Step 3: Views.py: ->Here I've created three functions namely 'index', 'SaveResult', 'Delete'.
index - this function will accept the request from the front end and serves the products those we have stored in database. Also accepts new product to add. Whenever we send a new product to this function it will send a request to youtube_search with product_name and max_results. Based on these two parameters it will make a request to YouTube and send the response back to us.
We'll send this response to SaveResults function. Here we'll process this data and save it into our database.
The Delete function is for deleting a perticular review from the ui.