Giter Club home page Giter Club logo

travel-blog-2's Introduction

Wunderlust Travel Blog

Portfolio Project 4 - Code Institute

Wunderlust is a travel blog and community where anyone who loves to travel can view and share their travel stories. The content of the posts are based on places I have been lucky enough to visit and I wanted to include some of my highlights to draw the users in.

image

View the live project here

UX

User Stories

  • As a Site Admin I can register a superuser account so that I can manage and interact with site content
  • As a Site Admin I can create draft posts so that I can finish writing the content later
  • As a Site Admin I can create, read, update and delete posts so that I can manage my blog content
  • As a Site Admin I can approve or disapprove comments so that I can filter out objectionable comments
  • As a Site Admin I can edit posts so that I can make changes to the post
  • As a Site Admin I can delete posts so that I can remove them if I want to
  • As a Site User / Admin I can view the number of likes on each post so that I can see which is the most popular or viral
  • As a Site User / Admin I can view comments on an individual post so that I can read the conversation
  • As a Site User I can register an account so that I can comment and interact with posts
  • As a Site User I can leave comments on a post so that I can be involved in the conversation
  • As a Site User I can click on a post so that I can read the full text
  • As a Site User I can view a list of posts so that I can select one to read
  • As a Site User I can like or unlike a post so that I can interact with the content
  • As a Site User I can view a paginated list of posts so that easily select a post to view
  • As a Site User I can update my profile so that other users can view my details
  • As a Site User I can create draft posts so that I can finish writing the content later
  • As a Site User I can edit posts so that I can make changes to the post
  • As a Site User I can delete posts so that I can remove them if I want to
  • As a site user I can upload photos so that include these in my post
  • As a Site User I can delete my comments on a post so that I can remove these from the site
  • As a Site User I can edit comments on a post so that I can make corrections to my comments
  • As a Site User I can update my profile so that other users can view my details

I used GitHub Projects to create a Kanban board to manage the planning and implementation of the functionality I wanted to include in this project. Click here to see my project board.

Travel Blog Kanban Board

Strategy

I wanted to create a platform where users can share their travel stories and is aimed at anyone who has a love of travel.

  • People who have been travelling
  • People looking to go travelling
  • Anyone with a love of travel

Scope

For the users I wanted to provide them with easy naviagation and a brief introduction to the site and eye catching images for the posts. The site has responsive design so should function correctly across various devices such as, Mobiles, Tablet, Laptop and Desktop.

Structure

This site has been designed with simplicity in mind, each page only has key information on it so that the user can find what they want quickly.

Skeleton

The wire frames were created using Balsamiq.

Mobile View

mobile_wf_1

mobile_wf_2

mobile_wf_3

Tablet View

tablet_wf_1

tablet_wf_2

tablet_wf_3

Laptop View

laptop_wf_1

laptop_wf_2

laptop_wf_3

Surface

Images

Pixabay

Whitsunday Island image can be found on Pixabay here

whitsunday-island-796006_1920

White Temple image can be found on Pixabay here

chiang-rai-2371951_1920

Angkor Wat image can be found on Pixabay here

angkor-wat-425689_1920

Hoi An Lanterns image can be found on Pixabay here

market-2494520_1920

Vecteezy

Ha Long Bay image can be found on Vecteezy here

vecteezy_coastal-rocks-and-blue-water_2055163

My Photo

This is my own photograph taken whilst travelling.

Default Image

whitsundays_2

Colours

Adobe Color Extract Theme

The colours were chosen by using Adobe Color Extract Theme from an image of Whitsunday Island I found on Pixabay.

adobe_color_theme_11

Contrast Grid - Eightshapes.com

Once the colours were chosen I used a contrast checker to decide which colour worked best for the Navbar and Footer with white text.

color_theme_11

MyColor.Space

I also used colorspace to search for other shades that worked well with the Navbar/Footer colour #07668C and decided to use colour #A2E5FF for the main body background colour.

color_space_1

Typography

I decided to use ‘Pacifico’ for the Wunderlust branding and ‘Roboto’ and sans-serif for the remaining text.

Technologies

