JaySanders95 / jimbos-burgers

0 stars 1 forks source link

Project #4 Jimbo's Burgers

This application is a restaurant booking system for Jimbo's Burgers. A fictional burger joint, using my own name, burger names and the location of Everton FC as my address. Customers can register using an Username and password, and may then reserve a table for a number of people, on a date in the future at a certain time.

Website - Jimbo's Burgers

AM I RESPONSIVE

Contents

Goals

The application is to allow users to register with an email address and a password, and then they will be able to create a restaurant reservation.
They will be able to subsequently edit or delete their own reservation(s).
Staff users will be able to create reservations for customers, and will have authority to edit or delete any customers' reservations.

Scope and Features

Some features are only available to users with an account, and staff can access everything
Responsiveness - the site is viewable on all devices, as tested

Planning

Project planning was done with Agile methodologies.

Agile project

Wireframes




User Stories

USER STORY - As a developer i must initialise a working environment so i can create my project

Setup

This was to setup the system for development. Initialise the application, create the static resources needed by everything else.

USER-STORY: - As a developer i must create and setup the default project basics so that the project may continue

USER-STORY: - `As a developer, i must make the user provide a strong password so their account has added security

USER-STORY: - As a developer, i must create static resources to allow the app to inherit these

USER-STORY: - As a developer i must create a clean navigation system so users can easily browse the site.

Header:
    The header features a restaurant logo, with a varying number of links.

        Home:

        Only visible if logged in:
            Logout
                Menu
            Book a Table
            My Bookings
                (If the signed in user is staff, this link is "Bookings")

        Only visible if not logged in:
            Register
            Login

Logged in:

Not logged in:

Footer:
    The footer features the Restaurant address and Social media icons for Facebook, Instagram, Twitter and Youtube

Homepage:
    A new app is created for the home page - python manage.py startapp home
    The homepage is created in the home app in the templates/home directory, and imports the html from the base.html.
    The homepage features a simple  image with some welcome text, a google embed map for location and opening times.
    - The following files were edited to align with the website styling.
       - - signup.html
       - - login.html
       - - logout.html


USER-STORY: - As a developer, i must create http error pages to alert server issues and other HTTP server problems

404:
a 400.html was created for page not found
403:
a 403 was created for forbidden

Authentication

Following the i think therefore i blog tutorial i installed allauth. copied it from the root directory and then modified to my own design. Allauth will manage registration, email verification, and login / logout functionality. 

``USER-STORY: - As a developer, i must add authentication so that only logged in users can create/read/update/delete bookings

if a user isnt logged in, they are redirected to the login page to continue.


Booking

The bookings include all the functionality required to list/manage, create, edit and delete bookings.

USER-STORY: - As a developer i must create databases that allow users to create, read, update and delete bookings

USER-STORY: - As a customer, I need a confirmation that my booking was successful

USER-STORY: - As a user, i can see all bookings i have made to ensure they are correct and modify/delete if i need to,

USER-STORY: - As a user i can edit any current bookings i have

USER-STORY: - As a user i can delete a booking if i no longer want it

USER-STORY: -USER-STORY: - as an admin i can create, edit and delete customers bookings so i can manage my restaurant``


Deployment

USER-STORY: - As a developer, i must deploy to heroku to allow public access

Tests

USER-STORY: - As a developer i must write suitable tests and perform manual testing so my code is working efficiently

Automated Testing:

Models: I ran tests using TestCase to ensure that the Models were functioning as designed.

For Table, i had the program:

For Booking, i had the program:

ALL PASSED

Views: I ran tests using TestCase to ensure all views ran as designed.

For All views, i had the program create a user and a table for testing, then setup the self.factory to simulate requests

For CreateBooking:

Similar tests for ListBookings were completed but the template response was checked 'my_bookings'

for Editing bookings:

for Deleting bookings:

Some tests failed, but this was due to the working environment. whilst testing i was advised to use the local sqlite database as it would not let me do it on postgresSQL. during these tests i had accidentally migrated and in attempt to undo this, deleted the migrations. this would not allow me the tests to pass, but these were checked locally to ensure that they were correct

the correct reponse code was given for all views the correct template was given for all views

During testing, i had to comment out the "messages" because middleware was not allowing this code to be checked so the tests were run without these. messages were showing correctly when they were supposed to.

Manual testing:

User authentication:

During manual tests, i tried:

When a user visits the site, they are greeted with the option to view the menu, create an account or login to an existing account.

User-sign up:

During my testing, i tried to create an account:

I created an account, with meeting the criteria for each and was permitted to use the site:

User functions (logged in~)

The user can Logout:

The user can view bookings:

The user can create bookings:

The user can view the menu

When the user visits the my bookings page:

When the user visits the create booking page:

Booking-TESTING

During my testing, i tried to create bookings in different scenarios:

Scenario 1:

Logged out people 3 time 4pm date 12/12/2023

Upon attempting to visit this page at /bookings/add, i am redirected to the login page

Scenario 2: Logged in people 5 time 4pm date 12/12/23

Booking completed successfully message to confirm booking displayed successfully

Scenario 3: Logged in people 2 time 5pm date 10/06/2023

Booking not created, message "you cant book tables in the past"

I then tried to book a table and not fill out required fields: Time was required - could not confirm booking without this field completed Date was required - could not confirm booking without this field completed Number of guests was required - could not confirm booking without this field completed Notes - Special characters were permitted, as they could be used in a sentence for notes (i.e "do you do 20% for Forces discount?")

Listed Bookings-TESTING: When booking list was empty:

When bookings:

Editing-TESTING I tested to book a table different from the one that i had made, and the details were updated and i was redirected back to my bookings with the newest information showing. I selected a new date, new party size new time and this was completed.

Delete-TESTING I tested the delete button on my_bookings once clicked, redirects me to the booking_defensive page from there i am asked am i sure that i want to delete booking clicking the YES option deletes the booking and redirects user to my bookings page clicking NO, redirects and no changes are made


USER-STORY: - As a developer I can complete README.md so that the project is documented


Website Design

Device Testing

I tested all pages on different response sizes using chrome developer tools:

Links

All links went to their correct destinations including: Logo - HOME Home - HOME Menu - MENU Login - LOGIN Register - SIGNUP Logout - LOGOUT Make Booking - MAKE BOOKING My Bookings - MY BOOKINGS Facebook - FACEBOOK Twitter - TWITTER Instagram - INSTAGRAM YouTube - YOUTUBE

Validation

W3 validator HTML

I validated code by direct input.

Here are the steps i performed for my HTML documents:

base - NO ERRORS menu - NO ERRORS my_bookings - NO ERRORS booking_add - 2 MINOR ERRORS ID states empty but ID = {{ form.num.guests.id_for_label }} booking_edit - 2 MINOR ERRORS ID states empty but ID = {{ form.num.guests.id_for_label }} booking_defensive - NO ERRORS logout - NO ERRORS login - NO ERRORS register - NO ERRORS

W3 CSS validator results NO ERRORS FOUND

For JSHint- only minor JS was used, so use for a script.js was not neccessary

PEP8 - CI LINTER at https://pep8ci.herokuapp.com/

bookings/ admin - NO ERRORS apps - NO ERRORS forms - 1 error for line exceeding 79 characters, nothing can be done to fix this issue as is class name + parameters models - NO ERRORS forms - 1 error import line too long, nothing can be done to fix this as need to import multiple views - 1 error import line too long

home/ apps - NO ERRORS forms - NO ERRORS views - NO ERRORS settings - minor errors from default

Lighthouse:

scores for lighthouse: all pages were checked and received consistent scores except the home page, which received good scores except best practise, but this was due to fonts and other minor issues.

Credits

The CI tutors who helped with bugs/queries that i had faced, these include:

I think therefore i blog for specific code and setup for project

NetNinja Youtube - https://www.youtube.com/watch?v=n-FTlQ7Djqc&list=PL4cUxeGkcC9ib4HsrXEYpQnTOTZE1x0uc This was basic guides on everything that had already been covered but had different methodologies

I sought external tutoring to help me go over some parts of the code, as i was time-restraint to 90 minutes per week for CI. I cannot thank enough to Chris Hoyle tutor who helped me with parts of my code. They helped with issues but did not provide large scale code for me to copy, such as: