-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
87 lines (67 loc) · 3.15 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
******************
TaxiRider
******************
- Simple geographical information system that help users locate nearby taxis and request them.
- Toy project to learn the CakePHP framework
*** Requirements
* CakePHP v1.3.X
* PostgreSQL 9.1 + PostGIS
*** How to set up the App:
1. Download app: on the linux terminal, execute: "git clone git://github.com/pauloricardomg/TaxiRider.git" (or manually, from here: https://github.com/pauloricardomg/TaxiRider/downloads)
2. Create user 'taxirider' on postgresql 9.1, with password 'taxirider' (if you want to use another user, you will have to change the configuration on /app/config/database.php and update the SQL scripts)
3. Create a database named 'taxirider' based on the postgis template, and assign the owner to the user 'taxirider'.
3.1 Alternatively, you can simply run the SQL script: '/app/config/schema/taxirider-db.sql' with postgres super-user - this script assumes the postgis template database is named 'postgistemplate', change it if necessary. To execute, run on the postgres linux admin terminal: "psql -f taxirider-db.sql".
4. With user 'taxirider', execute SQL script '/app/config/schema/taxirider-tables.sql' - On the linux terminal, execute: "psql -f taxirider-tables.sql taxirider"
5. Copy the 'app' folder to your CakePHP 1.3 directory - if your cakephp is configured, the application should be app and running!
*** How to access the App:
- Passengers view: <server_address>/taxirider/passengers/ (eg. http://localhost/taxirider/passengers/)
- Taxi view: <server_address>/taxirider/taxis/ (eg. http://localhost/taxirider/passengers/)
*** Use cases
- Passenger view
- Register passenger
- Remove passenger
- Change position
- Search for nearby taxis
- Request a taxi
- Cancel request
- Retrieve requests
- Retrieve taxi position
- Board taxi
- Leave taxi
- Write review
- Get Reviews
- Taxi View
- Register taxi
- Remove taxi
- Change position
- Retrieve requests
- Accept request
- Reject request
- Pick up passenger
- Drop passenger
*** Relational Entities
SQL schema files available at: config/schema/taxirider*.sql
- Passenger
- id : SERIAL (primary_key)
- name : VARCHAR(128)
- position : POINT(2)
- Taxi
- id : SERIAL (primary_key)
- name : VARCHAR(128)
- position : POINT(2)
- status : BOOLEAN //possible statuses free=True, busy=False
- Request
- id : SERIAL (primary key)
- id_passenger references Passenger(id)
- id_taxi references Taxi(id) // indexed column to make review queries more efficient
- status : SHORTINT // possible statuses: open=0, accepted=1, rejected=2, cancelled=3, active=4, closed=5
- passenger_boarded : BOOLEAN DEFAULT NULL // Two boolean variables to maintain passenger and taxi views consistent
- passenger_picked : BOOLEAN DEFAULT NULL
- created_ts : TIMESTAMP
- closed_ts : TIMESTAMP DEFAULT NULL
- review: TEXT DEFAULT NULL // For simplicity, keeping the review associated to a request (1-1), instead of a separate entity.
- anonymous_review: BOOLEAN DEFAULT False
- start_position : POINT(2)
- end_position : POINT(2) DEFAULT NULL
- Trigger:
- When passenger_boarded=false && passenger_picked=false: set status to "closed" and set closed_ts