https://github.com/crispengari/cocktailer
🍸🥂is a mobile app designed to help users discover new cocktails and get personalized recommendations based on their preferences. The app provides a seamless experience without requiring user accounts, while ensuring content is suitable for users aged 18 and above.
https://github.com/crispengari/cocktailer
expo flask graphql javascript machine-learning python react-js react-native recommendation-system typescript urql
Last synced: 7 months ago
JSON representation
🍸🥂is a mobile app designed to help users discover new cocktails and get personalized recommendations based on their preferences. The app provides a seamless experience without requiring user accounts, while ensuring content is suitable for users aged 18 and above.
- Host: GitHub
- URL: https://github.com/crispengari/cocktailer
- Owner: CrispenGari
- License: mit
- Created: 2024-09-28T08:51:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-10T08:38:37.000Z (about 1 year ago)
- Last Synced: 2025-03-27T17:02:41.912Z (7 months ago)
- Topics: expo, flask, graphql, javascript, machine-learning, python, react-js, react-native, recommendation-system, typescript, urql
- Language: TypeScript
- Homepage:
- Size: 43.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Cocktailer
`Cocktailer` is a mobile app designed to help users discover new cocktails and get personalized recommendations based on their preferences. The app provides a seamless experience without requiring user accounts, while ensuring content is suitable for users aged 18 and above.
### Framework
The following image shows the framework for the `cocktailer` app.
### Key Features:
1. **Browse Cocktails**: Users can explore a wide variety of cocktails, including classic recipes and modern drinks.
2. **Like Your Favorites**: Users can like their favorite cocktails to help Cocktailer understand their preferences.
3. **Get Recommendations**: Using a machine learning algorithm, the app suggests related cocktails based on the user’s liked drinks.
4. **No Authentication Required**: Cocktailer does not require users to create an account, offering full access to its features immediately.
5. **Age Restriction**: Designed for users aged 18+.
### Screenshots
The basic app preview looks as follows.
#### `android`
#### `ios`
#### `apk`
You can download the `apk` file [here](/apk/cocktailer.apk).
### AI Part of the App
The AI recommendation system is powered by a **machine learning server** that analyzes user interactions with the app. Here's how the system works:
1. **Data Collection**: Each time a user "likes" a cocktail, the server logs that interaction.
2. **Model**: The machine learning model on the server processes the user’s cocktail preferences and finds patterns in the type of cocktails the user tends to like.
3. **Recommendations**: The model suggests new cocktails based on the top-liked one, ensuring a personalized experience for every user.
The machine learning server is hosted separately and communicates with the app to deliver these recommendations in real-time. The server base url is: https://cocktailer.onrender.com/graphql
### Stack and Algorithm:
- **Framework**: Flask for server-side logic.
- **Model**: A content-based recommendation system using cosine similarity to match liked cocktails with others in the dataset.
- **Data**: A file database of various cocktails, including ingredients, categories, and preparation methods.
### Cocktailer App - Backend and Frontend Integration
#### GraphQL-Flask Server
The **Cocktailer** app uses a **Flask** backend, serving a **GraphQL API** to handle data interactions efficiently. This architecture allows flexible querying and mutation operations, making it easier to retrieve or modify specific data such as cocktail details, likes, and personalized recommendations.
#### Key Components:
1. **Flask**: A lightweight Python web framework used to serve the GraphQL API.
2. **GraphQL**: A powerful query language that allows the app to request only the data it needs.
3. **Graphene**: A Python library that simplifies the creation of GraphQL APIs in Flask.
4. **Machine Learning Integration**: The Flask server hosts the machine learning model, which processes user preferences to suggest cocktails based on their liked ones.
#### API Functionality:
- **Queries**: Users can query for a list of cocktails, details of specific cocktails, and their liked status.
- **Mutations**: Users can like/unlike a cocktail, which updates the server with their preferences.
- **Machine Learning**: Personalized recommendations are generated based on the user's liked cocktails, providing tailored suggestions using content-based filtering.
#### Benefits:
- **Efficiency**: GraphQL enables the client to fetch only the data required, reducing the amount of unnecessary information transferred between the server and the app.
- **Scalability**: The Flask-GraphQL setup can easily be expanded to include more features such as user data, additional drink categories, or recommendation models.
#### Frontend Integration with [`urql`](https://commerce.nearform.com/open-source/urql/) and [`graphql.tada`](https://gql-tada.0no.co/)
The **Cocktailer** app frontend uses **[`urql`](https://commerce.nearform.com/open-source/urql/)** and **[`graphql.tada`](https://gql-tada.0no.co/)** to interact with the GraphQL API hosted on the Flask server. These tools simplify sending queries and mutations from the frontend to the backend, making the data flow seamless.
#### Key Components:
1. **[`urql`](https://commerce.nearform.com/open-source/urql/)**: A lightweight GraphQL client for handling queries and mutations between the app and the server. It allows efficient data fetching, caching, and subscription to updates.
2. **[`graphql.tada`](https://gql-tada.0no.co/)**: A library that helps in parsing and writing GraphQL queries on the frontend, ensuring smooth communication with the server.
#### How It Works:
- **[`urql`](https://commerce.nearform.com/open-source/urql/)** connects to the Flask-based GraphQL server and sends queries for retrieving data such as the cocktail list, cocktail details, and user preferences.
- **[`graphql.tada`](https://gql-tada.0no.co/)** is used to define queries and mutations in the frontend, such as fetching cocktail data or liking/unliking a cocktail.
- When a user interacts with the app (e.g., liking a cocktail), a **mutation** is sent to the Flask server to update the backend with their preferences.
- The **recommendation system** triggers when fetching personalized cocktail suggestions, which are based on the user’s liked drinks.
#### Benefits:
- **Real-time updates**: [`urql`](https://commerce.nearform.com/open-source/urql/) facilitates efficient data fetching and cache management, ensuring the app gets fresh data when required.
- **Modular design**: Both [`urql`](https://commerce.nearform.com/open-source/urql/) and [`graphql.tada`](https://gql-tada.0no.co/) are lightweight and easy to integrate, making the frontend more maintainable and scalable.
### Notebooks
You can access the notebook for the recommendation algorithm at [01_COCKTAIL_RECOMMANTIONS.ipynb](https://github.com/CrispenGari/recommentation-algorithms/blob/main/00_ML/02_COCKTAIL_RECOMMANTIONS/01_COCKTAIL_RECOMMANTIONS.ipynb)
### License
`Cocktailer` is licensed under the **MIT License**. See the full license below:
```
MIT License
Copyright (c) 2024 crispengari
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```