Git Product home page Git Product logo

ci_pp4_whatscooking's Introduction

What's Cooking?

(Developer: Vilayat Kleer)

mockup-image.jpg

View the live website

Table of Contents

  1. Project Goals
    1. User Goals
    2. Application Owner Goals
  2. User Experience
    1. Target Audience
    2. User Requirements and Expectations
  3. User Stories
    1. User
    2. Returning User
    3. Application Owner
  4. Design
    1. Colours
    2. Fonts
    3. Structure
  5. Technical Design
    1. Database
      1. Database Models
  6. Technologies Used
    1. Languages
    2. Framework
    3. Tools & Libraries
  7. Features
  8. Validation
    1. HTML Validation
    2. Css Validation
    3. JavaScript Validation
    4. Python Validation
    5. Accessibility Wave WebAIM
    6. Performance Google Lighthouse
  9. Testing
    1. Manual Testing - User Stories
    2. Automated Testing
  10. Bugs
  11. Deployment
    1. GitHub
    2. Heroku
    3. Google SMTP Server
  12. Credits
    1. Images
    2. Code
  13. Acknowledgements

Project Goals

User Goals

  • Be able to create meal plans to become a better meal-prepper
  • Be able to edit or delete my meal plans at any given time
  • Have an overview of all my meal plans for a set week
  • Get inspired by finding new recipes

Application Owner Goals

  • Create an application that helps users track and prep their meals
  • Provide users with a database full of recipes for them to choose and get inspired by
  • Provide feedback to users on any important action (CRUD, log in, log out etc.)
  • Deliver an aesthetically pleasing design to the application that makes users want to come back

User Experience

Target Audience

  • People who want to keep track of their daily meals
  • Meal preppers who want an organised space for their meal plans
  • Cooking enthusiasts who want to get inspired by new recipes without looking on multiple websites

User Requirements and Expectations

  • A simple, elegant application that anyone can use
  • Clear feedback provided after performing an important action
  • Providing a personal touch by referring to the users' username and first name throughout the application

User Stories

Anonymous User

  1. As an anonymous user, I want to be able to view the home page, so I know what the application is about
  2. As an anonymous user, I want to be able to view the recipe list, so I get a taste of what the application has to offer
  3. As an anonymous user, I want to be able to create an account, so I can start using the application

Registered User

  1. As a registered user, I want to be able to log in with my account
  2. As a registered user, I want to be able to create a meal plan for a specific date
  3. As a registered user, I want to be able to add meals to a meal plan
  4. As a registered user, I want to be able to edit any of my meal plans
  5. As a registered user, I want to be able to delete any of my meal plans
  6. As a registered user, I want to have a weekly overview of my meal plans in my meal planner
  7. As a registered user, I want to be able to pick the first day of the week of my weekly overview
  8. As an registered user, I want to be able to view the recipe list
  9. As a registered user, I want to be able to view the details of each recipe in the recipe list
  10. As a registered user, I want to be able to view my account details on my profile page
  11. As a registered user, I want to be able to delete my account on my profile page
  12. As a registered user, I want to be able to log out when I'm done
  13. As a registered user, I want to receive feedback after performing an important action

Application Owner

  1. As the application owner, I want users to be able to filter recipes by meal type, diet type or by using the search bar
  2. As the application owner, I want to restrict most of the applications' functionality for anonymous users to encourage them to create an account
  3. As the application owner, I want users to stay on the application when they receive an HTTP response of 400, 403, 404 or 500
  4. As the application owner, I want users to be able to contact me with a contact form
  5. As the application owner, I want users to be able to find me on GitHub
  6. As the application owner, I want the users' input on forms to be validated
  7. As the application owner, I want users to be able to navigate around the application easily
  8. As the application owner, I want to provide a responsive application for all devices

Design

Colours

