Wine-Review Application

Table of Contents
Project Description
This conceptual wine review application is designed solely for demonstration purposes. While it is not intended for practical use, you are welcome to explore the Frontend and APIs. The project showcases skills in:
- Python Flask Restx
- Basic HTML and CSS
- SQLite3 database Operations
I began by converting a JSON dataset from Kaggle into an SQLite database. This database contains approximately 130K wines from all around the world.
You can see wine details such as:
- Country
- Description
- Designation
- Points/Score
- Price in USD
- Province
- Region
- Tester name
Using Flask Restx, I created APIs that execute SQL operations to the database and return the results to the client.
Application Architecture
Client access to wine.mteke.com
is routed through Cloudflare, which provides DDoS protection and bot mitigation. The application server runs on a Heroku PaaS Dyno(LXC) container.
Both client-to-Cloudflare and Cloudflare-to-application server connections are secured with SSL. The application server has an SSL certificate, and wine-review-application-XXXXX.herokuapp.com
is accessible only via Cloudflare. IP whitelisting ensures that only Cloudflare IP addresses can access the application server, so all clients can only reach the application server via Cloudflare.
Heroku is connected to GitHub, and any code changes in GitHub automatically trigger a build in the Heroku LXC container.
Application FrontEnd
API Documentation:
You can test the APIs using the button below. Only the GET /wine/{title}
method is enabled; the other methods have been intentionally disabled to protect the application's database content.
This application does not only provide a web-based GUI but also offers APIs for integration with your own application.
Credentials:
Username | user_readonly |
---|---|
Password | password_readonly |
API Access via Python Request Library
To test the API using the Python requests
library:
import requests
from requests.auth import HTTPBasicAuth
from pprint import pprint
# Define the API endpoint and the wine title you want to search for
api_url = "https://wine.mteke.com/wine/{title}"
wine_title = "Kayra 2007 Buzbag Rezerv Öküzgözü Bogazkere Re" # Replace with the actual wine title
# Define the API credentials
api_username = "user_readonly" # Replace with your actual API username
api_password = "password_readonly" # Replace with your actual API password
# Make the GET request with basic authentication
response = requests.get(api_url.format(title=wine_title), auth=HTTPBasicAuth(api_username, api_password))
# Check if the request was successful
if response.status_code == 200:
# Print the JSON response
pprint(response.json(), indent=4)
else:
pprint(f"Failed to retrieve wine details. Status code: {response.status_code}")
(.venv) mteke1 request_tuto % python main.py
[ { 'country': 'Turkey',
'description': 'This bright, brambly red blend of two Turkish grapes, '
'the Öküzgözü and the Bogazkere, is brisk and bold on '
"the palate with a striking red cherry acidity. It's "
'delicate in fruit profile, but lushly textured with '
'layers of fine, chalky tannins that penetrate deeply '
'on the finish.',
'designation': 'Buzbag Rezerv Öküzgözü Bogazkere',
'points': '86',
'price': 25.0,
'province': 'Elazığ-Diyarbakir',
'region_1': None,
'region_2': None,
'taster_name': 'Anna Lee C. Iijima',
'taster_twitter_handle': None,
'title': 'Kayra 2007 Buzbag Rezerv Öküzgözü Bogazkere Red '
'(Elazığ-Diyarbakir)',
'variety': 'Red Blend',
'winery': 'Kayra'}]
(.venv) mteke1 request_tuto %