Skip to content

PedroCristo/portfolio_project_4

Repository files navigation

Tasty Blog - Introduction

Project milestone 4 for Code Institute Full-stack development program. This project is a Full Stack website built using the Django framework. Tasty Blog is a recipe book where users can look or search for a recipe to prepare. When the user is logged in they can also like/unlike a post and comment on a post. They can also share their favourite cookbooks by adding a post on the Books Page and upload or update their user image and details.

Live Project Here

Tasty Blog webpage on multiple devices

README Table Content

User Experience - UX

User Stories

  • As a website user, I can:
  1. Navigate around the site and easily view the desired content.
  2. View a list of recipes and choose accordingly.
  3. Search recipes to find specific recipes.
  4. Click on post to read the recipe details.
  5. Register for an account to avail of the services offered to members.
  6. View the number of likes on a recipe thereby showing which is most popular.
  7. View comments on recipes so that I can read other users opinions.
  • As logged in website user, I can:
  1. Like/unlike recipes marking the recipes I enjoyed.
  2. Comment on recipes and give my opinion about the posts.
  3. Delete my previous comments.
  4. Manage my profile by updating my details and user image.
  5. Share my favourites cookbooks by posting them on the Books Page.
  6. Edit my favourite cookbook posted previously.
  7. Delete my favourite cookbook posted previously.
  8. Logout from the website.
  • As a website superuser, I can:
  1. Create and publish a new recipe.
  2. Create draft recipe posts that can be reviewed and finalised later.
  3. Create a new user, recipes, author and categories.
  4. Delete user, recipes, author, categories and comments.
  5. Approve user's comments.
  6. Edit user's favourite cookbook that was posted previously.
  7. Delete user's favourite cookbook that was posted previously.
  8. Change the website permissions for a user.

Agile Methodology

All functionality and development of this project were managed using GitHub which Projects can be found here

The Scope

Main Site Goals

  • To provide users with a good experience when using the food recipes website.
  • To provide users with a visually pleasing website that is intuitive to use and easy to navigate.
  • To provide a website with a clear purpose.
  • To provide role-based permissions that allows user to interact with the website.
  • To provide tools that allow users to search for recipes.

Design

Colours

Colours Palete

  • The colour scheme is kept simple by opting for a combination of white text set against the image background and black text against the white background. For the navbar was set as a white background colour that changes when the user scrolls. For a linear gradient, 3 colours were used dark blue, orange and purple. This gradient is also used as a search box background. To highlight the icons an interactive colour set of light blue was used.

Typography

  • The Lato font is used as the main font for the whole project and the Kaushan font is used to display the word enjoy in the Post Details and About pages.

Imagery

  • All the imagery is related to the recipes and website design. Only 7 images are static. The remaining imagery will be uploaded by the author to the database.

Wireframes

Wireframes for this project can be located here

Database Diagram

Database Diagrama

Features

Home Page

Home Page

  • The hero image welcomes the user with a short message advertising what the website is about. These are 3 carousel images with a button. When the button is pressed, it brings the user down to the highlighted recipes.

Home Page - Highlight Posts

Home Page - Highlight Posts

  • In the highlighted posts, users can see a selection of 6 recipes. These recipes are chosen by the site admin by clicking the featured box in the post database.

About Page

About Page

  • The About Page gives, users information about the Tasty Blog website. It introduces the users to the website. It also details the main purpose and the goal of the blog.

Blog Page

Blog Page

  • On the Blog Page, users have access to the full recipes posts available on the website. The user can choose to see the recipe detail by clicking on the recipe card.

Post Detail Page - Top

Post Detail Page - Top

  • At the top of the Post Details Page, users can see the post's main image and they can also have access to information about the post. The post information includes category, recipe name, rating stars, time to prepare, author name and image, posted date and the option to like/unlike the post. It will also show how many likes and comments the post has received.

Post Detail Page - Steps

