ObiOne84 / django-chefs-helper

0 stars 1 forks source link

Chef's Helper

Discover the ultimate solution for your culinary adventures! Our application empowers you to create, store, and explore a world of recipes, all in one place. Whether you're a seasoned chef or a home cook, our platform is designed to enhance your cooking experience. Join our thriving culinary community today and elevate your cooking journey with our feature-rich, user-friendly application. It's not just a recipe app; it's your culinary companion. Start creating, exploring, and savouring the joy of cooking!

Home Screen

Chef's Helper live website here


Table of Contents

User Experience

Design

Security Features

Features

Technologies Used

Deployment and Local development

Testing

References


User Experience (UX)

Dive into an immersive culinary journey with Chef's Helper's Recipe Management feature. Our platform offers a seamless and engaging user experience, ensuring effortless organization and exploration of your favourite recipes. Experience the convenience of storing, viewing, and managing your own culinary creations, alongside the ability to discover, review, rate, and like recipes contributed by fellow users.

The Recipe Management system is designed with user-friendly navigation, providing a visually stunning interface for an enjoyable and hassle-free experience. Whether you're a seasoned chef or a home cook, our personalized recommendations and comprehensive information cater to your unique preferences, making each step of your culinary adventure delightful.

Create a personalized collection of recipes, easily accessible from any device with our mobile-friendly design. Edit your recipes with ease, add new ingredients, and share your culinary masterpieces with the Chef's Helper community. Explore a treasure trove of diverse recipes contributed by others, offering inspiration for your next kitchen endeavour.

Feel the satisfaction of not only managing your culinary creations but also engaging with a community passionate about food. Leave reviews, rate recipes, and show appreciation by liking outstanding dishes. For those cherished favourites, the option to print your recipes ensures they are always at your fingertips, ready to impress friends and family.

Chef's Helper's Recipe Management is more than just a tool; it's a culinary haven where your cooking journey transforms into a delightful and enriching experience. Join us in celebrating the art of cooking, sharing, and savouring the flavour of a vibrant and thriving culinary community.

Project Goals

Chef's Helper aims to create a user-friendly online platform for culinary enthusiasts. The project focuses on:

Agile Methodology

Agile Methodology served as the guiding framework for prioritizing and organizing tasks in the Chef's Helper app development process. The workflow included:

In essence, the Agile Methodology, coupled with Github's Project Boards and a structured template for user stories and epics, ensured an efficient and collaborative approach to Chef's Helper app development. This methodology allowed for flexibility, adaptability, and continuous improvement throughout the project lifecycle.

User Stories Template ![User Stories, Template](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703414610/django-project/user-story-template_tv3jc0.webp)
User Stories, Issues ![User Stories, Issues](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703414610/django-project/project-issues_t53i76.webp)
Project Milestones ![Project Milestones](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703268372/project-milestones_xpcjup.png)
Project Board ![Project Board](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703414612/django-project/project-board_zrmszf.webp) - Visit project GitHub page here.

User Stories

Epics

User Stories

  1. Project set up

    • Develop wireframes for the user interface of the application.
    • Design Entity-Relationship Diagrams (ERD).
    • Create a new Heroku application.
    • Link the Github repository to the Heroku app.
  2. Site Navigation

    • Create a base.html file.
    • Create the Navigation tabs for the site header.
    • Create links for navigation tabs on each page.
  3. Social network bar

    • Create the footer
    • Create a link for social sites on each page.
  4. User Registration

    • Sign Up page.
    • User registration, log in, log out.
    • Display the users' name.
  5. Manage recipes

    • Admin panel.
    • Crud functionality
    • Admin dashboard functionality.
  6. Create drafts

    • Add ingredients in the admin panel to the recipe.
    • Recipe can be saved as a draft.
  7. Approve reviews

    • Allow admin to approve reviews
    • Allow admin to create reviews through the admin panel
  8. Review a recipe

    • Create a form to allow user review the recipe
    • Allow user to rate recipe only once
  9. Like a recipe

    • Allow user to like recipe only once
  10. View reviews

    • Allow users to view approved reviews.
    • Create a mechanism to calculate the average rating.
  11. Add a recipe

    • Create a recipe form
    • Create a recipe template
  12. Open a recipe

    • Create a recipe card template
  13. Add an ingredient to the recipe

    • Create an ingredient form.
  14. View likes

    • Display the like count next to the recipe.
  15. Online recipe book

    • Add recipe content to the page.
  16. Enhance Frontend Styling and Responsiveness

    • Create a home page.
    • Maintain consistent design.
    • Test responsiveness.
  17. Readme file

    • Create comprehensive application's documentation.

Detailed look can be found on the project board

Target Audience

First time user

Registered User

Admin user

Design

The design of Chef's Helper platform is carefully crafted to provide a visually appealing and user-friendly experience. The design strikes a balance between simplicity and sophistication, ensuring a clean and modern appearance. The light blue background creates a harmonious backdrop for the culinary-focused content. The design emphasizes user interaction, with hover styles applied to key elements such as navigation, social links, and recipe cards. This provides users with a responsive and dynamic experience as they navigate through the platform. The consistent use of the color scheme, fonts, and styling elements across the platform creates a cohesive and unified visual identity. The design of Chef's Helper is tailored to appeal to users seeking a seamless and visually delightful experience while exploring and managing their recipes.

