By Gitu Mbugua, John Mutavi and Carol Wanjohi
This is a web application that allows users to search for buses by entering their starting point and destination. The results list has buses arranged with the cheapest bus at the top of the list. The user can select a bus and book a seat in the bus.
As a user I would like to:
- search for a bus by entering the departure location and arrival location
- select a bus
- see information on the selected bus
- pay for the selected bus and get a ticket
Behavior | Input | Outcome |
---|---|---|
Search for a bus | Departure location: Nakuru Arrival Location: Nairobi Travel Date: 02/02/2018 |
Display list of buses found |
Select a bus | Click select button | Display information about the selected bus and a form for user to input their information |
Get a ticket | Click confirm and book | Display pdf with ticket information |
- Python 3.6.2
- Virtual environment
- Postgres Database
- Internet
- Copy repolink
- Run
git clone REPO-URL
in your terminal - Write
cd bus-board
- Create a virtual environment with
virtualenv virtual
or trypython3.6 -m venv virtual
- Create .env file
touch .env
and add the following:
SECRET_KEY=<your secret key>
DEBUG=True
- Enter your virtual environment
source virtual/bin/activate
- Run
pip install -r requirements.txt
orpip3 install -r requirements.txt
- Create Postgres Database
psql
CREATE DATABASE bus-board
- Change the database informatioin in
/settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'bus-board',
'USER': *POSTGRES_USERNAME*,
'PASSWORD': *POSTGRES_USERNAME*,
}
}
- Run
./manage.py runserver
orpython3.6 manage.py runserver
to run the application
- Visit this site and register a new account or log into your Africas Talking account
- Click Go to Sandbox App button
- Click Settings on the side bar menu and click API Key
- Enter your password in the form field
- Copy the generated API KEY
- Go to the
.env
file and paste the api key
API_KEY_AFRICAS_TALKING = <your api key>
- open ticket pdf after callback url is sent back
- Python 3.6.2
- Django 1.11.7
- Bootstrap 3
- Postgres Database
- CSS
- HTML
- Heroku
- xhtml2pdf
- Africa's Talking API
MIT (c) 2017 Gitu Mbugua, John Mutavi and Carol Wanjohi