Post Detail Page - Steps

  • In this page section, users can read the ingredients and follow the steps to complete the recipe.

Post Detail Page - Comments

Post Detail Page - Comments

  • At the bottom of this page, users can read the comments posted by other users. If the user is logged in or is a superuser they have access to the buttons for deleting or updating comments.

Edit Comments Page

Edit Comments Page

  • On this page, users are allowed to comment, delete and edit their own post comments. The website superuser can delete or update any comments on the blog without having to access the admin panel.

Contact Page

Contact Page

  • The Contact Page allows users to have access to the Tasty blog contact details. Users can also send an email to info@tastyblog by using the contact form available on this page.

Categories Page

Categories Page

  • On the Categories Page, users can see the categories available in the blog and filter the posts by category.

Categories Results

Categories Results Page

  • On the Categories Results Page, users can access the post filtered by the chosen category.

Books Page

Books Page

  • On this page, registered users can see favourite books posted by other users. If they had already published a post they are allowed to edit or delete their own posts

Add/Edit Books Page

Add/Edit Book Page

On this page, registered users can fill out the form to add or edit a post with their favourite cookbooks.

Search Box

Search Box

  • In this box, the users can search by inputting a keyword in the search tool. This allows the user to try and find the recipe they are looking for.

Search Results Page

Search Results Page

  • On the Search Results Page, users can see the recipes found by their search. When their recipe is located, the user can go to the Post Details Page by clicking on the card result.

Search Results - Input Empty

Search Results - Input Empty

  • On the Search Results Page - Input Empty, users will see this message if their search returns with an empty input.

Search Results - No Results Found

Search Results - No Results Found

  • On the Search Results Page - No Results Found, users will see this message if there is nothing found for the search.

Signup Page

Signup Page

  • On the Signup Page, a new user can sign up for the Tasty Blog website by filling out and then submitting the form.

Login Page

Login Page

  • On the Login Page, users can log in to the website by inputting the username and password and have access to website services for a user registered.

Logout Page

Logout Page

  • On the Logout Page, users can confirm that they wish to exit the website.

User Profile Page

User Profile Page

  • On the Profile Page, users have access to their own information and can update their user name, email and profile image.

Navbar

Navbar

  • The navigation bar is present at the top of every page and houses all links to the various other pages.
  • The options to Register or Log in will change to the option to log out once a user has logged in.
  • Once a user has signed in, more options such as profile page and user image will be available in the navbar.
  • A search icon is nested in the navbar and once clicked it will open the search box.
  • The navbar is fully responsive, collapsing into a hamburger menu when the screen size becomes smaller.

Navbar

  • In the navbar users can access the categories list by clicking on the dropdown menu.

Footer

Footer

  • On the website footer, users can see basic information about the blog such as contact, social media, copyright, and a quote about food recipes.

Messages and Interaction With Users

  • Some interactive messages were added to the project to make the navigation on the website easier and to improve the user's experience.

Sign up

Sign up

  • When users sign up to the website they will see a message at the top of the page saying "Successfully signed in as (username)".

Login

Login

  • When users sign in to the website they will see a message at the top of the page saying "Successfully signed in as (username)".

Logout

Logout

  • When users log out of the website they will see a message at the top of the page saying "You have signed out".

Profile Update

Profile Update

  • When users update their profile they will see a message at the top of the page saying that their account has been updated.

Like Post

Like Post

  • *When users are logged in to the website they can like a post and they will see a message at the top of the page saying "You have liked this post".

Unlike Post

Unlike Post

  • When users are logged in to the website they can unlike a post that has been liked by the user and they will see a message at the top of the page saying "You have unliked this post".

Comment Post

Comment Post

  • When users are logged in to the website they can comment on a post and after they submit the comment they will see a message at the top of the page saying "Your comment was sent successfully and is awaiting approval".

Comment Post - 2