The colours I used for the application have been picked using the Adobe Color Wheel. I first found a 'main' colour that I wanted to use (#407464, used in the bg-main class) before moving on to the other colours. The 'Split Complementary' colour harmony rule suggested a dark pink colour, which I took and customized to a soft grey-pink colour (#f5e4e4, used in the bg-accent class) to make it easier to look at and use in the application. Finally, I simply took the main colour and made it a few shades darker to use for the navbar and footer (#2e4b42, used in the bg-main-dark class).

Screenshot of Adobe Color Wheel

Fonts

The fonts that I used are Reem Kufi Fun for the logo, Montserrat for all the headings and Quicksand for all other text elements. They are all sans-serif fonts, but have a few distinct differences: The Montserrat font creates a nice contrast with the other text elements by having a simple design and bold font-weight, while the Quicksand font is more playful, yet legible. The Reem Kufi Fun font stands out from the other fonts with its unique 'W', which is why I found it to be suitable for the logo. All fonts have sans-serif as a fallback.

Structure

The application uses common web design conventions and is structured in an intuitive, easy to use way. Each page has a header and subtitle to clearly state its purpose and colour is used sparsly to increase both readability and keep the design clean.

The navigation bar has a logo on the left and the links to the right. When the screen size is too small to display the links, the menu turns into a collapsable menu with the familiar 'hamburger' icon.

The footer is at the bottom of the page and contains links to my Github page and a contact form.

The application contains the following pages:

  • The index page with an introduction to the application and a brief overview of its features
  • The sign up page where new users can create an account
  • The log in page where users can log in to the application
  • The log out page where logged in users can log out of the application
  • The meal planner page where:
    • Logged in users will see a weekly overview of their meal plans
    • The date of the first day can be picked to generate a new weekly schedule
    • New meal plans can be created by clicking on the '+' button to take users to the 'Add meal plan' page
    • Existing meal plans can be edited by clicking on the pen button to take users to the 'Edit meal plan' page
    • Existing meal plans can be deleted by clicking on the bin button, triggering a modal for confirmation, after which the meal plan will be deleted
  • The create meal plan page where logged in users can create a new meal plan for the selected date, allowing up to 10 meals per meal plan
  • The edit meal plan page where logged in users can edit an existing meal plan by changing or deleting meals from the plan
  • The recipe list page where users can browse all recipes
    • Users can filter by meal type (breakfast, lunch, dinner, snack), diet type (vegetarian, vegan) or simply use the search bar
  • The recipe page where logged in users can find the recipe ingredients and instructions and a picture of the finished meal
  • The profile page where logged in users can find their username, first name, email address, creation date and a 'Delete account' button if they wish to have their profile delete
    • The 'Delete account' button triggers a modal for confirmation, after which the users' account and all its associated data will be deleted
  • The contact page where users can contact me to leave feedback, report bugs, or simply send a message
    • Logged in users will have the 'Name' and 'E-mail address' fields pre-populated with their data and cannot be edited
  • The 400, 403, 404 and 500 pages to handle HTTP responses and keep users inside the application flow

Technical Design

Database

The backend of the application is built with Python and the Django framework, with a PostgreSQL database attached via Heroku. The models in the meal and mealplanner app are used to create the entire database along with the models from Allauth.

Screenshot of database diagram

Database models

User model

The User model comes from the Allauth library and contains information about the user.

Calendar model

The Calendar model is used to create the weekly overview on the meal_planner page. It contains the following fields:

  • user
    • contains User as a foreign key
  • picked_date
  • day_one
  • day_two
  • day_three
  • day_four
  • day_five
  • day_six
  • day_seven

MealPlanner model

The MealPlanner model is used to save each users' meal plans. It contains the following fields:

  • user
    • contains User as a foreign key
  • meal_plans
    • contains MealPlan as a many to many field

MealPlan model

The MealPlan model is used to save and contain all the meals that have been added to it. It contains the following fields:

  • meal_planner
    • contains MealPlanner as a foreign key
  • date
  • meal
    • contains Meal as a many to many field through MealToMealPlan

MealToMealPlan model

Is used as an intermediate model between the MealPlan and Meal models. It contains the following fields:

  • meal
    • contains Meal as a foreign key
  • meal_plan
    • contains MealPlan as a foreign key

Meal model

Arguably the most important model as the whole application revolves around it. It is used to populate the meal plans, recipe list and recipe pages. It contains the following fields:

  • name
  • image
  • description
  • ingredients contains Ingredient as a many to many field through IngredientToRecipe
  • type
    • contains MealType as a foreign key
  • diet
    • contains Diet as a foreign key
  • prep_time
    • contains PrepTime as a foreign key
  • cook_time
    • contains CookTime as a foreign key

IngredientToRecipe model

Is used as an intermediary model between the Meal and Ingredient models. The reason it is called 'IngredientToRecipe' and not 'IngredientToMeal' is because the ingredients are only used on the recipe page. Contains the following fields:

  • ingredient
    • contains Ingredient as a foreign key
  • meal
    • contains Meal as a foreign key
  • amount

Ingredient model

Is used to hold the ingredients that are used on the recipe pages. Contains the following field:

  • ingredient

MealType model

Is used to set the meal type of each meal. Contains the following field:

  • type

Diet model

Is used to set the diet type of each meal. Contains the following field:

  • diet

PrepTime model

Is used to set the prep time for each meal. Contains the following field:

  • prep_time

CookTime model

Is used to set the cook time for each meal. Contains the following field:

  • cook_time

Wireframes

Home
Login
Logout
Create account
Profile
Meal planner
Create meal plan
Edit meal plan
Delete meal plan
Recipe list
Recipe
Contact

Technologies Used

Languages

Framework

Tools & Libraries

Features

The website has a total of 15 features:

Logo and navigation bar

  • Font Awesome icon combined with a Google Fonts font is used as the logo, placed on the left as is conventional
  • Is present on every page
  • Is responsive and works on all screen sizes
  • Covers user story 23 and 24
Screenshot of logo and navigation bar

Footer

  • At the bottom of the page as is conventional, using the same colour as the navigation bar for consistency
  • Contains a link to my GitHub account, using a Font Awesome GitHub icon
  • Contains a link to the contact page, using a matching Font Awesome icon
  • Is present on every page
  • Covers user story 21 and 24
Screenshot of footer

Flash messages

  • Flash messages are displayed to users when performing any important action, like creating, editing or deleting a meal plan or logging into their account, providing them with meaningful feedback
  • No screenshots provided here - all flash messages can be seen in action under Manual Testing - User Stories
  • Covers user story 16

Home page

  • Introduces users to the application
  • Provides a brief overview of the applications' features
  • Contains call-to-action buttons to the meal planner (if users logged in, otherwise a 'Create account' button is shown), recipe list and contact form
  • Covers user story 1, 18
Screenshots of home page

Create account page

  • Allows new users to create an account
  • Users need to provide their email address, username, first name and a password
  • The email address and username have to be unique
  • All input is validated
  • After their account has been created, Users are automatically logged in and taken to the meal planner page
  • Flash message is displayed after account has been created
  • Covers user story 3, 22 and 16
Screenshot of create account page

Login page

  • Allows returning users to log in to their account
  • Users need to enter their username and password - an empty or semi-empty form cannot be submitted
  • All input is validated
  • Users are taken to the meal planner page after successfully logging in
  • Flash message is displayed after users have logged in
  • Covers user story 4, 22 and 16
Screenshot of login page

Logout page

  • Allows logged in users to log out of their account
  • Flash message is displayed after users have logged out
  • Covers user story 15 and 16
Screenshot of logout page

Profile page

  • Allows users to view their account details, listing their username, first name, email address and creation date
  • Allows users to delete their account should they wish to do so
    • Instead of a separate page, a modal is used to confirm if the user wishes to delete their account
  • Flash message is displayed after users have deleted their account
  • Covers user story 13, 14 and 16
Screenshot of profile page

Meal planner page

  • Provides users with a weekly overview of their meal plans
  • Allows users to pick the first day of their weekly overview, allowing them to look back at past meal plans or plan ahead
  • Provides a link to the 'Add meal plan' page
  • Provides a link to the 'Edit meal plan' page
  • Allows users to delete an existing meal plan
    • Instead of a separate page, a modal is used to confirm if the user wishes to delete a specific meal plan
    • Flash message is displayed after the user has deleted a specific meal plan
  • Covers user story 8, 9, 10 and 16
Screenshot of meal planner page

Create meal plan page

  • Allows users to create a new meal plan for the selected date
  • Allows users to add up to 10 meals
  • Flash message is displayed after a meal plan has been created
  • Covers user story 6 and 16
Screenshots of create meal plan page

Edit meal plan page

  • Allows users to edit their selected, existing meal plan
  • Allows users to delete and add any available meal, limited to a maximum of 10 meals
  • Flash message is displayed after a meal plan had been updated
  • Covers user story 7 and 16
Screenshots of edit meal plan page

Recipe list page

  • Allows both anonymous and registered users to browse all available recipes
  • Provides a link to the recipes' page, which only registered, logged in users can access
  • Covers user story 2, 11, 16 18
Screenshot of recipe list page

Recipe page

  • Contains the recipes' name preparation time, cooking time, meal type, diet type and image in the header
  • Contains the recipes' ingredient list
  • Contains the recipes' preparation instructions
  • Provides a button to take users back to the recipe list
  • Covers user story 12
Screenshot of recipe page

Recipe list filter

  • Allows both anonymous and registered users to filter all available recipes
  • Users can filter by meal type (breakfast, lunch, dinner and snack)
  • Users can filter by diet type (vegetarian, vegan)
  • Users can filter by using the search bar
  • Users can combine the meal type, diet type and search bar filters
  • Covers user story 17
Screenshot of recipe list filter

Contact page

  • Allows both anonymous and registered, logged in users to send me a message via a contact form
  • The contact form contains a name, email address and message field, all of which are required
  • If a registered user is logged in, their name and email address are automatically added to the corresponding fields - the fields cannot be edited
  • Flash message is displayed after the form has been successfully submitted
  • Covers user story 20, 22 and 16
Screenshots of contact page

Custom HTTP response pages (400, 403, 404 and 500)

  • Keeps users in the application flow if they encounter an error by displaying a custom HTTP response page
  • Contains a button that takes users back to the home page
  • Covers user story 19
Screenshot of custom HTTP response page 404

Validation

HTML Validation

The HTML of the application has been validated using W3C's Markup Validation Service. all of the pages pass with no errors or warnings.

Screenshot of base template HTML validation
Screenshot of index HTML validation
Screenshot of login HTML validation
Screenshot of logout HTML validation
Screenshot of create account HTML validation
Screenshot of profile HTML validation
Screenshot of meal planner page validation
Screenshot of create meal plan HTML validation
Screenshot of edit meal plan HTML validation
Screenshot of recipe list HTML validation
Screenshot of recipe HTML validation
Screenshot of contact HTML validation

CSS Validation

The CSS of the application has been validated using W3C's CSS Validation Service. It passed with no errors or warnings.

Screenshot of CSS validation

JavaScript Validation

The JavaScript of the application has been validated using JSHint. It passed with no errors or warnings.

Screenshot of meal-planner.js JSHint validation
Screenshot of meal-search.js JSHint validation
Screenshot of message-dismissal.js JSHint validation

Python Validation

The Python code has been validated using Pep8 Validation Service - no errors or warnings were found.

Screenshots of home Python files PEP8 Validation
home views
home urls
home forms
Screenshots of meal Python files PEP8 Validation
meal views
meal urls
meal models
meal admin
Screenshots of mealplanner Python files PEP8 Validation
mealplanner views
mealplanner urls
mealplanner forms
mealplanner models
mealplanner admin

Accessibility (Wave WebAIM)

The accessibility of the application has been measured using the Wave WebAIM web accessibility evaluation tool - all pages pass without errors.

Screenshot of index page accessibility evaluation
Screenshot of login page accessibility evaluation
Screenshot of logout page accessibility evaluation
Screenshot of index page accessibility evaluation
Screenshot of create account page accessibility evaluation
Screenshot of profile page accessibility evaluation
Screenshot of meal planner page accessibility evaluation
Screenshot of create meal plan page accessibility evaluation
Screenshot of edit meal plan page accessibility evaluation
Screenshot of recipe list page accessibility evaluation
Screenshot of recipe page accessibility evaluation
Screenshot of contact page accessibility evaluation

Performance (Google Lighthouse)

The performance of the application has been measured with Google Lighthouse with either a perfect or near perfect score on each page.

Screenshot of index page Lighthouse performance
Screenshot of login page Lighthouse performance
Screenshot of logout page Lighthouse performance
Screenshot of create account page Lighthouse performance
Screenshot of profile page Lighthouse performance
Screenshot of meal planner page Lighthouse performance
Screenshot of create meal plan page Lighthouse performance
Screenshot of edit meal plan page Lighthouse performance
Screenshot of recipe list page Lighthouse performance
Screenshot of recipe page Lighthouse performance
Screenshot of contact page Lighthouse performance

Testing

Manual Testing - User Stories

  1. As an anonymous user, I want to be able to view the home page, so I know what the application is about
Feature Action Expected Result Actual Result
Home page Go to the deployed application Be informed about the applications' purpose and features Works as expected
Supporting Screenshots - User Story 1
  1. As an anonymous user, I want to be able to view the recipe list, so I get a taste of what the application has to offer
Feature Action Expected Result Actual Result
Recipe list page Click on the 'Recipe list' link in the navbar Be able to view the recipe list despite not having an account or being logged in Works as expected
Supporting Screenshots - User Story 2
  1. As an anonymous user, I want to be able to create an account, so I can start using the application
Feature Action Expected Result Actual Result
Create account page Click on the 'Register' link in the navbar, the 'Create account' button on the homepage or the 'Create account' button on the recipe list page Be able to create an account Works as expected
Supporting Screenshots - User Story 3
  1. As a registered user, I want to be able to log in with my account
Feature Action Expected Result Actual Result
Login page Click on the 'Log in' link in the navbar Be able to log in to my account Works as expected
Supporting Screenshots - User Story 4
  1. As a registered user, I want to be able to create a meal plan for a specific date
Feature Action Expected Result Actual Result
Meal planner page, add meal plan page Click on the 'Meal planner' link in the navbar, then click any of the '+' buttons to create a meal plan for that date Be able to create a meal plan Works as expected
Supporting Screenshots - User Story 5
  1. As a registered user, I want to be able to add meals to a meal plan
Feature Action Expected Result Actual Result
Meal planner page, add meal plan page Click on the 'Meal planner' link in the navbar, then click any of the '+' buttons to create a meal plan for that date, add meals to the meal plan Be able to add meals to a meal plan Works as expected
Supporting Screenshots - User Story 6
  1. As a registered user, I want to be able to edit any of my meal plans
Feature Action Expected Result Actual Result
Meal planner page, edit meal plan page Click on the 'Meal planner' link in the navbar, then click on the pen button of the meal plan you want to edit Be able to edit a meal plan Works as expected
Supporting Screenshots - User Story 7
  1. As a registered user, I want to be able to delete any of my meal plans
Feature Action Expected Result Actual Result
Meal planner page Click on the 'Meal planner' link in the navbar, then click any on the trash button of the meal plan you want to delete Be able to delete a meal plan Works as expected
Supporting Screenshots - User Story 8
  1. As a registered user, I want to have a weekly overview of my meal plans in my meal planner
Feature Action Expected Result Actual Result
Meal planner page Click on the 'Meal planner' link in the navbar, then look at the weekly overview Be able to see a weekly overview of meal plans Works as expected
Supporting Screenshots - User Story 9
  1. As a registered user, I want to be able to pick the first day of the week of my weekly overview
Feature Action Expected Result Actual Result
Meal planner page Click on the 'Meal planner' link in the navbar, then click on the calendar icon under 'Pick a date for day 1:', select a day, then click on the 'Pick day' button Be able to see a new weekly overview, starting from the day I picked Works as expected
Supporting Screenshots - User Story 10
  1. As an registered user, I want to be able to view the recipe list
Feature Action Expected Result Actual Result
Recipe list page Click on the 'Recipe list' link in the navbar Be able to view the recipe list Works as expected
Supporting Screenshots - User Story 11
  1. As a registered user, I want to be able to view the details of each recipe in the recipe list
Feature Action Expected Result Actual Result
Recipe list page, recipe page Click on the 'Recipe list' link in the navbar, then click on any of the recipes in the list Be able to view the details of a recipe I clicked on Works as expected
Supporting Screenshots - User Story 12
  1. As a registered user, I want to be able to view my account details on my profile page
Feature Action Expected Result Actual Result
Profile page Click on your username in the navbar to open a dropdown menu, click on the 'Profile' link Be able to view my account details Works as expected
Supporting Screenshots - User Story 13
  1. As a registered user, I want to be able to delete my account on my profile page
Feature Action Expected Result Actual Result
Profile page Click on your username in the navbar to open a dropdown menu, click on the 'Profile' link, then click on the 'Delete account button, confirm in the modal that you want to delete your account by clicking on the 'Yes, delete my account' button Be able to delete my account Works as expected
Supporting Screenshots - User Story 14
  1. As a registered user, I want to be able to log out when I'm done
Feature Action Expected Result Actual Result
Logout page Click on your username in the navbar to open a dropdown menu, click on the 'Log out' link Be able to log out of my account Works as expected
Supporting Screenshots - User Story 15
  1. As a registered user, I want to receive feedback after performing an important action
Feature Action Expected Result Actual Result
Home page, login page, log out page, contact page, meal planner page, create meal page, edit meal page Perform an important action, like logging in or out, creating a new meal plan etc. Have a flash message displayed Works as expected, as can be seen on each individual feature - the feedback message is highlighted in the screenshots
  1. As the application owner, I want users to be able to filter recipes by meal type, diet type or by using the search bar
Feature Action Expected Result Actual Result
Recipe list page Click on the checkboxes underneath 'Meal type', select an option underneath 'Diet type, use the search bar to find a recipe, or combine them Be able to gilter recipes Works as expected
Supporting Screenshots - User Story 17
  1. As the application owner, I want to restrict most of the applications' functionality for anonymous users to encourage them to create an account
Feature Action Expected Result Actual Result
Meal planner page, recipe page Look at the navbar or try to open a recipe when not logged in Have no meal planner option and be unable to open a recipe - will redirect to the login page Works as expected
Supporting Screenshots - User Story 18
  1. As the application owner, I want users to stay on the application when they receive an HTTP response of 400, 403, 404 or 500
Feature Action Expected Result Actual Result
Custom HTTP response page 404 Enter a non-existing page name at the end of the apps' url Have a custom 404 error page be displayed Works as expected
Supporting Screenshots - User Story 19
  1. As the application owner, I want users to be able to contact me with a contact form
Feature Action Expected Result Actual Result
Home page, footer, contact page Scroll down on the home page and click on the 'Contact us' button or scroll down on any page and click the envelope icon in the footer Be able to submit a contact form Works as expected
Supporting Screenshots - User Story 20
  1. As the application owner, I want users to be able to find me on GitHub
Feature Action Expected Result Actual Result
Footer Scroll down on any page and click the GitHub icon in the footer Open a new tab to my GitHub page Works as expected
Supporting Screenshots - User Story 21
  1. As the application owner, I want the users' input on forms to be validated
Feature Action Expected Result Actual Result
Login page, logout page, create account page, contact page Try to submit form without filling out the required fields or enter invalid data, like a partial email address Have a warning message display and be unable to submit the form Works as expected
Supporting Screenshots - User Story 22
  1. As the application owner, I want users to be able to navigate around the application easily
Feature Action Expected Result Actual Result
Any page Click on the corresponding link in the navbar, or the corresponding buttons on a parent page Be taken to the correct page Works as expected, as can be seen in all of the feature screenshots
  1. As the application owner, I want to provide a responsive application for all devices
Feature Action Expected Result Actual Result
The whole application Resize any page Have the page be formatted correctly for any device Works as expected
Supporting Screenshots - User Story 24

Automated Testing

Some automated testing was carried out with by using Pythons' built-in unittest library. The screenshots that I added below are from the reports that were created by using coverage.

Screenshot of home app coverage report
Screenshot of mealplanner app coverage report
Screenshot of meal app coverage report

Bugs

Bug Fix
Contact form too big when logged in, styling not consistent Change column size of name field from md-6 to md-12 to take up the whole column, add input tag to styling rule - link to commit
Icons in footer too small Change styling rule to specifically target anchor elements inside the list that holds them - link to commit
Bootstrap modal stopped working after upgrading to Bootstrap 5 Change data attributes to data-bs attributes - link to commit
Footer not at the bottom of the page if content doesn't push it down Set body height to 100vh, display to flex and flex direction to column. Then set the footers' margin-top to auto - link to commit
Footer not at the bottom of the page if content doesn't push it down Set body height to 100vh, display to flex and flex direction to column. Then set the footers' margin-top to auto - link to commit
Scripts not working properly Accidentally had scripts outside of body tag, moved them inside - link to commit
CreateMealPlan view doesn't grab the correct meal planner when creating a meal plan Used the wrong user attribute, change from user.username to user.id - link to commit
Diet filter not working anymore Accidentally deleted span that is used to target the right recipes, add it back in - link to commit
Meal plans can no longer be created Crispy forms required a different set up to work properly with my form and formset, added proper formartting to make it work again - link to commit

Deployment

GitHub

This website was deployed using Github Pages with the following steps:

  1. Go to your Github Repository
  2. Navigate to the 'Settings' page
  3. On the left hand menu under 'Code and automationo', click on 'Pages'
  4. Under 'Source', click on the 'Branch' dropdown element and set it to your main branch (in my case, this branch is called 'main')
  5. Click on 'Save'
  6. Refresh the page and you will be provided with a link to your deployed Github Page.

If you want to fork this repository, follow these steps:

  1. Go to the Github repository (https://github.com/vkleer/CI_PP4_WhatsCooking)
  2. Click on the 'Fork' button in the top right corner under the navigation bar

If you want to clone this repository, follow these steps:

  1. Go to the Github repository (https://github.com/vkleer/CI_PP4_WhatsCooking)
  2. Click on the 'Code' button above the list of files
  3. Select your preferred way of cloning, I recommend using the 'GitHub CLI' option
  4. Under 'GitHub CLI', click on the copy button to copy the clone command
  5. In you IDE, open Git Bash
  6. Navigate to the working directory where you want to clone this directory
  7. Paste in the clone command you copied and press the 'enter' key to create the clone

Heroku

This application has been deployed using Heroku with the following steps:

  1. Login to Heroku
  2. Go to your Heroku dashboard
  3. In the top-right corner, click on the 'New' button, followed by the 'Create a new app' button
  4. Enter an app name (it has to be unique) and choose your region under the 'Choose a region' dropdown menu.
  5. Click on the 'Create app' button
  6. On the next page, click on the 'Settings' tab
  7. Under 'Config Vars', click on 'Reveal Config Vars' to add a new Config var - this is where you can store sensitive data, like your Google service account key
  8. Under 'Buildpacks' click on the 'Add buildpack' button to install additional dependencies. For this project the 'python' and 'nodejs' buildpacks were added, in that specific order
  9. Click on the 'Deploy' tab
  10. Under 'Deployment method', click on 'Github'. You can then search for your repository under 'Search for a repository to connect to'
  11. Click on the 'Connect' button to connect your repository
  12. On the next page, under 'Choose a branch to deploy' you can choose the branch you want to deploy your app from
  13. Either click on the 'Enable Automatic Deploys' button under 'Automatic deploys' to have the app deploy automatically on each push you make to the branch, or click on the 'Deploy Branch' button under 'Manual deploy'
  14. Wait for the app to build and be deployed. Once the app is ready, a message will be displayed saying 'App was successfully deployed' along with a button which takes you to your newly deployed app

Google SMTP Server

To send emails from your website using Google's SMTP server, the following steps are required:

  1. Preferable, create a new Gmail account
  2. Following the instructions in this link, enable the less secure apps feature
  3. Under your settings.py, add the following settings:
    • EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’
    • EMAIL_HOST = ‘smtp.gmail.com’
    • EMAIL_USE_TLS = True
    • EMAIL_PORT = 587
    • EMAIL_HOST_USER = ‘[email protected]’ (I set this up in my env.py file and grab the variables using os.environ.get)
    • EMAIL_HOST_PASSWORD = ‘your account’s password’(Again, this is set up in my env.py file and the variables are grabbed using os.environ.get)
  4. On Heroku, under settings, add two new Config Vars: EMAIL_HOST_USER and EMAIL_HOST_PASSWORD, using the same email address and password

Credits

Images

  • All images and the recipes themselves were found on BBC Food

Code

  • I wasn't quite sure how to structure my ingredients model, but this post from Stackoverflow helped me figure it out
  • My ManyToMany fields weren't showing up on my admin panel, this post from Stackoverflow was very helpful
  • I wanted to add extra fields to my sign up form, which I was able to do thanks to this post from Stackoverflow
  • I was struggling to get next and previous days for my calendar, but this article helped me figure it out
  • I wanted to set the intial field values of some forms to something specific, but didn't know how - [this post from Stackoverflow] was very helpful
  • Though I had looked at project examples, I didn't quite understand how inline formsets worked - this video on YouTube was really a life saver
  • I wanted to disable some of my form fields by default, that was possible thanks to this post on Stackoverflow
  • I wanted anonymous users to be able to browse the recipe list, but not be able to open the actual recipe page. Luckily I found out that you can add a login decorator, thanks to this post from Stackoverflow
  • To set up the contact form, I looked at some other users' projects and browsed the web for a good solution - in the end I decided to use Google SMTP, which was help set up thanks to this article on Medium

Acknowledgements

I would like to thank:

  • My mentor Mo Shami for providing me with advice and guidance for this project
  • My partner Lauren Baker for helping me with testing and finding multiple bugs in the program

ci_pp4_whatscooking's People

Contributors

vkleer avatar

Watchers

 avatar

ci_pp4_whatscooking's Issues

User Story: User profile

As a user I can view my profile page so that I can see details about my account

  • Navigation bar should have a 'my profile' or similar option
  • Should display username, user email (if applicable) and user creation date

User Story: Home page

As a user I can visit the home page so that I can get a clear idea what the website/app is about

  • Should clearly state what the user can expect from 'What's Cooking?'
  • Should encourage new users to create an account

User Story: Update meal plan

As a user I can change the meals in my meal plan so that I can update my meal plan whenever I want

  • Should allow user to pick a different meal for an already chosen meal
  • Should allow user to delete a meal from their meal plan

User Story: Delete meal plan

As a user I can delete a specific meal plan so that I can start from scratch if I want to

  • User can only delete their own meal plans and have to be logged in to do so
  • Should ask for confirmation before deleting all meals for that current day
  • Should provide feedback to the user that the meal plan has been deleted

User Story: Account deletion

As a user I can delete my account so that I can have my details removed from the database if I choose to stop using the application

  • Should be on the users' profile page
  • Should ask for confirmation before deleting account
  • Should provide a notification/message to inform the user their account has been succesfully deleted

User Story: Recipe search filter

As a user I can filter the list of recipes so that I can easily find a recipe that suits my requirements

  • Should contain multiple filters to narrow list down to users' diet and meal type
  • Should contain a search field so the user can search for meal names

User Story: Footer

As a user I can find the developer's social media links so that I can find other projects

  • Should contain link to my Github
  • Should match the overall design

User Story: List of meals

As a user I can view a list of meals so that I can find new meals to add to my meal planner

  • The list of meals should not all be displayed at once to keep the page organised
  • Each meal should have a picture of the end result, a name, meal type, diet type, prep and cooking time
  • There should be an easy way to open the meals details page

User Story: Log out

As a user I can log out so that I can safely share my computer

  • Users should be able to log out from any page through a link
  • Users will receive confirmation modal/message to confirm they want to log out
  • User will receive a notification/message when logged out succesfully

User Story: User registration

As a user I can create an account so that I can can start using the application

  • Users should be able to register from any page through a link
  • Users that have succesfully registered will receive a notification/message
  • Users will be automatically logged in

User Story: Calendar for meal planner

As a user I can pick a date in my meal planner (calendar) so that I can plan my meals

  • Every user has one calendar that they can plan their meals in
  • The day the user picks will be displayed
  • Should allow the user to grab any day, also future ones

User Story: Navigation bar/menu

As a user I can use that navigation bar so that I can navigate to different parts of the application

  • Should contain links to every page/app
  • Should match the overall design
  • Should contain login and logout links
  • Should contain the users' username to indicate they're logged in

User Story: Meal pagination

As a user I can see a paginated list of meals so that I can pick a meal without being overwhelmer with too many options

  • The maximum amount of meals to be displayed per page should be 8
  • Controls to go to the next or previous page will be at the bottom

User Story: Create meal plan

As a user I can create a meal plan so that I can start planning my meals

  • Every user should be able to create a meal plan for any day they pick
  • There can only exist one mealplan per date, per user

User Story: Contact form

As the owner I want users to submit a contact form so that they can contact me for a bug report or provide feedback

  • The form should pre-populate the 'name' and 'email' fields based on the user object
    • If there is no logged in user, the 'name' and 'email' fields become editable
  • User should receive message/notification after submitting the form

User Story: Add meals to meal plan

As a user I am add meals to my meal plan so that I can prep in time

  • Duplicate meals are allowed
  • Amount of meals limited to a maximum of 10

User Story: Recipe page

As a user I can view the details of each recipe so that I can prepare the meal

  • Should contain a list of ingredients
  • Should contain a list of steps to prepare the meal
  • Should contain a button to take the user back to the list of meals

User Story: Update meal plan

As a user I can edit my meal plan so that I can change it if I decide on a different meal

  • User can only edit their own plans and have to be logged in to do so
  • Should allow user to delete a meal from their meal plan
  • Should be able to be updated at any given time, for any amount of time
  • Should provide feedback to the user that the plan has been updated

User Story: Log in

As a registered user I can log in so that I can start using the application

  • Users should be able to log in from any page through a link
  • Users that log in should be taken to their meal planner
  • Users should receive a notification/message about their succesful login

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.