This is the main website for Square Circles Holiday Park. A facility hosting guests who need a place to stay with their caravan, mobile home or tent. Square holiday park also facilitates cabins.
The website is designed to be responsible and accessible on a range of devices, making it easy to navigate for potential campers and team members.
- Square Circle Holiday Park
- Description
- Table of Contents
- User Experience (UX)
- Features
- Technologies Used
- Data models
- Testing
- Deployment
- Development
- Credits
- As a customer, I want to be able to view and list all products so that I can decide what to purchase. (screenshot)
- As a customer, I want to be able to view the totals of my purchases so that I can spend a little more without over budget. (screenshot)
- As a site user, I want to come in direct contact so I can ask any questions. (screenshot)
- As a site user, I want to get an error message if the url is wrong, so I know that the page does not exist. (screenshot)
- As a site user, I want to see the current weather so I know if I need to wear a full jacket or shorts when visiting. (screenshot)
- As a site user, I want to use an interactive map, so I can get an overview of the different pitch types. (screenshot)
- As a site user, I want to find the park on social media, so I can follow the park and it's visitors. (screenshot)
- As a site user, I Want to be able to register for an account so that I can have a personal account and be able to view my details. (screenshot)
- As a site user, I Want to be able to login and logout so that I can access my personal account information. (screenshot)
- As a site user, I Want to be able to recover my password in case I forget it so that I can recover access to my account. (screenshot)
- As a site user, I Want to be able to have a personalized user profile so I can view my personal order history and reservations. (screenshot)
- As a site user, I Want to be able to list the products so that I can quickly identify the best priced product and identify the category.
- As a site user, I Want to be able to sort the list of products so that I can quickly find what I'm looking for.
- As a site user, I Want to be able to search for a product by name or description so that I can find a specific product I'd like to purchase.
- As a site user, I Want to be able to see what I've searched for and the number of results so I can quickly see whether the product I want is available.
- As a site user, I want to check for availability based on dates, so I know if I can purchase a reservation that fits in my calendar.
- As a customer, I want to be able to schedule a reservation and put it into a basket. (screenshots: basket, schedule)
- As a customer, I want to be able to make purchases based on my basket items. (screenshot)
- As a visitor, I want to review and rate the facilities so I can let others know what I think. (screenshots: add review, reviews)
- As a site owner, I want to be able to administrate the reservations. (screenshot)
- As a cite owner, I want to be able to administrate the products the facilities has to offer. (screenshot)
Colors are selected with the help of the machine learning color generator Huemint
Typography on the website is selected and combined based on the deep learning project fontjoy.
- Assistant is the main font used throughout the whole website.
- Fira Sans is used for headers.
- PT Sans Caption is used for captions.
All wireframes can be found in the wireframes folder. They are all organized with bootstraps style prefix and descriptive name.
- Homepage Wireframe - (Large screen) (small screen)
- Products Pages Wireframes - (List of products) (Single product)
- Authentication Pages Wireframes - (Profile) (Register) (Sign in) (Password reset) (Change Password)
- Basket & Checkout Pages Wireframes - (Basket) (Checkout) (Checkout Success) (Availability popover)
- Interactive Map Page Wireframe - (Large screen)
- Reviews Page Wireframe - (Large screen)
- Responsive on all device sizes
- Interactive elements
- User registration and accounts
- Sorting and searching
- Purchasing and checkout
- Check in
- Review
- Interactive map
- Display weather
- Site chat
- Customer Reviews
- Django
- Django framework is used for this web app
- Bootstrap 5.1
- Bootstrap was used to assist with the responsiveness and styling of the website.
- Google Fonts
- Google fonts were used to import fonts into the style.css file which is used on all pages throughout the project.
- Font Awesome
- Font Awesome was used on all pages throughout the website to add icons for aesthetic and UX purposes.
- jQuery:
- jQuery came with Bootstrap to make the navbar responsive but was also used for the smooth scroll function in JavaScript.
- django-storages
- Used as a storage backend serving static files with aws S3.
- boto3
- Used to create, configure, and manage AWS services.
- dj_database_url
- Used to connect to database
- psycopg2-binary
- Used as PostgreSQL database adapter
- small.chat
- small.chat is used to create a on site chat button for site visitors to use
- Fontello
- Fontello is used to generate missing icons needed.
- django-allauth
- used for user account authentication.
- django-crispy-forms
- Used to control the rendering behavior of forms.
- Django-environ
- Used to handle environment variables.
- coverage
- Used to measure code coverage tests
- Stripe
- Used to make card payments
- OpenWeather
- API used to fetch weather
- open-weather-icons
- font used to render weather icons
- unicorn
- Used as a multi-platform, multi-architecture CPU emulator framework.
- daterangepicker
- Used to pick dates.
- django-starfield
- Used to render Stars instead of integers in forms and django admin.
- Git
- Git was used for version control by utilizing the GitPod terminal to commit to Git and Push to GitHub.
- GitHub:
- GitHub is used to store the project's code after being pushed from Git.
- Photoshop:
- Photoshop was used to create the logo, resizing images and editing photos for the website.
- Adobe XD:
- Adobe XD was used to create the wireframes during the design process.
- Visual Studio Code:
- Visual Studio Code was used as an Integrated development environment (IDE).
- dbdiagram.io
- Used to generate database overview images.
- ami.responsivedesign.is
- Used to generate the site screenshot
PostgreSQL is used to store all data in the production environment. It is also possible to disable production live database and use a local SQLite database instead by removing the .env variable DATABASE_URL
.
User Profile holds user information. Default data models from django-auth and django-allauth are also used to hold auth specific data.
field | type | description |
---|---|---|
_id | pk | unique record id |
user | fk | category record id |
default phone number | CharField | Holds product name |
Products hold product name, price and image information.
field | type | description |
---|---|---|
_id | pk | unique record id |
category | fk | category record id |
name | CharField | Holds product name |
description | CharField | Holds product description |
price | DecimalField | Holds product price |
image | ImageField | Holds product image |
Categories holds Categories name information.
field | type | description |
---|---|---|
_id | pk | unique record id |
name | CharField | Holds category name |
Pitch holds Pitch information.
field | type | description |
---|---|---|
_id | pk | unique record id |
product | fk | Holds product id |
name | CharField | Holds pitch name |
description | CharField | Holds pitch description |
electric | boolean | Holds pitch electric state |
plug | varchar | Holds pitch electric plug type |
graywaste | boolean | Holds pitch graywaste state |
fullwaste | boolean | Holds pitch fullwaste state |
water | boolean | Holds pitch water state |
tent | boolean | Holds pitch tent state |
seasonal | boolean | Holds pitch seasonal state |
Order holds every order made.
field | type | description |
---|---|---|
_id | pk | unique record id |
order_number | CharField | Holds order number |
user_profile | fk | User profile id |
full_name | CharField | User name |
EmailField | User email | |
phone_number | CharField | User phone number |
date | DateTimeField | Holds order date |
grand_total | DecimalField | Holds order grand total |
original_basket | TextField | Holds the original basket |
stripe_pid | CharField | Holds the stripe purchase id |
Order Line Item holds every line in each order made.
field | type | description |
---|---|---|
_id | pk | unique record id |
order | fk | Order id |
product | fk | Product id |
check_in | DateTimeField | Check in date |
check_out | DateTimeField | Check out date |
quantity | integerField | amount of pitches |
lineitem_total | DecimalField | total value of lineitem |
Review holds every site reviews made by users.
field | type | description |
---|---|---|
_id | pk | unique record id |
profile | fk | Holds profile key |
name | CharField | Name as displayed on review |
review | TextField | Review text from user |
rating | IntegerField | Rating value |
date | CharField | Review created date |
The W3C Markup Validator and W3C CSS Validator Services were used to validate every page of the project to ensure there were no syntax errors in the project.
- W3C Markup Validator - Results (Index Page) (Products Page) (Singe Product Page) (Basket Page) (Map Page) (Reviews Page)
- W3C CSS Validator - Results (base.css) (home.css) (checkout.css) (pitches.css)
Coverage is used for testing and coverage report.
to run a test use the terminal command coverage run manage.py test
in the root directory.
it's possible to generate a test with the terminal command coverage html
, a folder named coverage_html_report
is generated.
It's possible to read the report by opening the file /coverage_html_report/index.html
in a browser.
Site passed all tests OK with test report results.
Chrome Lighthouse has been used to measure performance of the site with the following results.
- add assets to basket by clicking +
- confirm that it is not possible to add more than available items.
- remove assets from baskets
- confirm that it is not possible to remove the last asset.
Feature passed this test
Checkout app unit tests don't test checkout with stripe and webhooks.
- set travel info.
- add product to basket.
- continue to checkout.
- add your details and make payment. (use card 4242 4242 4242 4242 as test)
- Make payment.
- Confirm success email is sent.
- Confirm Order is created correctly.
Feature passed this test
Home app unit test doesn't test error is data from weather provider.
- change weather url to an invalid url.
- confirm error message after home reload.
Feature passed this test
In settings.py, Email backend smtp
is tested in the Checkout App Tests.
In settings.py, Heroku Database integration
is tested by the following steps
- In admin, login with credentials and confirm no errors.
In settings.py, AWS Storage
is used as media and static files cdn, integration is tested by the following steps
- Goto to main url
- Confirm images and static files loads.
Feature passed this test
- As a customer, I want to be able to view and list all products so that I can decide what to purchase.
- Upon entering the site, users are greeted with a clean and easily readable navigation bar to go to the page of their choice.
- As a customer, I want to be able to view the totals of my purchases so that I can spend a little more without over budget.
- In the navigation bar the user can navigate to the current basket where the total cost is displayed.
- As a site user, I want to come in direct contact so I can ask any questions.
- On every page located in the bottom right of the current browser window there is a chat icon that can be pressed. By pressing the button a small chat window appears where the user can communicate with the park site staff.
- As a site user, I want to get an error message if the url is wrong, so I know that the page does not exist.
- if the user navigates to a faulty page a page not found message will automatically be visible.
- As a site user, I want to see the current weather so I know if I need to wear a full jacket or shorts when visiting.
- When entering the site the user can read the current weather in the
today's weather
section.
- When entering the site the user can read the current weather in the
- As a site user, I want to use an interactive map, so I can get an overview of the different pitch types.
- In the site's navigation bar the user can select
MAP
. - Above the interactive map the user can select parameters that will highlight the pitches with corresponding parameters.
- The site user can see the total of how many pitches have the current selected parameters updated automatically.
- It's possible for the site user to hover over each pitch to see details
- In the site's navigation bar the user can select
- As a site user, I want to find the park on social media, so I can follow the park and it's visitors.
- Within the footer located on every page there are links to the social media accounts, when used, links open up in a new browser window.
- As a site user, I Want to be able to register for an account so that I can have a personal account and be able to view my details.
- As a first time visiting site user it is possible to select the sign up button found in the navigation bar.
- By filling out and submitting the sign up form the user can be able to view future details.
- As a site user, I Want to be able to login and logout so that I can access my personal account information.
- From the navigation bar it is possible to select sign in.
- By filling out and submit the required parameters user will be logged into the site
- The navigation bar now have a
My Page
option the user can select to access account information - The navigation bar now also has the
sign out
option that can be selected. - From the sign out page user can press the sign out button to fully logout.
- As a site user, I Want to be able to recover my password in case I forget it so that I can recover access to my account.
- From the sign in page it is possible to select
forgot password
. - In the password reset form it is possible to provide a valid email address and press the
Reset My Password
button. - User will get an email containing a link to reset the password.
- Clicking the email link takes the user to the Password Reset Page, where a new password can be provided.
- From the sign in page it is possible to select
- As a site user, I Want to be able to have a personalized user profile so I can view my personal order history and reservations.
- On-site users
My Page
order history is available in a list format. - by clicking a history order, the user can view the order details.
- On-site users
- As a site user, I Want to be able to list the products so that I can quickly identify the best priced product and identify the category.
- The site navigation bar contains the main products for the site user.
- Each navbar product item displays the categories found in the top of the products page.
- As a site user, I Want to be able to sort the list of products so that I can quickly find what I'm looking for.
- On the products page there is a
Sort by
drop down button that can be used to sort the current list seen.
- On the products page there is a
- As a site user, I Want to be able to search for a product by name or description so that I can find a specific product I'd like to purchase.
- From the navbar it is possible to provide a search term and hit enter.
- All found products will be displayed.
- Title and description on each product will highlight the search term used.
- As a site user, I Want to be able to see what I've searched for and the number of results so I can quickly see whether the product I want is available.
- in the top of the products page the number of found items is displayed.
- As a customer, I want to be able to schedule a reservation and put it into a basket.
- As a site user it is required to set the site users travel information by clicking the
Check availability
button in the navigation bar or anyAdd to Basket
button. - In the popover date picker it is possible to first click the arrival date and then departure date. After clicking apply the new travel information is set.
- Available products in the selected travel information period will print the amount available if any within the product details.
- As a site user it is required to set the site users travel information by clicking the
- As a customer, I want to be able to make purchases based on my basket items.
- Site users can Add products into the basket.
- site users can select many equal products, if available on the same travel information dates selected.
- Site users can modify a product date range individually from the basket page.
- Site users can
Continue to Secure Checkout
and provide required information including card information to make a reservation purchase.
- As a visitor, I want to review and rate the facilities so I can let others know what I think.
- As a site user it's possible to navigate to
my page
and press the write review button. - After filling out the Add review form and Add the review the review is visible on the
reviews page
from the navigation bar. - site users can navigate to my profile and change any of the users reviews by clicking on the review and make changes to the review.
- site users can also delete any review created by the site user.
- As a site user it's possible to navigate to
- As a site owner, I want to be able to administrate the reservations.
- Site owners can use the the Django Admin Section of the site to administrate reservations.
- After sign in to Admin its possible to select Orders in the side panel and perform manual tasks needed.
- As a cite owner, I want to be able to administrate the products the facilities has to offer.
- Site owners can use the the Django Admin Section of the site to administrate Products Categories and pitches information from the Admin side panel.
- The Website was tested on Google Chrome, Microsoft Edge and Safari browsers.
- The website was viewed on a variety of devices such as Desktop, Laptop, iPhoneX.
- A large amount of testing was done to ensure that all pages were linking correctly.
- Friends and family members were asked to review the site and documentation to point out any bugs and/or user experience issues.
- On some mobile devices the interactive map is not perfect and manual zooming might be needed.
- Season Camping can be booked on any date and does not have fixed dates.
The project was deployed to Heroku using the following steps...
- Sign up or sign in at Heroku.
- From your page, create a new App with framework python.
- Add on Heroku PostgreSQL Resource with the steps in Database section.
- Add static hosting with the steps in the Static files section.
- On the Settings tab add all config vars from .env.example, do not add variables in the
Development
section. - Connect Heroku to your github repo and do a manual deploy.
- When deployment is done, navigate to the site url to test.
The project uses AWS S3 bucket as cdn for static files served on endpoint https://cdn.square-circles.s3-website-eu-west-1.amazonaws.com/
.
Full S3 documentation is available on aws documentation website
After AWS new user registration the following steps are needed at a glance.
- create a new bucket and allow public access
- activate static hosting on bucket
- add a cors configuration that allows GET from any origin
- Add a bucket policy that allows getObject on service S3 (remember to add
/*
to the resource key for access to all objects within the bucket) - Set list objects allow for anyone.
- Add group and user for the access from the project
- add S3 full access to the group and add bucket arn resource. (remember to add a list of resources where one resource list item is the bucket and the other item is all objects within the bucket)
- download .csv file with user details and apply them to your .env file
[
{
"AllowedHeaders": ["Authorization"],
"AllowedMethods": ["GET"],
"AllowedOrigins": ["*"],
"ExposeHeaders": []
}
]
The AWS S3 Bucket and it's static content has been setup with cache control to serve the website user with fast content delivery.
This project uses Heroku postgresQL.
- in the heroku app add Heroku postgresQL.
- use the DATABASE_URL found in environment settings in Heroku in your .env file.
- run
python3 manage.py migrate
to migrate the new database. - run
python3 manage.py loaddata initial_data
to load all fixtures - run
python3 manage.py createsuperuser
to create a superuser
This site prevents clickbait and this results in services like ami.responsivedesign.is can not display this site's content.
In order to create a screenshot of this site:
- run this site in localhost
- Add
@xframe_options_exempt
decorator above the view you would like to do a screenshot of. - in a browser navigate to ami.responsivedesign.is
- Create screendump
from django.views.decorators.clickjacking import xframe_options_exempt
@xframe_options_exempt
def index(request):
# More code here...
It is advisable to use virtual environments and packages with python applications. These guidelines include help in adding this project as a virtual environment in your local development setup.
- Confirm that python3 is installed by running
python3 --version
and confirm it'sPython 3.x.x
or higher. - Log in to GitHub and fork the GitHub Square Circles Repository
- Click "Code" and the copy url button on your fork.
- in a terminal run
git clone https://github.com/YOUR-GITHUB-NAME/square-circles.git
- to clone the repository to your local drive. - in a terminal run
cd square-circles
- to change directory to project root folder. - in a terminal run
python3 -m venv venv
- to create a virtual environment. - in a terminal run
source venv/bin/activate
to activate the virtual environment. - in a terminal run
python3 -m pip install -r requirements.txt
- in a terminal run
python3 manage.py migrate && python3 manage.py createsuperuser
- to migrate the database and start the create superuser process. - answer the questions to create a superuser.
- in a terminal run
python3 manage.py runserver
to start the server. - ...
Site is available on http://localhost:8000
Click Here to retrieve pictures for some of the buttons and more detailed explanations of the above process.
It is possible to setup your dev environment to handle the stripe webhooks. Full setup documentation can be found on Stripe Docs - webhook-test-cli
- install the Stripe CLI
- in a terminal run
stripe login
to Link your Stripe account. - in a terminal run
stripe listen --forward-to localhost:8000/checkout/wh/
- copy the webhook signing secret printed in your terminal starting with
whsec_
to theSTRIPE_WH_SECRET
in your local.env
file. - restart site (quit +
python3 manage.py runserver
)
- update env requirements:
pip freeze > requirements.txt
- erase and clean app data:
python3 manage.py migrate <App> zero
- Erase and clean database:
python3 manage.py flush
- apply all app fixtures:
python manage.py loaddata initial_data
-
Bootstrap5: Bootstrap Library used throughout the project mainly to make the site responsive using the Bootstrap Grid System.
-
MDN Web Docs : for general javascript code examples.
-
GitHub gitignore Python and gitignore MacOS : For basic gitignore patterns. gitignore is further modified to keep repo as clean as possible.
-
Code institute : course material has been used and modified.
- crownpoint camping area map is used as underlying template creating this sites interactive map.
The photos used in this site were obtained from:
- blue-and-white-camping-tent-during-night-time
- man-bil-fordon-husvagn-753603
- ljus-semester-kvinna-kreativ
- kall-sno-tra-landskap
- sommar-metall-bil-fordon
- Avc2AiE1_Q
- husvagn-camping-campingplats-vild
- tra-landskap-tradgard-trad
- sno-landskap-natur-himmel
- kall-sno-tra-ljus
- kall-sno-tra-landskap
- natur-by-byggnad-konstruktion
- vag-skog-trad-cykel
- arkitektur-bassangkant-hotell-simbassang
- stad-himmel-byggnad-flicka
- kvinna-sitter-kraft-kondition
- hav-strand-havsstrand-camping
- landskap-natur-sommar-trad
- kall-sno-landskap-natur
- dagsljus-farg-fargrik-hdr
- natur-kvinna-trad-sitter
- ljus-semester-manniskor-kreativ
- ljus-semester-natt-mork
- favicon
- I received inspiration from django-ordering-numerical-value-with-order-by to order datasets in django
- I received inspiration from numeric-for-loop-in-django-templates to use for loop counters.
- I received inspiration from google charts color for the interactive map dataset colors