Giter VIP home page Giter VIP logo

whitehair's Introduction

This is a proverbs website created in Django as a 4th portfolio project for the Full stack Software Develompent course from Code Institute

A proverb is a simple and insightful, traditional saying that expresses a perceived truth based on common sense or experience.

Whitehair website is designed to be the place where anyone can join to share and enjoy proverbs from all over the world

Mockup image

Table of contents

  1. UX
  2. Features
  3. Technologies Used
  4. Testing
  5. Deployment
  6. Credits

UX

Whitehair website was created using a Design Thinking and Agile approach.

For the Agile methodology GitHub Projects was used as a kanban board. The user stories were added as issues, prioritised and automated to move to "To Do" column in Whitehair project. The issues are assign to the contributors (or contributor) and can be commented on.

In "To Do" column individual task cards with subtasks checkboxes were also added to better keep track of the project's workflow

From "To Do" column the cards were moved to the "In progress" column based on current tasks

From "In progress" column, the cards were moved to "Done" column when the tasks were finished and tested

At the end of the project the issues can be closed. The remaining issues, if there are any, can be reassesed and relabeld (as future feature for example). In this project, the issues were not closed to be able to be used as proof of work.


User Stories

The user stories below were used as a guide to complete this project. Other user stories labeled "Should Have" were created but they were not implemented at the time of submission.

As a new user:

  • I can view a proverb so that I can read it and enjoy it
  • I can click on a proverb so that I can see the meaning
  • I can view a list of proverbs so that I can choose one to read
  • I can register an account so that I can interact better with the website

As a registered user:

  • I can create, read, update and delete proverbs so that I can contribute to the website content

As site admin:

  • I can log in with all permissions so that I can manage both users and proverbs

Back to top


Wireframes

The wireframes were created in Balsamiq. They were used to set an impression of how the website should look. Only 3 basic wireframes were made for home page, login and proverbs because other use simple forms or they have a simple style.

Home page

home page

Proverbs page

home page

Login page

home page

Back to top


Database schema

A PostgreSQL database was used with one custom table "Proverb" and Django's "User" table.

Content field is for the proverb's content and has a max 200 characters to accomodate longer proverbs. They are usually short but the longest found was around 150 characters. This field is Unique

Upon Django doc research a custom id was not created, instead the autogenerated one was used.

The author field id Foreign Key and is Django's User's username. After some bugs the field was set as not editable. Logic set its value in app.

DB Schema

Back to top


Style and colours

Whitehair website uses minimum styling and colours and it had no images at the time of submission.

Materialize classes and features were used to generate the look and the colours of website.

Back to top


Features

Existing Features

  • Proverb

Whitehair's homepage contains a randomly generated proverb in a Materialize collapsible accorion popout. On hover the cursor changes to indicate an action. On click Collapsible's body appears to show the meaning of the proverb.

Hompage

Back to top


  • List of all proverbs

This feature display for user a list of all proverbs in a Materialize collapsible accorion popout. If the user is logged the list adds buttons for CRUD operations.

List of all proverbs

Back to top


  • Add proverbs

If the user is logged a new menu item "Add proverbs" apperears. That leads to add proverbs page. Here a user can add his own proverbs in a ModelForm rendered as a Materialize form. The author field is missing here, but logic was implemented so that the curent user is added as author. User friendly lables were used in this form.

Add proverb

Back to top


  • Manage own proverbs

If the user is logged the list of proverbs adds buttons with font awsome icons for CRUD operations. Here the user can edit or delete his own proverbs.

The pencil button leads to a prepopulated edit form.

The bin button deletes the proverb and leads the user to the main page.

Important Defensive programing

On deletion there is no feedback or warning. A modal was considered to remind the user that this is a permanent delete from the database, but at the time of submission this functionality was not added yet.

Edit proverb

Back to top


  • Navigation

A Materialize mobile collapsible navbar was used with limited options for an unregistered user.

New user navbar

When the user is logged in extra options apper in the menu.

Logged user navbar

On small screens the navbar changes into a sidebar menu with a burger icon.

Mobile navbar

Back to top


  • The footer

Whitehair website has a simple sticky footer with a disclaimer. More content (like social media icons, misc info or forms) can be added to the footer, but it wasn't used in this proverb as it's behind the scope of this project.

Back to top


  • 404 and 500 error pages

404 and 500 pages were added to the project to guide the user in case of problems. The design of this pages is very simple as it wasn't considered important for this project. More important is The method to implement this pages in Django.

404 page

404 page

500 page

500 page

Back to top


  • Site admin

Django admin was used in this website with no customisations.

Future Features

  • Favorite proverbs

This was initialy priritised as must have, however at the day of submission it was not implemented, so it was reprioritised as should have.

The heart icon was left intentionally. A link to comming soon page can be implemented.

Back to top


  • Other future features

    • categories (coding, animals, love, military, family, wise and many more)
    • languages
    • share button
    • admin approved proverbs

Back to top


Technologies Used

Back to top


Testing

Testing was done manually. Chrome Dev Tools was used extensively first to see how everything looks (positioning and styling) and for responsivness.

Whenever there were errors in code I would Chrome Dev Tools was used for debugging.

Found bugs

  • A 500 error

Random id error

On the home page a random id was used to generate a random proverb on each refresh. The initial logic used random method on an integer set from 1 to max number of records. This worked up until proverbs were modified or deleted.

Random id original code

The logic was changed by generating a list of real ids and randomize that

Random id new code

  • Static files not loading in local workspace

This was fixed with the help of Tutor Assistance. Thanks Ger and Sean

  • Materialize forms

There was an issue with Materialize forms not loading properly. Upon Google research Django-materializecss-form was installed and used to fix this problem.

  • ModelForm Issue

There was an issue with rendering the ModelForm in a sense that the primary key author could not be removed from the model form. This allowed the user to select a different user as author. Upon Django doc research the author field was set as uneditable and the author was set from logic as the current user

  • Other issues

Django fought back every step of the way so extensive Django doc and Google research was necessary. This delayed the project unexpectedly.

Back to top


Deployment

The project's repo was hosted on GitHub and it was deployed on Heroku, because GitHub Pages can only handle front-end files.

  • Create a Heroku app
  • Attach the PostgreSQL database
  • Prepare environment and settings.py
  • Set up Cloudinary for static files
  • Connect Heroku To GitHub
  • Set up automatic deployment

Back to top


Credits

Content

Code Institute's Gitpod full template was used to to create this project.

Code Institute's walkthrough projects "Hello Django", I "Think therefore I blog" and the Flask walkthrough app.

Acknowledgements

Thanks to my mentor for help, suggetions and time

Thanks to Ger and Sean from CI Tutor assistance for help with static files not loading

Thanks to my family, friends and peers for suggestions, reviews and feedback.

Back to top


Disclaimer: This project is for learning purposes only

whitehair's People

Contributors

christ-cc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.