Shelter allows users to browse and report the newest and most necessary outdoor gear on the market.
Being outside and living an active life is a lot of fun. And even if you don't need a lot to be enjoying the outside I am impressed by all the innovative little (and big) gear innovations on the market. I always try to find useful gadgets and tools to make the best of camping trips and hiking adventures.
This site is the third of four Milestone Projects that made up the Full Stack Web Development Course at Code Institute. The core reuqirements focus on bulding a fullstack site with the use of HTML, CSS, JavaScript, Phython (incl. Flask) and MangoDB. The final result is hosted on Heroku.
The idea is to build a community based outdoor gear & gadgets collection where content is generated by the community and the site owner themselves. Each author is in control of their own personal postings and the site admin can choose specific postings to be in the featured feed.
The following user stories were defined to outline the needed feature set.
- As a user I can browse gear postings, so that I can find the latest trends and innovation from the outdoor industry.
- As a user I can sign up, so I can add postings to the site.
- As a user I can log in, so that I can add postings with my account.
- As a user I can manage my own postings, so that I have full control over my posts.
- As a user I can log out from the site, so that I can access the site even on public devices (e.g. library).
- As a user I can delete my account, so that I am in total control of my account data. (AC: account is deleted from users db, postings remain in gear db)
- As a user I can access details from a posting, so that I can see the whole set of information.
- As a user I can search the site, so that I quickly find equipment or special postings.
- As a user I can see the latest 6 postings on the landing page, so that i quickly notice new gear recommendations.
The wireframes were created in Figma. Figma is a cloud based desing tool which allows you to rapidly create prototypes, wireframes and layouts (www.figma.com)
The logo represents the flame of a campfire - which people love to gaze into and enjoy the crackling sound of burning wood.
Screenshot | |
---|---|
Desktop Wide | |
Medium | |
iPhone |
Screenshot | |
---|---|
Desktop Wide | |
iPad Landscape | |
iPad Portrait | |
iPhone |
The following differences developed during creation:
- Only show first letter of username instead of first initials of first- and lastname
- Featured cards where displayed in carousel instead of horizontal cards
- instead of notifications icon add gear icon was implemented
- blog site was exchanged for about page
The color scheme was chosen with the goal to represent natural outdoorsy colors which reminds the visitor of the deep blue ocean, forrest full of green trees and some sunshine.
Color Codes:
- Blue #033F63
- Green #288666
- Green Pastel #7C9885
- Olive #B5B682
- Yellow #FEDC97
- Offwhite #F9F7F2
The site is based on three data collections. The gear collection holds all the necessary data for the gear postings/recommendations. The categories collection manages the available categories for postings. The users collection handles the users credentials and its status.
Example Data | Data Type | |
---|---|---|
_id | ObjectId(5f76e...809c) | ObjectID |
model | The Cave | String |
brand | Heimplanet | String |
description | This is a tent. The structure is held by air pipes. It is a very robust setup. |
String |
score | 5 | String |
category_name | Camp | String |
datecreated | 2020-09-30 | String |
author | peter | String |
Example Data | Type | |
---|---|---|
_id | ObjectId(5f76e...809c) | ObjectId |
category_name | Camp | String |
Example | Type | |
---|---|---|
_id | ObjectId(5f76e...809c) | ObjectId |
name | peter | String |
password | Binary('JDJiJDEyJERJNHMvM...iRU5lSlVIa0RZQlpiQmlDaVJT', 0 | Binary |
date_registered | 2020-10-06 | String |
is_admin | false | Boolean |
The following list of features was created before the actual implementation:
- Sign up
- Log in
- Log out
- Delete account
- Search gear
- Browse gear
- Create posting
- Edit posting
- Delete posting
- Create Categories
- Edit Categories
- Delete Categories
These features made it into the MVP:
- Sign up
- Log in
- Log out
- Delete account
- Search gear
- Browse gear
- Create posting
- Edit posting
- Delete posting
The following features would be great for expansion stages after the initial market validation:
- Server Side Validation to increase Security
- Create Categories
- Edit Categories
- Delete Categories
- Add Gear to "My List" to create own "Shelter"
- Use Flask-Login for session and user management (increase security & handle password recovery)
- File Upload for pictures to avoid external dependencies and copywrite
- Image Caroussel for the gear details if more than one image was uploaded
- Autocomplete for Search-Field
- HTML5
- CSS3
- Python
- PyMongo
- Flask
- Jinja
- MongoDB
- Bootstrap 4.5.2
- Gitpod
- Git Version Control
- GitHub
- Heroku
Summary of test results:
Testcases / Device-Browser-Setup | iPhone Safari |
iPhone Chrome |
iPad Safari |
iPad Brave |
Mac Safari |
Mac Chrome |
---|---|---|---|---|---|---|
Sign up | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Login a) Happy path b) Wrong password c) Wrong Username |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
Search | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Add Posting | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Edit Posting | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Delete Posting | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Display Gear Details a) Featured Items b) Recent Post c) Gallery |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
✅ ✅ ✅ |
Browse categories from Navbar | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Navbar logged in | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Navbar logged out | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Log out | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Delete Account | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Sign Up button
- Choose username
- Choose password
- Click Sign Up button
- User should be logged in
Happy Path:
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter username
- Enter password
- Click log in button
- User should be logged in
Wrong Password:
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter username
- Enter wrong password
- Click log in button
- You should be informed that the password is wrong
Username does not exist:
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter non-existing username
- Enter non-existing password
- Click log in button
- You should be informed that the user does not exist
Happy/Unhappy Path
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Type text into Search field and hit enter or press button
- New Page with Search-Results should open 5a. If no Results exist --> Inform User about it 5b. If Result exist --> You should see Gear Cards
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter non-existing username
- Enter non-existing password
- Click log in button
- Click Add Gear Button on top right corner
- New Site with Form should open
- Fill out Form
- Submit posting
- Your post should be visible in your profile
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter non-existing username
- Enter non-existing password
- Click log in button
- Click on your Avatar on top right corner
- Choose post from your Profile via the Edit button
- Make change to the posting and hit stackoverflow
- Changes should be visible in your profile
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter non-existing username
- Enter non-existing password
- Click log in button
- Click on your Avatar on top right corner
- Choose post from your Profile via the Delete button
- Confirm your choice to delete
- Post should be gone from overview
For Featured Items
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Click on Carousel
For Recent Post
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Scroll Down to Recent Post
- Click Details button
- You should see the details
For Gallery
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Navigate to Gallery
- Click Details button
- You should see the details
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Scroll Down to Footer
- Click on Category
- New site should open with the category as header and related postings
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter username
- Enter password
- Click log in button
- Sign Up & Login Button should be replaced with Add Gear & Avatar Button
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter username
- Enter password
- Click on Avatar Button
- Press Logout Button
- Sign Up & Login Button should be visible instead of Add Gear & Avatar Button
- Open Browser
- Visit https://gearshelter.herokuapp.com/
- Press Login button
- Enter username
- Enter password
- Click on Avatar Button
- Click on Delete Account
- You should be logged out and should not be able to login again with the credentials you used before
- Code Formatting from Pythoniter Pretty Python: https://pythoniter.appspot.com
- Ran code through http://pep8online.com/ Before: After:
- Checked every page and subpage for HTML Validation Errors: https://validator.w3.org
- Checked the https://jigsaw.w3.org/css-validator/#validate_by_input+with_options
- sizing of images in caroussel could be harmonized for future development steps
- form a code perspective the rendering of the delete post modal in the myprofile page could be enhanced through the use of javascript to inject the gear.id and remove the rendering of one modal per post.
This site is deployed to heroku and the versioning was done with git and the Repository is hosted on Github.
- Dedicated MongoDB (Sign up at www.mongodb.com)
Official Github Documentation on cloning a repositiory: https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository
- Navigate to Mainpage of the repository
- Click on "Code" button
- Choose "Clone with HTTPs" & copy URL
- Open Terminal
- Change the current working directory to prefered location
- Type git clone and past copied URL
git clone https://github.com/p0wen/shelter.git
- Press Enter to create local Clone
- Make sure your environment supports python3 -
- Type
pip3 install -r requirements.txt
into Terminal - Create env.py, .env and .gitignore and add the first 2 to git ignore
- Fill env.py with the following data:
from environs import Env
env = Env()
env.read_env()
# Override in .env for local development
DEBUG = env.bool("FLASK_DEBUG", default=False)
SECRET_KEY = env.str("SECRET_KEY")
# MONGO Connection
MONGO_DBNAME = env.str("MONGO_DBNAME")
MONGO_URI = env.str("MONGO_URI")
- Fill .env with the following data:
DEBUG=true
MONGO_DBNAME="<INSERT NAME OF YOUR COLLETION>"
MONGO_URI="mongodb+srv://<INSERT USERNAME>:<INSERT PASSWORD>@<INSERT CLUSTERNAME>.zbpbq.mongodb.net/<INSERT COLLECTION NAME>?retryWrites=true&w=majority"
SECRET_KEY="<INSERT SECRET_KEY>"
- Run the application locally by entering
python3 app.py
into your terminal
- Log in to your Heroku account and create a new App.
- Set the environment variables in Settings > Reveal Config Variables
- The following Variables must be set
MONGO_URI = mongodb+srv://<INSERT USERNAME>:<INSERT PASSWORD>@<INSERT CLUSTERNAME>.zbpbq.mongodb.net/<INSERT COLLECTION NAME>?retryWrites=true&w=majority
MONGO_DBNAME = <INSERT YOUR COLLECTION NAME>
SECRET_KEY = <INSERT YOUR SECRET KEY>
IP = 0.0.0.0
PORT = 5000
- Create requirements.txt from your project with the help of
pip3 freeze --local > requirements.txt
- Create a Procfile
echo web: python app.py > Procfile
- Commit changes to Git
git add .
followed bygit commit -m ""
- Log in to heroku from your terminal
heroku login
- Add exisitng repository to Heroku
heroku git:remote -a <your repository>
- Push changes to Heroku
git push heroku master
- Visit the app url from heroku and check out your great site!
Content was written by me - only the integrated image url's are referencing to various sites
- Logo created by me - basis was the github open source icons form figma https://www.figma.com/file/PVcwIwp9dQCVSTDPlZ008G/Octicons---GitHub's-icon-set-(Community)?node-id=176%3A0
- Tutor guidance
- Mentor assistance
- Code Institute Community on #slack
- stackoverflow and medium for comprehensive content
- Code Institutes Task Manager Project was a great foundation to understand the basic CRUD functionalities
- differences between mongodb and mysql https://medium.com/@rsk.saikrishna/when-to-use-mongodb-rather-than-mysql-d03ceff2e922
- Manual on how to work with env variable - https://pypi.org/project/environs/
- how to make data available for more than one interaction - https://stackoverflow.com/questions/57537866/two-for-loops-in-one-html-page-using-jinja-not-working
- how to work with loop.cycle webforefront.com/django/usebuiltinjinjastatements.html
- how to integrate a search function https://dzone.com/articles/flask-101-how-to-add-a-search-form
- how to search through collections https://stackoverflow.com/questions/2824157/random-record-from-mongodb
- how to work with $sample https://docs.mongodb.com/manual/reference/operator/aggregation/sample/
- building a search field with button included https://www.codeply.com/go/ioPsDfyCBc
- how to style active element in nav https://stackoverflow.com/questions/21991820/style-active-navigation-element-with-a-flask-jinja2-macro
- refresh on css skills https://stackoverflow.com/questions/43119635/fill-div-with-image-without-stretching
- how to make sticky footer really sticky https://medium.com/@mschenk22/bootstrap-4-footer-at-bottom-not-sticky-dynamic-footer-height-b37ccec837e2ss
- how to check if something is empty https://www.shellhacks.com/jinja2-check-if-variable-empty-exists-defined-true/
- sorting https://www.w3schools.com/python/python_mongodb_sort.asp
- where to position logout button https://uxdesign.cc/cognitive-behaviour-how-ux-designers-make-use-of-it-in-design-b9490b974dc1
- footer based on this template https://codepen.io/scanfcode/pen/MEZ
- table for read generated with the help from https://www.tablesgenerator.com/markdown_tables#
- Table of Content generated with https://ecotrust-canada.github.io/markdown-toc/
- create delete modals for each existing item instead of using JavaScript https://stackoverflow.com/questions/45874906/flask-and-javascript-confirm-before-deleting