A site for volunteers to find volunteering opportunities around the world. Data from volunteer work camps will be displayed and can be applied to by paying a small fee.
Please check the wiki for tips on how to use the website.
Root access login details for Evaluation.
The project is shared for use with the GNU General Public License v3
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Expected users of the website include volunteer camp organisers, voluntary organisations and volunteers of all kinds. They come to the site to participate in volunteering activities.
- Volunteer Camp Organisers can notify the voluntary organistaion of their camp.
- Volunteer organisations can list the camps on the site.
- Volunteers looking for a work camp experience can apply to work at the camp.
- Colour scheme consists of complementary colours
- roboto font used throughout the website
- font-family: 'Roboto', 'helvetica' sans-serif;
- Icons imported from Font FontAwesome
- Designed for accessibility:
- Semantic structure
- Alt text
- Colour Contrast
The web app was designed with a series of mockups as a dynamic page with different displays given for different views:
The camp model is structured in the following way:
- title
- region
- country
- continent
- organisation
- description
- image
- positions
- positions_female
- positions_male
- positions_other
- required_language
- start_date
- end_date
- extra_host_country_fee
- extra_host_country_fee_currency
- archived
- created_date
- published_date
- tag
Other models include:
- Order
- News
- Story
- User
Features planned, implemented and outlined for later development
- Camps list
- Filters
- Region
- Country
- Topic
- Type of Work
- Setting
- Dates
- Special requirements
- Number of Places Available
- Searchable
- Translatable Pages
- Membership Sign Up
- Newsletter and Blog
- Newsletter Signup
- Login Authentication
- Documentation
- README
- Doc Strings
- Camps list
- Authentication
- Logout
- Login
- Profile Page
- Cart for camps
- Camp checkout
- Strip payments
- Camp Filtering
- Image uploads
This project makes use of the following technologies:
- Python 3.6.8 is a general purpose programming language.
- Django 1.11 is an open-source fullstack development framework.
- django.test extends Python's unittest.
- Coverage.py 4.5.4 generates interactive HTML reports on the coverage of running a function across the project code. Used here for gauging effectiveness of testing.
- PostgreSQL is an open-source relational DBMS that works well with Heroku and Django.
- Heroku is a cloud platform as a service which allows easy deployment of this project and database.
- Heroku Toolbelt connects to Heroku through a terminal.
- Gitpod is an in browser IDE that can open and setup git repositories directly from github.
- Azure IDE services from Microsoft and connecting into their suite of hosting products.
- Bootstrap CSS styling from Bootstrap.
- Font Awsome provide neat icons with easy styling.
- Travis CI Continuous Integration from Travis.
- Stripe is used for recieving payments.
- gunicorn 19.9.0 is a web server gateway interface that runs on Python.
- psycopg2 2.7.3.2 is a PostgreSQL database adapter for Python.
- dj_database_url 0.5.0 is a simple helper to configure Django database using db url.
- Django Forms Bootstrap this plug-in allows for bootstrap styling on django forms.
- Datepicker popup calander date picker
Development Version Control workflow follows these steps:
- New
feature
branches are branched from thedevelop
branch feature
is developed over a development cyclefeature
branch is tested with coveragefeature
branch is pushed to remotefeature
branch is merged intodevelop
branchfeature
branch is deleted from localrelease
branch is branched fromdevelop
branchrelease
branch is tagged with projects latest release versionrelease
branch is tested with django TestCase- Bug fixes and patches are added if required
release
branch is merged intodevelop
branchrelease
branch is deleteddevelop
branch is pushed to remotedevelop
branch is merged intomaster
branchmaster
branch is pushed to remote- Travis tests Continuous Integration on latest
master
push - Heroku creates new build from latest
master
push
Note: feature
branches can be removed from remote after merging with develop
branch. They have been retained here for assessment purposes.
Features are developed using Test Driven Development practices:
feature
branch is branched fromdevelop
branchfeature
branch is tested with Django TestCase for pass standardfeature
is broken into stages, tests are written for each stages- Stages are developed until they pass stage tests
- Good time to commit to git
- When all stages are complete:
- feature branch is tested with
coverage
to ensure high level of test coverage feature
branch is ready to merge with develop branch
- feature branch is tested with
Bootstrap CSS is added to the project through a CDN link in the base.html tag. Icons are imported from FontAwesome using their new kit system
Heroku provides a number of useful tools to aid in development
Databases can be created and hosted on heroku using their built in PostgreSQL add-ons.
Allows for staging of the development version app alongside the production ready app. New features added to the development app can be tested on the staged apps without directly affecting the user experience of the production version.
The Heorku Postgres add-on allows for secure links to SQL queries of the database known as dataclips. They are great for quick referencing of the database and sharing of specific data across teams. Following the provided links quickly exports and downloads the current data quiry results to you computer or a Google Sheets account. Example:
- All available camps
The site was tested through a number of means:
- Volunteer Camp Organisers can notify the voluntary organistaion of their camp.
- Volunteer organisations can list the camps on the site.
- Volunteers looking for a work camp experience can apply to work at the camp.
You can run theses tests by first following the steps in Deployment to get the project running.
- Ensure that the dependencies are installed.
pip3 install -r requirements.txt
- Next in a terminal inside the project type:
coverage run --source=. manage.py test
- When the tests are complete you can generate a report on the pass rate of the program methods.
coverage report
- To view an interactive HTML display of the coverage of code tested run this in the terminal:
coverage html
- When the command completes open the report in a web browser:
Continuous Integration will run all the written Django TestCases against the latest updates to the project.
You can set up Travis CI with your project by first following the steps in Deployment to get the project running.
- Create an account at Travis CI
- Connect to your Github account
- From Setting > Repositories activate your project
- Travis will now run CI tests each time you push changes to your repository Note: You can instruct Heroku to wait for CI to complete before publishing changes to the site by ticking the 'Wait for CI to pass before deploy' checkbox in Heroku's deploy tab.
To deploy your own instance of volunteer-fsf-project takes a little effort. It is suggested that you use Heroku for your deplyment as the project was developed with that in mind.
Deployment requires some preparation. Before following the steps below ensure you have the following:
- A development environment with Python 3.6.8 or higher installed
- Open or Create a Heroku account at heroku.com
- Have an existing Github account from github.com
- Fork a copy of volunteer-fsf-project to you github
- Generate a secret key - can be generated here
There are two ways of deploying to Heroku:
- Through Heroku's Web Dashboard available on most OS
- Through the Heroku Toolbelt available on Ubuntu 16+
- Create a new app on heroku.com - this will require a unique name
- In the Overview tab add the Heroku Posgres: Hobby Dev add-on
- In the Settings tab Reveal Config Vars add the following values:
DISABLE_COLLECTSTATIC : 1
HOSTNAME : your_app_name.herokuapp.com
SECRET_KEY : your_secret_key
AZURE_ACCOUNT_NAME : volunteerfsfproject
- On the Deployment tab set deployment method to Github
- In the connect to Github section sign in then connect your fork of the project
- With master branch selected, turn on Automatic Deploys
- Ticking the 'Wait for CI to pass before deploy' checkbox here will help prevent broken deployments.
- In the Manual Deploy section, with the master branch selected, click Deploy Branch for your first deployment
Your project is now deployed! To view the running app click Open App at the top of the page. It may take a moment to open when visiting after a time of inactivity.
- Clone your fork of the volunteer-fsf-project git repo onto your developement environment
- Navigate inside the project:
cd volunteer-fsf-project
- Open a new terminal in the local repo and install heroku toolbelt with:
sudo snap install --classic heroku
- Login to heroku using the toolbelt:
heroku login
- Create a new app project:
heroku create your_app_name
- Point toolbelt to the created project with:
heroku git:remote -a your_app_name
- Connect a Postgres: Hobby Dev Add-on with:
heroku addons:create heroku-postgresql:hobby-dev
- Retrieve the DATABASE_URL to ensure it is connected:
heroku config:get DATABASE_URL
- Set the following config vars:
heroku config:set DISABLE_COLLECTSTATIC=1
heroku config:set HOSTNAME=your_app_name.herokuapp.com
heroku config:set SECRET_KEY=your_secret_key
- Push to heroku using:
git push heroku master
Your project is now deployed! Visit https://your_app_name.herokuapp.com/
to view the site. It may take a moment to open when visiting after a time of inactivity.
To run the project locally.
Using a development environment with Python 3.6.8 or higher installed
Clone your fork of the volunteer-fsf-project git repo onto your developement environment
Open the project and install the dependencies:
pip3 install -r requirements.txt
Apply any migrations:
python3 manage.py migrate
In the terminal export the following values:
export DEVELOPMENT=1
export SECRET_KEY='your_secret_key'
Next run the project:
python3 manage.py runserver
Your project is now running! To view the project open it in a web browser. Djangos built in server is not meant for deployed hosting. Please consider another server for this.
Open the forked volunteer-fsf-project page on github.com
Prefix the url with the following:
gitpod.io/#
Gitpod will create an environment for you in a couple minutes
When the IDE is ready, in the terminal install dependencies:
pip3 install -r requirements.txt
Apply any migrations:
python3 manage.py migrate
In the terminal export the following values:
export DEVELOPMENT=1
export SECRET_KEY='your_secret_key'
Next run the project:
python3 manage.py runserver
Your project is now running! To view the project open it in Preview.
A number of alerts appeared in developer tools warning of cross-site cookies.
Resolved: It turns out this was a universal issue across all sites and a number of browsers.
Fixing this is outside the scope of this project.
Clicking any links on the evalutaion site was causing the page to 404. Resolved: This was an easy fix. Required adding of stripe keys to config vars.
The checkout process was hitting a snag. Resolved: Checkout page does not include checkout ability when cart is empty.
This project is developed with the aid of resources, advice and care from many others. Here's to them.
- Django 1.11 Documentation
$ pip freeze > requirements.txt
considered harmful- django.test
- Process Types and the Procfile
- Github Markdown Header Anchors
- .gitignore not ignoring the files specified.
- How can I change the author name / email of a commit?
- VI Text Editor with Commands: Linux/Unix Tutorial
- Gitpod - Environment Variables
- Docstrings in Python
- Heroku Case Study - Life.io - Dataclips
- StackOverflow - Git pull from another repository
- Gitflow Workflow
- Best Practices When Versioning a Release
- How to Use Date Picker with Django
The text on the website has been copied and edited from:
The images for the website are taken from: Pexels
Thank you to the following for inspiration, motivation and the direction I needed:
-
Seun Owonikoko @seun_mentor
-
Samantha Dartnall @Sammy Dartnall
-
Alan M. @Alan Mc Gee
-
Anna Greaves @Anna_G
-
Andy @mormoran
-
Libby Henry @Libby_alumni
-
Jorden V @Jorden
-
Samantha Dartnall @Sammy Dartnall_lead
-
John Lynch @John_Lynch_alumnus
-
Antonio Augello @Antonio
-
Anybody that I may have forgotten
-
Code Institute