Skip to content

taikatta/Milestone3-Konyvkucko

Repository files navigation

Book Donation / Konyvkucko

Table of Contents

  1. Summary

  2. Project purpose

  3. UX

  4. Design and colors

  5. Wireframes

  6. Features

  7. Technology Used

  8. Testing

  9. Credits

  10. DEPLOYMENT

  11. Disclaimer

This is my third Milestone Project on the Full Stack Web Developer Code Institute course. For Data Centric Development module.

Summary

I am the founder of Könyvkuckó, the Hungarian Children's Library in Ireland. My book collection is about 120 books, all our books were donated. I got books from authors, organizations, individuals. The launch of the Hungarian children's book was on the 29th of October, 2019. The books are hosted by Deansgrange Library, but they can be requested via the inter-library loans system from other libraries who are part of Libraries Ireland. The requested books will be delivered to the users' local library.

Back to Top

Project purpose:

The purpose of the project is to build a full-stack site that allows the users to manage a common dataset about a particular domain.

The application allows users to search Hungarian children's books, check the wishlist and donate books either from our wishlist or any book they want. Only the admin can add new books to the database, delete and edit the existing books.

The project has the following sections:

  • Home page Contains two background images and a short description.

  • Books page Contains all the available books, each book has a View button, for more information about the book. When admin is logged in they can see an Add Book button, and an Edit and a Delete button as well.

  • Donation page On the top of the page the user can see the I would like to donate a book button, and all the books that have been donated to the library, but haven't arrived yet. The admin can see two buttons next to the book, the first one is to move the book from the Donation list to the Books list when the book arrives, the second one is a Delete button, in case the book never arrives. There is a third button, which allows the admin to approve the book, making it visible to users on Donation page. I read about Defensive Design and wanted to check the information the users provided when filled the donation form.

  • Wishlist Contains all the books that we are currently looking for. Users can donate any of them by clicking to the button next to the book. If users decide to donate a book that is not on the list, they can click on the button on top of the page. Admin sees a third button, as they can add a new book to the Wishlist.

  • Login / Register page I needed an admin account to delete/edit/add books, this is why I created the Login page. Any user can register here, but at the moment registration does not have any advantages.

Back to Top

UX

User stories:

  • As a user I would like to know about the books that are available to borrow from Libraries Ireland

  • As a user I would like to get from a book to the Library's homepage to borrow the book

  • As a user I would like to be able to donate books to the Hungarian Collection

  • As a user I would like to access the Wishlist to see which books are needed by the library

  • As a user I would like to be able to contact Konyvkucko with my questions

Admin stories:

  • As an admin I would like to be able to add books to the collection and delete/ edit them

  • As an admin I want to be sure that I approve all the books which appears on our donation page

  • As an admin I want to be able to move books from wishlist to donation list

Back to Top

Design and colors:

Fonts:

I used Nunito Sans, from Google Fonts

On fonts.google.com in the about section the description of the font is the following: Nunito is a well balanced sans serif typeface superfamily, with 2 versions: The project began with Nunito, created by Vernon Adams as a rounded terminal sans serif for display typography. Jacques Le Bailly extended it to a full set of weights, and an accompanying regular non-rounded terminal version, Nunito Sans.

Sans-serif is used as the default backup font in case when Nunito Sans was not possible to load.

Colors:

  • #4284A4 #4284A4 - Primary background color

  • #60a0bf #60a0bf - Button hover color, Form input field label color, Datepicker hover color

  • #5B8BA3 #5B8BA3 - 404 page text block background color

Back to Top

Wireframes:

Initial Wireframes:

Originally on the home page I wanted to have one background picture and 3 of our latest donated books, but then I discovered Parallax (Materialize). Parallax is an effect where the background image is moved at a different speed than the foreground content while scrolling, so I decided to use Parallax instead.

Mobile View - Home

Mobile View - Donation

Desktop View - Home

Desktop View - Donation

Final Wireframes:

Mobile View - Home

Mobile View - Donation

Mobile View - Books

Mobile View - Books Admin View

Desktop View - Home

Desktop View - Donation Admin View

Desktop View - Books

Desktop View - Books Admin view

Back to Top

Features:

Open Graph (OG):

I shared Konvkucko's link with Messenger as I wanted the app to be tested on more different devices. When a link is shared there is a nice feature: a little preview of the link’s content, with title, short description and an image of the designated page. This data comes from scraping the link for Open Graph (OG) data. I added og meta tags to my base.html and used Sharing Debugger (facebook developer tools) to debug.

Link to Ireland Libraries

On Books page user can check more details about each book by clicking the View button next to the book. This leads the user to the book detail page, where the Borrow this book! button takes the user to Libraries Ireland page, and after login user can request the book.

Features Left to Implement:

  • As the application is about Hungarian books, for Hungarian families living in Ireland I plan to translate it Hungarian.

  • I would like to add a search bar, where users can search books by author, title and age category.

Back to Top

Technology Used:

  • Required: HTML, CSS, JavaScript, Python+Flask, MongoDB

