The Happy Reader is a Children's Book Search and Review website for users who would like to look up book reviews to help them decide the next book best suited for their child and, in turn, to leave reviews on books to help others. Hopefully, this helps your child grow a love for books that will last through out their life.
You can view the live site here - The happy reader
The Agile Methodology was used to plan this project. This was implemented through Github and the Project Board, which can be seen here - The happy reader Project
Through the use of the Kanban board in the projects view in Github, the project was divided into a few different sections:
Layout.
Github issues were used to create User Stories and any other Fixes or Updates for the project. This is where the project user was assigned; labels were added to show at a glance importance of tasks and help prioritize jobs. User story was added to the appropriate Iteration and the project. Each User Story, Fix or Update had a clear title, acceptance criteria and smaller tasks (if applicable).
Milestones were used to create Iterations. There were 3 Iterations, each dated appropriately. User Stories were completed based on the current Iteration that was in progress.
Iteration 1
Iteration 2
Iteration 3
Still in backlog for future features
On the first view, The Happy Reader website has four pages visible from the navigation bar; the Age group drop-down filters the correct information onto the page, which is only accessible from the home page. Sign-in and log-in are available on the first landing and a contact us page. Two other pages are available on the nav bar when the user signs in. These are View reviews and Add a review. In the View Reviews page, you can choose one of the reviews you previously created to either amend or Delete. This ensures that only authorized users can add or amend information from the database.
The Home page, Log-in, Signup Age group and Contact pages can be accessed by all users. Once a user logs in or signs-up, they have access to the Reviews dropdown that shows Add review or see reviews. The Signup page is removed from the navbar once the user logs in, and the log-in page is changed to a log-out page.
The color scheme chosen was a dark, almost black colour with white contrast and a bright green used as highlights. I chose colours that would allow the imagery to stand out.
One font was chosen for this website, and that was Source Sans Pro from google fonts. It is clear and simple to read.
I also chose Kalam for the Logo on both the Navbar and Footer.
Tabs on the navigation bar change depending on whether the user is logged in or not.
The Home Page page of the website that's visible first when the site loads. It is designed that the purpose of the website easily determined.
There is a large hero image to catch the user's eye, the site name, a call to action with a log in and signup button. If the user logs in, an alert appears to confirm login, and a welcome message addressing the user by username and two buttons which link to the user's reveiws or to creat a reveiw appears.
Below the hero image is a selection of book reviews clearly marked by age for the users easy. This secition draws from the entire database of approved books and those with uploaded book images, in random order. If the user clicks on a books image or title, the link brings the user to that book's page.
Filtering books by age range can be done by the user from the homepage using the navigation bar dropdown.
When an age range is chosen by the user they are brought to a page showing only the books recommended for that age group.
In a future integer, I would like to add a search bar on the main screen to make it easier to search specifically for book titles or authors. This will help ensure that users are not adding more reviews on the same book.
For ease of use, users could use their social media credentials to log in rather than creating another password to remember.
A user profile page to include the ability of the user to add saved reviews in categories to organize them; for example, Read Again or Must Read or Read. To show all comments they have made on other reviews.
The page could also provide more user details that could also be added to the user profile in general. Such as a profile picture or avatar that could be utilized in their reviews, and the total number of books they have reviewed or bookmarked could be visible on their profile. As well as specifying the age of the children they are browsing for.
A genre section so that books can be chosen on the bases of the child's interests or an underlying lesson you would like the child to learn about.
The user to be able to upload their own images via the 'add review' form. Back to top
Html validation was done with https://validator.w3.org/nu/. The deployed link from the site was used the below errors were highlighted.
After researching the error message I learned on Slack that this issue was caused by a closing tag being in the wrong place. It needed to be placed after.
The stylesheet was validated using https://jigsaw.w3.org/css-validator/
Python code was validated using Code institues Python validator
Only minor errors such as missing blank spacing or whitespace. These were rectified easily.
Javascript was validated using jshint
Apart from minor errors such as semicolans missing the validations was a success. All minor errors were delt with easily.
Lighthouse testing Most pages scored hight. The ligth house testing came up quite poor especially in the Preformance section and Best Practice.
In addition to the other tests, I have conducted a manual check list for myself to carry out to make sure that everything is working as intended.
Status | Navigation Bar - User Logged Out |
---|---|
✓ | Clicking the navbar logo loads the home page |
✓ | That the navbar shows the tabs Home, Bookshelf, Login, Signup and Contact if the user is logged out |
✓ | Clicking the Home tab on the navbar loads the home page |
✓ | Clicking the Bookshelf tab on the navbar loads the bookshelf page |
✓ | Clicking the Login tab on the navbar loads the login Page |
✓ | Clicking the Signup tab on the navbar loads the signup page |
✓ | Clicking the Contact tab on the navbar loads the contact page |
Status | Navigation Bar - User Logged In |
---|---|
✓ | Clicking the navbar logo loads the home page |
✓ | That the navbar shows the tabs Home, Bookshelf, My Books, Logout and Contact if the user is logged in |
✓ | That the navbar shows the username of the logged in user and that clicking this leads to the user My Books page |
✓ | Clicking the Home tab on the navbar loads the home page |
✓ | Clicking the Bookshelf tab on the navbar loads the bookshelf page |
✓ | Clicking the My Books tab on the navbar loads the user's my books Page |
✓ | Clicking the Logout tab on the navbar loads the logout page |
✓ | Clicking the Contact tab on the navbar loads the contact page |
✓ | Clicking user's username in the navbar loads the user's my books page |
Status | Footer - User Logged Out/In |
---|---|
✓ | Clicking the youtube icone loads the youtube home page in a new tab |
✓ | Clicking the instagram icon loads the instagram home page in a new tab |
✓ | Clicking the facebook icon loads the facebook home page in a new tab |
✓ | Clicking the twitter icon loads the twitter home page in a new tab |
Status | Home Page - User Logged Out |
---|---|
✓ | That a Login and Signup button appear in the hero section |
✓ | Clicking the Login button in the hero section of the home page loads the login page |
✓ | Clicking the Signup button in the hero section of the home page loads the signup page |
Status | Home Page - User Logged In |
---|---|
✓ | That a Welcome text appears with the user's username in the hero section |
✓ | That an 'add reviews' and 'Your reviews' button appears below the welcome text |
✓ | That the 'Your reviews' button loads the user's reviews page |
Status | Age range Page |
---|---|
✓ | That the page reflects the age range chosen |
✓ | That they are approved books. |
✓ | That the book listing card shows the book image and an excerpt of the book blurb |
Status | Log In Page - User Logged Out |
---|---|
✓ | Clicking the sign up link above the user input loads the sign up page |
✓ | That the username input field is required |
✓ | That the password input field is required |
✓ | That if the username does not match the password the user cannot log in and user feedback is provided |
✓ | That if the correct credentials are given the user is logged in when the log in button is clicked |
✓ | That when the user is logged in they are redirected to the the home page and an alert message informs the user that they logged in successfully |
✓ | That when the user is logged in successfully their username will appear in the navbar indicating their logged in status |
Status | Log In Page - User Logged In |
---|---|
✓ | That the user cannot access the login tab from the navbar if they have logged in |
Status | Sign Up Page - User Logged Out |
---|---|
✓ | Clicking the log in link above the user input loads the log in page |
✓ | That the username input field is required |
✓ | That both password input fields is a required field |
✓ | That if you provide a username and password that is too similiar that the user cannot sign up and user feedback is provided |
✓ | That if your password doesn't match in both password fields, the user cannot sign up and user feedback is provided |
✓ | That if the user provides a password less that 8 character, the user cannot sign up and user feedback is provided |
✓ | That if you provide a good username and password but the email field does not contain a proper email address, the user cannot sign up and user feedback is given |
✓ | That the email input field is optional |
✓ | Clicking the Sign Up button signs the user up and logs the user in if the correct user information was provided for sign up |
✓ | That when the user signs up, they are redirected to the home page and an alert message informs the user that they sisgned up successfully |
✓ | That when the user signs up and is logged in successfully their username will appear in the navbar indicating their logged in status |
Status | Sign Up Page - User Logged In |
---|---|
✓ | That the user cannot access the signup tab from the navbar if they have logged in |
Status | Log Out Page - User Logged Out |
---|---|
✓ | That the user cannot access the log out tab from the navbar if they have logged out |
Status | Log Out Page - User Logged In |
---|---|
✓ | Clicking the logout button logs the user out |
✓ | When the user logs out they are redirected to the home page and a message alerts the user that they have logged out |
✓ | Once the user logs out the username in the navbar is removed |
Status | Add a review - User Logged In |
---|---|
✓ | That the Title input field is required |
✓ | That the Book Author field is required |
✓ | That the Age Range field is required |
✓ | That the Genre Range field is required |
✓ | That the Book Blurb field is required |
✓ | That the review field is required |
✓ | That the form cannot be submitted without all the required fields and user feedback is given if a user forgets a required field |
✓ | That none of the input fields accept empty fields |
✓ | That none of the fields accept just spaces in an input field |
✓ | That when the form is submitted a book slug is automatically created from the title and book author input fields in the form |
✓ | That when the book is added, the user is redirected back to the 'Your Reviews page and a message alert informs the user that they successfully added a book and it's waiting for approval |
✓ | That when a book is added it is automatically set as unapproved (False) until changed otherwise (to True) by an admin |
Status | User Edit Review Page - User Logged Out |
---|---|
✓ | That if the user tries to access the edit review url they recieve a warning. |
Status | User Edit Review Page - User Logged In |
---|---|
✓ | That the user can see the book title of the review they are updating |
✓ | That the user can see their username name in the posting as section |
✓ | That the user can see the review input field is already prepoulated with the review as it currently is |
✓ | That review input field is required and cannot be submitted empty or with just spaces |
✓ | Clicking Update Review, updates the review, changes the status of the approval to False again, and redirects the user back to the My Books page |
✓ | That the an alert message informs the user that their review has been updated and is flagged for approval |
Status | User Delete Review Page - User Logged Out |
---|---|
✓ | That if the user tries to access the delete review url that they will receive a error message. |
Status | User Delete Review Page - User Logged In |
---|---|
✓ | That the user can see the book title and review details of the the review they would like to delete |
✓ | Clicking the Delete button redirects back to the My Books page |
✓ | That an alert message informs the user that they successfully deleted their review |
✓ | That the review is completely deleted and doesnt show up in the database or subsequently any place on the website |
Status | Contact Page- User Logged Out/In |
---|---|
✓ | That First Name input field is required |
✓ | That Last Name input field is required |
✓ | That Email input field is required |
✓ | That Message input field is required |
✓ | That none of the fields can be submitted blank |
✓ | That the email field only accepts proper email syntax (@ symbol has to be present) |
✓ | That none of the fields can accept just blank spaces |
✓ | That user feedback is provided if none of the required criteria to sub,it the form are met |
✓ | Clicking the Send button sends the email to the Dummy Email account set up via EmailJS, that the user is redirected to the contact page. |
✓ | That an alert message informs the user that their message was sent successfully upon the user sending the message |
I tried to open a new workspace by and then deleted the old workspaces which caused my env.py not to appear on my new workspace. I created an new env.py and it fixed the issue but by fixing it i lost of the work i had done.
The footer would cover the submit button in the 'add review' page making it impossible for the user to submit their form.
Fix- By adding a height of 60px on the footer and adding a margin bottom of 60px on the body it ensures that there was enough room at the bottom of the pages for buttons.
This bug allowed others to create a review in others name.
pip3 install django gunicorn
pip install dj_database_url psycopg2
pip install dj-3-cloudinary-storage
pip freeze --local > requirements.txt
django-admin startproject project_name .
python manage.py startapp app_name
installed apps
in settings.py file: 'app_name'
python manage.py migrate
python manage.py runserver
os.environ["DATABASE_URL"]
= "Paste in the text link copied above from Heroku DATABASE_URL"os.environ["SECRET_KEY"] = "Make up your own random secret key"
In your Django 'settings.py' file type:
from pathlib import Path
import os
import dj_database_url
if os.path.isfile("env.py"):
import env
Remove the default insecure secret key in settings.py and replace with the link to the secret key variable in Heroku by typing: SECRET_KEY = os.environ.get(SECRET_KEY)
Comment out the DATABASES
section in settings.py and replace with:
DATABASES = {
'default':
dj_database_url.parse(os.environ.get("DATABASE_URL"))
}`
Create a Cloudinary account and from the 'Dashboard' in Cloudinary copy your url into the env.py file by typing: os.environ["CLOUDINARY_URL"] = "cloudinary://<insert-your-url>"
In Heroku add cloudinary url to 'config vars'
In Heroku config vars add DISABLE_COLLECTSTATIC with value of '1' (note: this must be removed for final deployment)
Add Cloudinary libraries to the installed apps section of settings.py file:
'cloudinary_storage'
'django.contrib.staticfiles''
'cloudinary'
Connect Cloudinary to the Django app in settings.py
:
STATIC_URL = '/static'
STATICFILES_STORAGE = 'cloudinary_storage.storage.StaticHashedCloudinaryStorage'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'STATIC')]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
MEDIA_URL = '/media/'
DEFAULT_FILE_STORAGE =
'cloudinary_storage.storage.MediaCloudinaryStorage'
Link file to the templates directory in Heroku
Place under the BASE_DIR: TEMPLATES_DIR = os.path.join(BASE_DIR, 'templates')
Change the templates directory to TEMPLATES_DIR. Place within the TEMPLATES array: 'DIRS': [TEMPLATES_DIR]
Add Heroku Hostname to ALLOWED_HOSTS: ALLOWED_HOSTS = ['rhi-book-nook.herokuapp.com', 'localhost']
*Create Procfile at the top level of the file structure and insert the following:
web: gunicorn PROJECT_NAME.wsgi
Make an initial commit and push the code to the GitHub Repository.
git add .
git commit -m "Initial deployment"
git push
In the IDE:
DEBUG = False
in settings.py
A copy of the GitHub Repository can be made by forking the GitHub account. Changes can be made on this copy without affecting the original repository.
This website was designed and developed in conjunction with the Full Stack Software Developer Diploma course (eccommerce) at the Code Institute. I would like to thank my family, my cohort facilitator, the members of our cohort, the Slack community and Code Institute for all their support.