Comment Post - 2

  • After a user submits a comment, they will see a message over the input comment saying "Thanks (username). Your comment is awaiting approval!

Delete/Edit Comment

Delete Comment

  • When users are logged in to the website and they have previously posted a comment or if the user is a superuser they will see the Delete and Edit buttons at the bottom of comments.

Delete Comment - 1

Delete Comment - 2

  • If they wish to delete their comment, they can press the button Delete and a Bootstrap box model will pop up with the message "Are you sure you want to delete your comment?".

Delete Comment - 2

Delete Comment - 3

  • After pressing the Delete button again inside the Bootstrap box model they will see a message on the top of the page, "Your comment was deleted successfully".

Edit Comment

Edit Comment

  • After pressing the Update, users will see a message on the top of the page, "The comment was successfully updated".

Email Sent - Success

Email Sent - Success

  • After users submit the form to info@tastyblog successfully, they will see the message, "Thanks for your email! We will contact you as soon as possible".

Email Sent - Failed

Email Sent - Failed

  • If the email was not submitted successfully, users will see the message, "Sorry, something went wrong! Try to submit the email again".

Add Book

Add Book

  • When users are logged in to the website they can publish a post with a favourite cookbook and after they submit the post they will see a message at the top of the page saying "Your post was sent successfully and is awaiting approval".

Edit Book

Edit Book

  • When users are logged in to the website they can edit their own previously published posts and they will see the message "The post was successfully updated" after pressing the Submit button.

Delete Book 1

Delete Book 1 When users are logged in to the website and they wish to delete their posts, they can press the button Delete and a Bootstrap box model will pop up with the message "Are you sure you want to delete your post?".

Delete Book 2

Delete Book 2

  • After pressing the Delete button again inside the Bootstrap box model they will see a message on the top of the page, "Your post was deleted successfully".

Empty Search

Empty Search

  • Any user can search for a keyword using the input search and if the search is done with an empty input they will see a message saying, "You forgot to search a recipe. Please try searching again.".

No Search Found

No Search Found

  • And if there are no results matching or similar to the keyword, the user will see the following message, "We are sorry. There are no searches for (keyword) on the website. Try the search again".

Admin Panel/Superuser

No Search Found

  • On the Admin Panel, as an admin/superuser I have full access to CRUD functionality so I can view, create, edit and delete the following ones:
  1. Posts
  2. Comments
  3. Author
  4. Categories
  5. Profiles
  6. Books

*As admin/superuser I can also approve comments, approve posts and change the status and give other permissions to the users.

Technologies Used

Languages Used

Django Packages

  • Gunicorn
    As the server for Heroku
  • Cloudinary
    Was used to host the static files and media
  • Dj_database_url
    To parse the database URL from the environment variables in Heroku
  • Psycopg2
    As an adaptor for Python and PostgreSQL databases
  • Summernote
    As a text editor
  • Allauth
    For authentication, registration, account management
  • Crispy Forms
    To style the forms

Frameworks - Libraries - Programs Used

  • Bootstrap
    Was used to style the website, add responsiveness and interactivity
  • Jquery
    All the scripts were written using jquery library
  • Git
    Git was used for version control by utilizing the Gitpod terminal to commit to Git and push to GitHub
  • GitHub
    GitHub is used to store the project's code after being pushed from Git
  • Heroku
    Heroku was used to deploy the live project
  • PostgreSQL
    Database used through heroku.
  • VSCode
    VSCode was used to create and edit the website
  • Lucidchart
    Lucidchart was used to create the database diagram
  • PEP8
    PEP8 was used to validate all the Python code
  • W3C - HTML
    W3C- HTML was used to validate all the HTML code
  • W3C - CSS
    W3C - CSS was used to validate the CSS code
  • Fontawesome
    To add icons to the website
  • Google Chrome Dev Tools
    To check App responsiveness and debugging
  • Google Fonts
    To add the 2 fonts that were used throughout the project
  • Balsamiq
    To build the wireframes for the project
  • PIXLR
    To convert the images to webp format
  • CANVA
    To build the logos for the project
  • Coolors
    To build the colour palette of the project
  • Emailjs
    To send emails from the contact form