Languages, Frameworks, Editors & Version Control:

  • HTML5
  • CSS3
  • JavaScript
  • Python
  • Materialize Framework: Used the Materialize framework for grid system, structuring layout, cards, forms, button styling and responsive navigation bar.
  • Flask Used Flask framework to compile modules and libraries.
  • jQuery: Used to initialize elements of Materialize framework. For the home page (Parallax), Navbar collapse, datepicker.
  • VSCode: Was used as a code editor.
  • Git: Version control.
  • Github Used as a Git repository hosting service
  • Heroku Is a container-based cloud Platform, I used Heroku to deploy this app.

Tools Used:

Back to Top

Testing

Throughout the development of the project, I carried out testing. I used the Chrome Developer Tools consistently.

The application structure and mobile-first layout was tested on Google Chrome, Firefox and Safari. The application was tested on the following smartphone devices: Xiaomi, OnePlus6, iPhone11 and iPhone5. And on iPad and BMAX tablets.

Functionality Test

Nr Test Action Before image After image Test result
1 Library Link Click on: Borrow this book! Book detail page Book detail page Library page Library Link Passed
2 add_book https://konyvkucko.
herokuapp.com/
add_book
add_book as admin Admin add_book as non admin Not Admin Passed
3 invalid book https://konyvkucko.
herokuapp.com/
book_detail/5e
invalid book Admin invalid book Not Admin Passed
4 405 page https://konyvkucko.
herokuapp.com
/insert_book
insert_book Admin insert_book Not Admin Passed
5 404 page https://konyvkucko.
herokuapp.com/
stg
404 page Admin 404 page Not Admin Passed
6 wishlist https://konyvkucko.
herokuapp.com/
wishlist
wishlist Admin wishlist Not Admin Passed
7 donation https://konyvkucko.
herokuapp.com/
donation
donation Admin donation Not Admin Passed
8 books https://konyvkucko.
herokuapp.com/
books
books Admin books Not Admin Passed

Responsiveness test

I used Am I Responsive as a responsiveness test.

Am I Responsive

Browser Compatibility test

Nr Browser Image Test result
1 Chrome Chrome Chrome Passed
2 Safari Safari Safari Passed
3 Firefox Firefox Firefox Passed

Code Validation

  • CSS was validated using W3C CSS Validation Service - Jigsaw, no errors were found.

  • HTML was validated using W3C Markup Validation Service.

  • Python code was validated using PEP8 online checker.

Defensive design

Defensive design was built into each template in app.py file.

  • Only admin can add/ delete/ edit books, these buttons are hidden from users.

  • Flash warnings were used when user entered already taken username at registration, or wrong password/username when signing in.

Back to Top

Credits

  • Book information (Summary, ISBN) are based on Moly

  • I used Datepicker from course mini project

  • I use Materialize for card reveal (Books page), but wanted to change it to reveal the summary by hover. I got the solution from stack overflow: https://bit.ly/39S4X6f It worked fine when I set it up, but after a while the cards were only revealed after clicking on them. The reason for this was that in main.js I put Datepicker code before the Card hover and there was an error in Datepicker, so the Card hover code was never reached.

Acknowledgements

  • Special thanks to my friends who made me add extra validations to my app.py. Originally when a user wanted to donate us a book and filled the form, the book was visible on the Donation page. I created an approved function, and now admin approval is needed before any new books are displayed. I also check if user is signed in and is admin, before they could add/ delete/ edit a book.

  • Many thanks to my mentor, Brian Macharia for support and advice throughout the project. You became my mentor when I started this milestone project and you always made sure to find the time for a mentor session when I needed you. Thank you!

Back to Top

DEPLOYMENT

CLONINNG - GITHUB

  1. Follow this link to my Repository on Github and open it.
  2. Click Clone or Download.
  3. In the Clone with HTTPs section, click the copy icon.
  4. In your local IDE open Git Bash.
  5. Change the current working directory to where you want the cloned directory to be made.
  6. Type git clone, and then paste the URL you copied earlier.
  7. Press enter and your local clone will be ready.

DEPLOY TO HEROKU

  1. On Heroku create an account and log in.
  2. Click new and create new app.
  3. Choose a unique name for your app, select region and click on Create App
  4. Under the Settings click Reveal Config Vars and set IP to 0.0.0.0 and the PORT to 5000
  5. Go to the CLI and type $ sudo snap install --classic heroku
  6. Type $ heroku login command into the terminal
  7. Create requirements.txt ($ sudo pip3 freeze --local > requirements.txt)
  8. Create a Procfile ($ echo web: python app.py > Procfile)
  9. Go back to Heroku, under Deploy find Existing Git repository and copy the command:$ heroku git:remote -a <app_name> Paste this into the terminal.
  10. (If repository was not created already, type:
  11. $ cd my-project/
  12. $ git init
  13. $ heroku git:remote -a <app_name>)
  14. Type $ heroku ps:scale web=1 into the terminal.
  15. Go back to Heroku, and at Settings copy https://<app_name>.herokuapp.com/
  16. In the terminal type git remote add http://<app_name>.herokuapp.com/
  17. Type git push -u heroku master
  18. In the app dashboard, under Settings click on Reveal Config Vars
  19. Set "MONGO_URI" and "MONGO_DBNAME" and "SECRET_KEY"
  20. Once the build is complete, go back to Heroku and click on Open App

Back to Top

Disclaimer

This project was created for educational use only.

Back to Top