Color Scheme

Recipe Images

Logo

Typography

Wireframes

Home Page ![Home Page](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703345763/wireframe-home-page_qobymk.png)
User Sign Up Page ![User Sign Up Page](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703345881/wireframe-registration-page_i3wdcc.png)
User Login Page ![User Login Page](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703414612/django-project/login-page_w7ktsc.webp)
Add Recipe Page / Update Recipe Page ![Add and Update Recipe Page](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703346206/wireframe-add-recipe_qj9ury.png)
Recipe Detail View Page ![Recipe Detail View Page](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703346404/wireframe-recipe-view_qjkzsd.png)
Recipe Images Page ![Recipe Images Page](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703346478/wireframe-recipes-page_ovghpm.png)

Database Scheme

Entity Relationship Diagram (ERD)

The current data scheme comprises models essential for the Minimum Viable Product (MVP) of the recipe management system. However, future updates are planned to enhance the application's functionality. The upcoming features include the addition of Categories to recipes, enabling users to better organize and filter recipes by category and allergens. This enhancement ensures that the system accommodates dietary needs and provides nutritional information for each ingredient and meal created using the recipes.

In subsequent phases, the system will introduce a Supplier model to transform the application into a comprehensive tool for the hospitality sector. This addition will facilitate inventory management, catering to the specific needs of commercial users. The planned updates align with a strategic roadmap, progressively expanding the capabilities of the recipe management system to meet evolving user requirements and industry demands.

