CookPaw is a desktop software application that can serve as a "cooking partner" for its users. CookPaw provides a collection of preloaded articles and recipes with detailed instructions, tools, and ingredients needed for cooking. Users of the application can also add, delete, or modify user-made recipes in the recipe list. Furthermore, users can add, delete, or modify notes of a recipe in the program.
Users who want to use the CookPaw application do not need to authenticate credentials and can use it directly. After logging into the application, users freely explore and use the application.
Python
3.X installedPytest
installed for unit testing. To install, run the following command:
pip install pytest
PyQt5
installed. To install, run the following command:
pip install PyQt5
PIL
installed. To install, run the following command:
pip install pillow
-
Docker, To install, head to https://www.docker.com/products/docker-desktop/.
-
Cloned repository files. To clone, run one the following command:
git clone https://gitlab.informatika.org/rpl-g08/if2250-2023-k02-08-cookpaw.git
git clone [email protected]:rpl-g08/if2250-2023-k02-08-cookpaw.git
If the database cookpaw.db
is not found in /src/database/
, run the following command from the root of repository.
py src/database/db.py
To test if the database is correctly initialized, run unit tests with following command from the root of repository.
pytest test
It is recommended to have a newly initialized database for this test, as modifications might cause false negatives.
This application development use CI/CD with test
stage for testing the application using PyTest. The CI/CD runs on a docker runner implemented for this project. It is recommended to pull the docker image by following the instructions below.
- Build the docker
docker build -t gitlab-runner-rpl-k02-g08 .
- Set the tag of the runner and where to push
docker tag gitlab-runner-rpl-k02-g08:latest jeffreychow19/gitlab-runner-rpl-k02-g08:latest
- Login to docker hub if not yet logged in
docker login
- Push docker image to the docker hub
docker push jeffreychow19/gitlab-runner-rpl-k02-g08:latest
- Create container in docker
docker run -d --name gitlab-runner-rpl-k02-g08 -v /var/run/docker.sock:/var/run/docker.sock jeffreychow19/gitlab-runner-rpl-k02-g08:latest
- Pull the image from docker
docker pull jeffreychow19/gitlab-runner-rpl-k02-g08:latest
- Create container in docker
docker run -d --name gitlab-runner-rpl-k02-g08 -v /var/run/docker.sock:/var/run/docker.sock jeffreychow19/gitlab-runner-rpl-k02-g08:latest
- After setup, navigate to the root of this repository.
- To start the application, run the following:
py src/main.py
On the left side of the screen is a sidebar which contains, from top to bottom, navigation buttons to homepage, recipe collection page, and article collection page. To navigate from the homepage, click on any sidebar buttons, or any cards and buttons on the carousel to navigate to any articles or recipes.
Below is the recipe collection page. The recipe collection page has a filter for preloaded recipes and user-made recipes, and a searchbar to search recipe titles.
Below is the article collection page. The article collection page has a search bar to search article titles.
Below is an example of an article detail page.
Below is an example of a recipe detail page.
Users can input keywords in the search bar to search for article or recipe titles.
To create a recipe, go to the recipe collection page and click the (+)
icon. Next, fill recipe data, choose an image (optional), and click the button at the end of the page to save.
To create a note, visit a recipe and click New Note
. Next, fill in the details, choose an image (optional), and click the button at the end of the page to save.
User can also edit or delete created recipes or note by clicking the dropdown menu on a created recipe or note.
Below is the directory structure of this application's source code. Each file directory in src/
is implemented as Python packages.
├───.gitlab
│ ├───issue_templates
│ └───merge_request_templates
├───img
│ ├───fonts
│ │ └───poppins
│ ├───icons
│ └───images
│ ├───images_article
│ ├───images_notes
│ └───images_recipe
├───doc
├───src
│ ├───controller
│ ├───database
│ ├───models
│ └───ui
│ ├───components
│ │ ├───backbutton
│ │ ├───card
│ │ ├───cardscarousel
│ │ ├───collectionbutton
│ │ ├───dropdown
│ │ ├───forms
│ │ ├───messagebox
│ │ ├───searchbar
│ │ ├───sidebar
│ │ └───textbox
│ └───pages
└───test
Screenshots and person-in-charge of each UI page modules are described here
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
article_id | int(10) | NO | PRI | NULL | auto_increment |
title | text | NO | NULL | ||
content | text | NO | NULL | ||
author | text | NO | NULL | ||
publish_date | date | NO | NULL |
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
recipe_id | int(10) | NO | PRI | NULL | auto_increment |
title | text | NO | NULL | ||
utensils | text | NO | NULL | ||
ingredients | text | NO | NULL | ||
steps | text | NO | NULL | ||
last_modified | text | NO | NULL | ||
author | text | NO | system |
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
note_id | int(10) | NO | PRI | NULL | auto_increment |
title | text | NO | NULL | ||
content | text | YES | NULL | ||
publish_date | date | NO | NULL | ||
recipe_id | int(10) | NO | MUL | NULL | REFERENCES Recipes(recipe_id) and on Delete Cascade |
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
photo_id | int(10) | NO | PRI | NULL | auto_increment |
path | text | NO | NULL |
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
recipe_id | int(10) | NO | PRI | NULL | REFERENCES Recipe(recipe_id) |
photo_id | int(10) | NO | PRI | NULL | REFERENCES Photos(photo_id) |
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
note_id | int(10) | NO | PRI | NULL | REFERENCES Note(note_id) |
photo_id | int(10) | NO | PRI | NULL | REFERENCES Photos(photo_id) |
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
article_id | int(10) | NO | PRI | NULL | REFERENCES Articles(article_id) |
photo_id | int(10) | NO | PRI | NULL | REFERENCES Photos(photo_id) |
NIM | Name | GitHub |
---|---|---|
13521044 | Rachel Gabriela Chen | chaerla |
13521046 | Jeffrey Chow | JeffreyChow19 |
13521074 | Eugene Yap Jin Quan | yuujin-Q |
13521094 | Angela Livia Arumsari | liviaarumsari |
13521100 | Alexander Jason | AJason36 |
NIM | Contributions |
---|---|
13521044 | Home page, database, controller, unittest |
13521046 | Recipe list, article list, CI/CD |
13521074 | Note editor (add/edit) page, testing |
13521094 | Recipe detail page, article detail page |
13521100 | Recipe editor (add/edit) page |