Languages

  1. HTML
  2. CSS
  3. Javascript
  4. Python

Libraries, Frameworks and Programmes Used

  • Google Fonts
  • Font Awesome
  • Balsamiq
  • GitHub / GitPod
  • Heroku
  • Django
  • Bootstrap
  • Cloudinary
  • Summernote

Features

Existing Features

Homepage

  • The homepage shows the Navbar, About Section, Posts and the Footer

homepage

Navbar
  • The Navbar on loading shows Home, Register and Login

navbar

  • The Navbar when the user is logged in shows Home, Logout and New Post

navbar_signed_in

About Section
  • The about section explains what this site is for

about_section

Posts
  • The homepage shows 6 posts with the option to go to the next page if there are more than 6 posts on the site

homepage_posts

Footer
  • The footer shows the site name/brand and links to social media platforms which all open in a new page

footer

Post Detail View

Post Header
  • Shows the post title, author and date created/updated
  • Shows the post image

post_detail_header

Post Content
  • Shows the post content
  • Shows the number of likes for the post
  • Shows the number of comments for the post

post_detail_content

  • If the User is the Author of the Post they have the option to Edit or Delete their post

post_detail_edit_delete_options

  • When the User clicks on the Edit button they are taken to the form view so they can edit their post

edit_post

  • When the User clicks on the Delete button they are taken to another page to confirm deletion

delete_post

Comments
  • Show the Author, Date Created and the Authors Comments

post_detail_comments

  • If the User is logged in they have the option to leave a comment

post_detail_leaving_comment

  • When the user submits a comment a message will appear advising them that their comment is awaiting approval

post_detail_comment_awaiting_approval

New Post

  • Takes the user to a form for them to create their post

new_post

  • When the user submits their post they will get redirected to the homepage and a message will appear

post_created_message

Register

  • When the user clicks on Register in the Navbar they are redirected to a sign up page where they can enter their details to create an account

sign_up

Login

  • When the user clicks on Login in the Navbar they are redirected to a sign in page where they can enter their account details
  • When the user has signed in they are redirected to the homepage

sign_in

Sign Out

  • When the user clicks on Sign Out in the Navbar they are redirected to a sign out page to confirm if they want to sign out
  • When the user confirms the sign out they will be redirected to the homepage

sign_out

Future Features

  • Edit comments
  • Delete comments
  • User profiles

Testing

I have manually tested this project by doing the following:

  • Run the code through the validators and confirmed there are no problems
  • Testing the site from my gitpod workspace and my deployed site through Heroku
  • I have also tested this site on my i-Phone, i-Pad and laptop

When the site is loaded the Navbar displays Home, Register and Login. The About Section is displayed with a Welcome to Wunderlust message and the posts are displaying correctly

homepage

When the user clicks on Register in the Navbar they are taken to a Sign Up page

Signup

After the user has registered they are redirected to the homepage and a message appears to confirm successfully signed in

register_message

When the user clicks on Log In in the Navbar they are taken to a Sign In page

SignIn

After the user has signed in they are redirected to the homepage and a message appears to confirm successfully signed in

sign_in_message

When the user clicks on Sign Out they are taken to a page to confirm sign out

SignOut

After the user has signed out they are redirected to the homepage and a message appears to confirm they have be signed out

sign_out_message

When the user clicks on a Post it redirects them to the posts detail page which displays the post content, likes and comments

post_detail_1

post_detail_2

If the user is signed in they can intereact with the post by pressing the like button or comment on the post

post_detail_likes

post_detail_leaving_comment

When the user has submitted a comment a message is displayed to say their comment is awaiting approval

post_detail_comment_awaiting_approval

If the user is the author of the post they can choose to Edit or Delete the post

post_detail_edit_delete_options

When the user clicks on the Edit button they are redirected to the form view so they can edit the post

edit_post

When the user clicks on the Delete button they are redirected to another page to confirm the deletion

delete_post

When the post has been deleted they are redirected to the homepage and a message is displayed to confirm deletion

post_deleted_message

Site Admin Panel

As a Site Admin I can create draft posts so that I can finish writing the content later

draft_post_admin