Testing

Testing results here

Creating the Django app

  1. Go to the Code Institute Gitpod Full Template Template
  2. Click on Use This Template
  3. Once the template is available in your repository click on Gitpod
  4. When the image for the template and the Gitpod are ready open a new terminal to start a new Django App
  5. Install Django and gunicorn: pip3 install django gunicorn
  6. Install supporting database libraries dj_database_url and psycopg2 library: pip3 install dj_database_url psycopg2
  7. Create file for requirements: in the terminal window type pip freeze --local > requirements.txt
  8. Create project: in the terminal window type django-admin startproject your_project_name
  9. Create app: in the terminal window type python3 manage.py startapp your_app_name
  10. Add app to the list of installed apps in settings.py file: you_app_name
  11. Migrate changes: in the terminal window type python3 manage.py migrate
  12. Run the server to test if the app is installed, in the terminal window type python3 manage.py runserver
  13. If the app has been installed correctly the window will display The install worked successfully! Congratulations!

Deployment of This Project

  • This site was deployed by completing the following steps:
  1. Log in to Heroku or create an account
  2. On the main page click the button labelled New in the top right corner and from the drop-down menu select Create New App
  3. You must enter a unique app name
  4. Next select your region
  5. Click on the Create App button
  6. Click in resources and select Heroku Postgres database
  7. Click Reveal Config Vars and add a new record with SECRET_KEY
  8. Click Reveal Config Vars and add a new record with the CLOUDINARY_URL
  9. Click Reveal Config Vars and add a new record with the DISABLE_COLLECTSTATIC = 1
  10. The next page is the project’s Deploy Tab. Click on the Settings Tab and scroll down to Config Vars
  11. Next, scroll down to the Buildpack section click Add Buildpack select python and click Save Changes
  12. Scroll to the top of the page and choose the Deploy tab
  13. Select Github as the deployment method
  14. Confirm you want to connect to GitHub
  15. Search for the repository name and click the connect button
  16. Scroll to the bottom of the deploy page and select the preferred deployment type
  17. Click either Enable Automatic Deploys for automatic deployment when you push updates to Github

Final Deployment

  1. Create a runtime.txt python-3.8.13
  2. Create a Procfile web: gunicorn your_project_name.wsgi
  3. When development is complete change the debug setting to: DEBUG = False in settings.py
  4. In this project the summernote editor was used so for this to work in Heroku add: X_FRAME_OPTIONS = SAMEORIGIN to settings.py.
  5. In Heroku settings, delete the config vars for DISABLE_COLLECTSTATIC = 1

Forking This Project

  • Fork this project by following the steps:
  1. Open GitHub
  2. Find the 'Fork' button at the top right of the page
  3. Once you click the button the fork will be in your repository

Cloning This Project

  • Clone this project by following the steps:
  1. Open GitHub
  2. You will be provided with three options to choose from, HTTPS, SSH or GitHub CLI, click the clipboard icon in order to copy the URL
  3. Once you click the button the fork will be in your repository
  4. Open a new terminal
  5. Change the current working directory to the location that you want the cloned directory
  6. Type 'git clone' and paste the URL copied in step 3
  7. Press 'Enter' and the project is cloned

Credits

Content

  • All food recipes were taken from BBC Goodfood
  • The cookbook’s information and images were sourced from Eason’s
  • The images were taken from Unsplash
  • The Tasty Blog logos and favicon are my own design and build

Information Sources / Resources

Special Thanks

  • Special thanks to my mentor Sandeep Aggarwal, my colleagues at Code Institute, Kasia Bogucka, and Mairéad Gillic for their assistance throughout this project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published