Data Scheme ![Data Scheme](https://res.cloudinary.com/dcrbeonr9/image/upload/v1703347474/Database_ER_diagram_crow_s_foot_-_Database_ER_diagram_crow_s_foot_bowogm.png)

Data Models

  1. Allauth User Model

    • Django Allauth is a third-party Django package that provides a set of authentication, registration, and account management functionality for Django web applications. It's designed to handle various aspects of user authentication, including login, registration, and more.
    • Django Allauth provides the default User model for authentication within the recipe management system.
    • The User etnity has one-to-many relationship with the Recipe entity, allowing each User to create a multiple recipes. Also, each individual recipe is associated with only one User, this means that users can create and manage their own collection of recipes, and each recipe is attributed to a specific user..
  2. Recipe Model

    • The Recipe model in the system represents a culinary recipe and encapsulates various attributes, including the recipe's title, author, creation/update timestamps, instructions, ingredients, featured image, and additional details related to preparation and user interactions.

    • Fields:

    • title: CharField for the title of the recipe, ensuring uniqueness.

    • slug: SlugField for a URL-friendly version of the title.

    • author: ForeignKey to the User model, establishing a many-to-one relationship.

    • created_on: DateTimeField for the creation timestamp.

    • updated_on: DateTimeField for the last update timestamp.

    • instructions: TextField for the detailed recipe instructions.

    • ingredients: ManyToManyField to the RecipeIngredient model, forming a many-to-many relationship.

    • featured_image: CloudinaryField for storing images, with a default placeholder image.

    • excerpt: TextField for a brief description or summary (optional).

    • likes: ManyToManyField to the User model, allowing users to express their liking for a recipe.

    • prep_time: IntegerField for the preparation time in minutes (optional).

    • cook_time: IntegerField for the cooking time in minutes (optional).

    • servings: IntegerField for the default number of servings.

    • rating: FloatField for the overall rating, constrained between 1 and 5.

    • total_ratings: IntegerField for the total number of ratings.

    • status: IntegerField with choices representing the status of the recipe (Draft or Published).

    • rated_users: ManyToManyField to the User model, tracking users who have rated the recipe.

    • sum_of_rating: FloatField for the cumulative sum of all ratings.

    • Meta specifies the default ordering based on the recipe title in descending order.

    • Methods:

    • __str__(self): Returns the title of the recipe when converted to a string.

    • number_of_likes(self): Returns the count of likes for the recipe.

    • number_of_reviews(self): Returns the count of reviews for the recipe.

    • rate_recipe(self, user, user_rating): Records a user's rating for the recipe, updating the total rating and user rating history.

    • calculate_average_rating(self): Calculates and returns the average rating for the recipe.

    • has_unapproved_reviews(self): Checks if there are unapproved reviews for the recipe.

    • Custom save method to create a unique slug for each recipe, ensuring a URL-friendly representation.

    • This model empowers the system to manage and present a diverse array of recipes, supporting interactions such as liking, rating, and reviewing. The inclusion of features like unique slugs and status tracking enhances the robustness of the recipe management system.

  3. RecipeIngredient Model

    • The RecipeIngredient model represents an individual ingredient used in a recipe. It encapsulates information such as the ingredient's name, quantity, unit of measurement, and the recipe to which it belongs.

    • Fields:

    • name: CharField for the name of the ingredient.

    • quantity: DecimalField for the quantity of the ingredient.

    • unit: CharField for the unit of measurement.

    • recipe: ForeignKey to the Recipe model, establishing a many-to-one relationship.

    • This model serves as a crucial component in the recipe system, allowing for the detailed specification of each ingredient within a recipe. The ForeignKey establishes a link to the associated recipe, facilitating the organization and retrieval of ingredient information when needed. The __str__ method provides a readable string representation for ease of use and display.

  4. Review Model

    • The Review model represents user reviews for a specific recipe within the recipe management system. It includes essential details such as the reviewer's name, email, the content of the review, creation timestamp, and approval status.

    • Fields:

    • recipe: ForeignKey to the Recipe model, establishing a many-to-one relationship.

    • name: CharField for the name of the reviewer.

    • email: EmailField for the email of the reviewer.

    • body: TextField for the content of the review.

    • created_on: DateTimeField for the creation timestamp.

    • approved: BooleanField indicating whether the review has been approved (default is False).

    • Meta specifies the default ordering based on the creation timestamp in ascending order.

    • This model plays a crucial role in collecting and managing user feedback for recipes. The ForeignKey establishes a link to the associated recipe, allowing for easy retrieval and organization of reviews. The approval status (approved) provides a mechanism to control the visibility of reviews, with the default set to False. The __str__ method ensures a meaningful and readable representation of reviews when converted to a string. The ordering meta attribute ensures that reviews are sorted based on their creation timestamp.


User Journey

User Journey

Security Features

User Authentication

LoginRequiredMixin

CSRF Protection

<form method="post" action="{% url 'custom_view' %}">
    {% csrf_token %}
    {% form.as_p %}

    <button type="submit">Submit</button>
</form>

Custom Views Security Measures

Form Validation

Features

Existing Features

Home Page

Logged in User Home Page

Features Left to Implement

I. Feature Left to Implement with the next update:

II. Transformation into Inventory Application:

By incorporating these features, Chef's Helper will not only enhance the user experience but also position itself as a versatile tool catering to both home cooks and the hospitality sector. The inclusion of advanced inventory management features and compatibility with POS systems will make it a comprehensive solution for the culinary industry.

Technologies Used

Languages Used

Databases Used

Frameworks Used

Programs Used

Deployment and Local Development

Local Development

How to Fork

To fork the repository, follow the steps below:

  1. Log in to your GitHub.
  2. Navigate to the repository for this project Chef's Helper
  3. In the top right corner of the window, click on the Fork button.
  4. The process will start, and you will see the message confirming the start.

Remember that if you forked the repository, none of the updates made to the source repo would be reflected in your forked repo.

How to Clone

To bring down project for local development, it is possible to clone a repository by following steps below:

  1. Log in(or Sign Up) to GitHub.
  2. Navigate to the repository for this project Chef's Helper
  3. Above the list of files, click the green button Code.
  4. Select Local tab.
  5. Copy to HTTPS code.
  6. In your local IDE open terminal, choose the location where you want to clone the directory.
  7. Type git clone and then paste the URL you copied from GitHub in step 5.
  8. Set up a virtual environment (not required if you are using the Code Institute template and GitPod or Codeanywhere - this will be already set up).
  9. Press Enter to create the clone.
  10. Install packages by running command pip3 install -r requirements.txt

ElephantSQL Database

  1. Login to ElephantSQL PostgreSQL Database.
  2. Click Create New Instance.
  3. Set up your plan:
    • give your plan name - commonly project name
    • select Tiny Turtle (Free) plan
    • you can leave the tags blank
  4. Select the Region and data center near you.
  5. Click Review.
  6. Check your details are correct and then click Create instance.
  7. Return to the ElephantSQL dashboard and click the database name you just created.
  8. In the URL section, click and copy icon to copy the database URL (you will need this for your env.py file)

Cloudinary

  1. Visit Cloudinary and click on Sing Up For Free.
  2. Provide your name, email address and choose a password
  3. For Primary interest, you can choose Programmable Media for image and video API
  4. Optional: edit your assigned cloud name to something more memorable
  5. Click Create Account
  6. Verify your email and you will be brought to the dashboard
  7. On your Cloudinary Dashboard, you can copy your API key.
  8. Add CLOUDINARY_URL to env.py and Heroku app variables. Make sure that env.py is added to .gitignore to not share you security key.

Heroku Deployment

Prepare enviroment and settings.py

Deploy

  1. Before deployment change DEBUG = False in the settings.py, to prevent sharing sensitive information with the public.
  2. Connect to GitHub in the deploy tab on Heroku app, and find your project repository.
  3. At the bottom of the page you can choose Enable Automatic Deploys for automatic deployments or Deploy Branch to deploy manually. Keep in mind that manually deployed branches will need to be re-deployed after each time the GitHub repository is updated.
  4. Click 'Open App' to view the deployed live site.

Site is now live

You can visit the deployed application at Chef's Helper

Testing

Please see TESTING.md for all the detailed testing performed.

References

Docs

Content

Acknowledgements