As a Site Admin I can approve or disapprove comments so that I can filter out objectionable comments

admin_comments_approve

admin_delete_comment

admin_delete_comment_confirmed

As a Site Admin I can edit posts so that I can make changes to the post

admin_update_post

admin_update_post_confirm

As a Site Admin I can delete posts so that I can remove them if I want to

delete_post_admin

delete_post_admin_confirm

delete_post_admin_confirmed

Bugs

  • When the user submits a comment and the page reloads you have to scroll down to see the message "Your comment is awaiting approval"

post_detail_comment_awaiting_approval

  • When the user edits a post the bootstrap class properties appear in the content box, this has also been flagged in the HTML validator testing for the post_detail page

edit_post_bug

  • I was having trouble getting the delete function to return to the homepage, I found the solution on Stackoverflow here

  • The delete success message was also not displaying and I found the solution on Stackoverflow here

  • When the user created a post the image upload function was not working, after speaking to Code Institute Tutor Support the solution was to include an enctype attribute in my form <form method="POST" enctype="multipart/form-data">

  • I was also having problems getting the slug field to pre-populate when the user created a post outside of the admin panel. I decided to remove the slug field from the create/update post view and have it pre-populate in the backend. The soultion was found on Learn Django here

Validator Testing

  • W3C Markup Validation

I have tested the home, register, login, sign out, new post, edit post and delete post pages with no errors returned.

html

The post_detail page has an error relating to the bootstrap class card-text, which is also causing a bug in the edit post page

html_post_detail

Page Source code

html_post_detail_page_source

My code

html_post_detail_my_code

  • W3C CSS Validation

css_validator

  • Lighthouse

lighthouse

  • PEP8

pep8

Deployment

Deploying on Heroku

To deploy this page to Heroku from its GitHub repository, the following steps were taken:

  • Create the app in Heroku

  • Select "New" and "Create new app".

  • Name the new app and click "Create new app".

  • In "Settings", click "Reveal Config Vars" and input the folloing.

    • CLOUDINARY_URL
    • DATABASE_URL
    • SECRET_KEY
  • Click on "Deploy" and select your deploy method and repository.

  • Click "Connect" on selected repository

  • Click "Deploy Branch" in the manual deploy section. -Heroku will now deploy the App.

Development Environment

  • Create env.py and it needs to contain these variables:

    • os.environ["DATABASE_URL"] = "postgres://....."
    • os.environ["SECRET_KEY"] = "....."
    • os.environ["CLOUDINARY_URL"] = "....."
    • os.environ["DEVELOPMENT"] = "True"
    • os.environ["CLOUDINARY_CLOUD_NAME"] = '.....'
    • os.environ["CLOUDINARY_API_KEY"] = '.....'
    • os.environ["CLOUDINARY_API_SECRET"] = '.....'
  • Create requirements.txt
    pip3 freeze --local > requirements.txt

  • Create Procfile

Forking the Repository

By forking the GitHub Repository we make a copy of the original repository on our GitHub account to view and/or make changes without affecting the original repository by using the following steps:

  • Log into GitHub or create an account.
  • Locate the GitHub Repository.
  • At the top of the repository, on the right side of the page, select "Fork"
  • You should now have a copy of the original repository in your GitHub account.

Creating a Clone

How to run this project locally:

  • Install the GitPod Browser Extension for Chrome.
  • After installation, restart the browser.
  • Log into GitHub or create an account.
  • Locate the GitHub Repository.
  • Click the green "GitPod" button in the top right corner of the repository. This will trigger a new gitPod workspace to be created from the code in github where you can work locally.

Credits

  • Images were taken from Pixabay and Vecteezy
  • Icons were taken from Font Awesome
  • Code Institute for the creating the gitpod-full-template and the I Think Therfore I Blog walkthrough project which this was based on
  • All content in the pages has been written by me

Acknowledgements

I would like to thank my course mentor Daisy Mc Girr for her support and guidance throughout the project and Gemma and Scott from the Code Institute tutor support who helped me with my image upload issue.

travel-blog-2's People

Contributors

lucy-glanville-brown 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.