- Docker Community Edition (link)
- Bash shell for running the initial setup script
If you are setting up the machine for the first time, please run
$ . setup.shThis will take a while because the database is initialised and then the app image is being build and launched.
After running setup.sh, there are two container running on your machine:
- carcada_database
- carcada_app
docker kill <container_name>Use the commands that are being used in setup.sh.
Note:
- Make sure that you launch the database container before the application container.
- After launching the database, you need to initialise the database by running the commands at the end of
setup.sh
| Name | Value |
|---|---|
| URL | /user/login |
| Method | POST |
| Body | application/json |
| Parameters | email, password |
Example
Request:
POST carcada.local/user/login HTTP/1.0
{
"email": "myemail@g.com",
"password": "yourpassword"
}
Response:
x-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiZW1haWwiOiJhZ3VzdGluNzBAYmVlci5iaXoiLCJwYXNzd29yZCI6IiQyeSQxMiRkV1VocDc3RUZNTDZBVEpPV09JNTUub2RVZ1BibWx5cGJFaGtzdFdBLkU3QU9tUkxuaUpKZSIsImZpcnN0bmFtZSI6IldpbGJlcnQiLCJsYXN0bmFtZSI6Ild5bWFuIiwiaW1nIjpudWxsLCJ1c2VyUmF0aW5nIjoyLCJsYW5ndWFnZSI6IndhIn0.160GhOJbmmoszqVrmg1rVrpdVFTuaDR8Xu6_wzn_GHc
{
"id": 1,
"email": "agustin70@beer.biz",
"password": "$2y$12$dWUhp77EFML6ATJOWOI55.odUgPbmlypbEhkstWA.E7AOmRLniJJe",
"firstname": "Wilbert",
"lastname": "Wyman",
"img": null,
"userRating": 2,
"language": "wa"
}
Authorisation on all channels but the public ones and the login channel are secured through token. The token has to be passed as a header and the name is x-token.
Example
GET /api/rides HTTP/1.0
x-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiZW1haWwiOiJhZ3VzdGluNzBAYmVlci5iaXoiLCJwYXNzd29yZCI6IiQyeSQxMiRkV1VocDc3RUZNTDZBVEpPV09JNTUub2RVZ1BibWx5cGJFaGtzdFdBLkU3QU9tUkxuaUpKZSIsImZpcnN0bmFtZSI6IldpbGJlcnQiLCJsYXN0bmFtZSI6Ild5bWFuIiwiaW1nIjpudWxsLCJ1c2VyUmF0aW5nIjoyLCJsYW5ndWFnZSI6IndhIn0.160GhOJbmmoszqVrmg1rVrpdVFTuaDR8Xu6_wzn_GHc
All parameters have to be present in the url as query parameters. Empty paraeters will be ignored (no results will be removed). The ride search is defined as follows
URL: /api/ridesearch Method: GET Parameters:
| Name | Parameter Type | Filter Type | Example |
|---|---|---|---|
| from | string | Pattern | Karlsruhe |
| to | string | Pattern | Mü |
| travelDay | date | Match | 2019-01-01 |
| seats | integer | >= | 2 |
Example
GET /api/ridesearch?from=Mu&to=&travelDay=2019-01-01 HTTP/1.0
- Swagger installation is not working at the moment
- mbstring PHP extension is missing on the machine
- Add role to install composer
- Run composer when provisioning
zipandunzipto system tools- run phinx (
phinx install?) after at the end to init DB - set php.in and my.cnf to UTF8 to be able to use special characters in the data