Skip to content

Commit 06b62cc

Browse files
committed
update php-demo documentation
1 parent a6d891c commit 06b62cc

File tree

9 files changed

+64
-261
lines changed

9 files changed

+64
-261
lines changed

php-demo/README.md

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,56 +26,70 @@ Using the Kairos Face Recognition API, the Verify Demo compares two photos, and
2626
[Documentation](/php-demo/verify/README.md)
2727

2828

29-
## Environment Setup and Installation
29+
## Installation
3030

31-
The demo app can easily be run using Docker with the included Dockerfile and docker-compose.yml.
31+
The demo app can easily be run either locally or using Docker with the included Dockerfile and docker-compose.yml.
3232

3333
The app is basically a single page application, which is viewed at index.php.
3434

3535
Sign-up for your API key via [developer.kairos.com](https://developer.kairos.com) and check your inbox for an activation link. You should now have your `APP_ID` and `APP_KEY`
3636

37-
#### Steps:
3837

39-
1. clone or fork the repo, and git clone via command-line (CLI):
38+
#### Clone or fork the repo, and git clone via command-line (CLI):
4039
```
4140
cd $HOME/Desktop
4241
git clone https://github.com/kairosinc/api-examples.git
4342
```
44-
2. Edit the `docker-compose.yml` file in the root project directory to add your `APP_ID` and `API_KEY` in the following lines, and save the file:
45-
```
46-
Enter your personal keys into the docker-compose.yml file:
47-
48-
version: '2'
49-
services:
50-
demo:
51-
image: demo
52-
expose:
53-
- "8080"
54-
ports:
55-
- "8080:80"
56-
environment:
57-
STAGE: dev
58-
AWS_S3_REGION: "us-east-1"
59-
AWS_S3_UPLOAD_BUCKET: "valid-s3-bucket-here"
60-
APP_ID: "your-app-id-here"
61-
APP_KEY: "your-app-key-here"
62-
API_URL: "https://api.kairos.com"
63-
API_TIMEOUT: "10"
64-
POLL_TIMEOUT: "300"
65-
DEMO1_ID: "x"
66-
DEMO_SECRET_KEY: "abc123"
67-
XDEBUG: "true"
68-
XDEBUG_CONFIG: "remote_host=10.254.254.254"
69-
volumes:
70-
- .:/var/www/app/php-demo
43+
#### Running the app on your local system
44+
45+
* The application can be run from a server, such as MAMP, WAMP, LAMP OR XAMPP, or another type of virtual machine or solution stack.
46+
* Insert your Kairos API ID and Key into the config.php file, which is at the root of the demo directory.
47+
* The demo should render at the the host that you designated in your stack or virtual machine: {host}/demo/emotion/
48+
* NOTE: The webcam functionality requires that your app has SSL enabled. To do this, you can create a self-signed certificate and key and add these to your config settings. MAMP Pro will create the certificate files and then add them to your config automatically. If you're using Apache, the standard SSL port will be 443, so your demo will render here: https://{host}/demo/emotion/
49+
50+
#### Running the app in a Docker container
51+
* Enter your personal keys into the docker-compose.yml file:
52+
```
53+
version: '2'
54+
services:
55+
demo:
56+
image: demo
57+
expose:
58+
- "8080"
59+
ports:
60+
- "8080:80"
61+
environment:
62+
STAGE: dev
63+
AWS_S3_REGION: "us-east-1"
64+
AWS_S3_UPLOAD_BUCKET: "valid-s3-bucket-here"
65+
APP_ID: "your-app-id-here"
66+
APP_KEY: "your-app-key-here"
67+
API_URL: "https://api.kairos.com"
68+
API_TIMEOUT: "10"
69+
POLL_TIMEOUT: "300"
70+
DEMO1_ID: "x"
71+
DEMO_SECRET_KEY: "abc123"
72+
XDEBUG: "true"
73+
XDEBUG_CONFIG: "remote_host=10.254.254.254"
74+
volumes:
75+
- .:/var/www/app/php-demo
7176
```
77+
* The AWS keys aren't necessary unless you're running the Facerace demo. For more information about using XDEBUG with PHPStorm, go to: https://gist.github.com/coleca/c227543fbed515e4eb4c058a7455c581
7278

73-
3. Run the following commands, which will build your Docker container and execute Docker-Compose run to start up the app locally on your machine:
79+
* Run the following commands, which will build your Docker container and execute Docker-Compose run to start up the app locally on your machine:
7480
```
75-
make build && make run
81+
make build
82+
make run
7683
```
84+
* Once your app is running, you can visit `http://localhost:8080` in your browser to view the demo examples.
85+
86+
* To stop the Docker container:
87+
88+
```
89+
docker stop $(docker ps -q)
90+
```
7791

78-
Once your app is running, you can visit [http://localhost:8080](http://localhost:8080) on your browser to view the demo examples.
92+
Note: This will stop all running containers not just this one
7993

8094
## Make this better
8195

php-demo/detect/Detect_API_Tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ You will receive a confirmation email. Click on the link in the email, to activ
1818

1919
#### Running the app on your local system
2020

21-
The application must be run from a server, such as MAMP, WAMP, LAMP OR XAMPP, or another type of virtual machine.
21+
The application can be run from a server, such as MAMP, WAMP, LAMP OR XAMPP, or another type of virtual machine.
2222

2323
Insert your Kairos API ID and Key into the config.php file, which is at the root of the demo directory.
2424

2525
![Config File](/php-demo/detect/docs/config_file.png?raw=true)
2626

27-
The detect demo should render at the the host that you designated in your stack or virtual machine.
27+
The detect demo should render at the the host that you designated in your stack or virtual machine. {host}/detect/
2828

29-
{host}/detect/
29+
NOTE: The webcam functionality requires that your app has SSL enabled. To do this, you can create a self-signed certificate and key and add these to your config settings. MAMP Pro will create the certificate files and then add them to your config automatically. If you're using Apache, the standard SSL port will be 443, so your demo will render here: https://{host}/demo/
3030

3131
#### Running the app in Docker
3232

php-demo/detect/README.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -93,50 +93,8 @@ If `?option-panel=yes` is added to the URL of the demo, a panel is revealed unde
9393
---
9494
## Installation
9595

96-
First, enter your personal keys into the docker-compose.yml file:
97-
98-
version: '2'
99-
services:
100-
demo:
101-
image: demo
102-
expose:
103-
- "8080"
104-
ports:
105-
- "8080:80"
106-
environment:
107-
STAGE: prod
108-
AWS_S3_REGION: "your-aws-s3-region"
109-
AWS_S3_UPLOAD_BUCKET: "your-aws-upload-bucket"
110-
APP_ID: "your-app-id"
111-
APP_KEY: "your-app-key"
112-
API_URL: "https://api.kairos.com"
113-
API_TIMEOUT: "10"
114-
POLL_TIMEOUT: "300"
115-
DEMO1_ID: "leave-blank"
116-
DEMO_SECRET_KEY: "leave-blank"
117-
XDEBUG: "true"
118-
XDEBUG_CONFIG: "remote_host=10.254.254.254"
119-
volumes:
120-
- .:/var/www/app/php-demo
121-
122-
The AWS keys aren't necessary unless you're running the Facerace demo. For more information about using XDEBUG with PHPStorm, go to: https://gist.github.com/coleca/c227543fbed515e4eb4c058a7455c581
123-
124-
125-
Then, cd to your demo repo, and run:
126-
```
127-
make build
128-
129-
make run
130-
```
131-
You will then be able to access the UI at http://localhost:8080:80 (if running using Docker for Mac or Docker for Windows)
132-
133-
To stop the Docker container:
134-
135-
```
136-
docker stop $(docker ps -q)
137-
```
138-
139-
Note: This will stop all running containers not just this one
96+
97+
See `INSTALLATION` in the main php-demo README file: [Installation](/php-demo/README.md)
14098

14199
---
142100
## Environment Variables

php-demo/emotion/Emotion_API_Tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ You will receive a confirmation email. Click on the link in the email, to activ
2424

2525
#### Running the app on your local system
2626

27-
The application must be run from a server, such as MAMP, WAMP, LAMP OR XAMPP, or another type of virtual machine.
27+
The application can be run from a server, such as MAMP, WAMP, LAMP OR XAMPP, or another type of virtual machine.
2828

2929
Insert your Kairos API ID and Key into the config.php file, which is at the root of the demo directory.
3030

3131
![Config File](/php-demo/emotion/docs/config_file.png?raw=true)
3232

33-
The emotion demo should render at the the host that you designated in your stack or virtual machine.
33+
The emotion demo should render at the the host that you designated in your stack or virtual machine. {host}/emotion/
3434

35-
{host}/emotion/
35+
NOTE: The webcam functionality requires that your app has SSL enabled. To do this, you can create a self-signed certificate and key and add these to your config settings. MAMP Pro will create the certificate files and then add them to your config automatically. If you're using Apache, the standard SSL port will be 443, so your demo will render here: https://{host}/demo/emotion
3636

3737
#### Running the app in Docker
3838

php-demo/emotion/README.md

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -182,50 +182,8 @@ If `?option-panel=yes` is added to the URL of the demo, a panel is revealed unde
182182
---
183183
## Installation
184184

185-
First, enter your personal keys into the docker-compose.yml file:
186-
187-
version: '2'
188-
services:
189-
demo:
190-
image: demo
191-
expose:
192-
- "8080"
193-
ports:
194-
- "8080:80"
195-
environment:
196-
STAGE: prod
197-
AWS_S3_REGION: "your-aws-s3-region"
198-
AWS_S3_UPLOAD_BUCKET: "your-aws-upload-bucket"
199-
APP_ID: "your-app-id"
200-
APP_KEY: "your-app-key"
201-
API_URL: "https://api.kairos.com"
202-
API_TIMEOUT: "10"
203-
POLL_TIMEOUT: "300"
204-
DEMO1_ID: "leave-blank"
205-
DEMO_SECRET_KEY: "leave-blank"
206-
XDEBUG: "true"
207-
XDEBUG_CONFIG: "remote_host=10.254.254.254"
208-
volumes:
209-
- .:/var/www/app/php-demo
210-
211-
The AWS keys aren't necessary unless you're running the Facerace demo. For more information about using XDEBUG with PHPStorm, go to: https://gist.github.com/coleca/c227543fbed515e4eb4c058a7455c581
212-
213-
214-
Then, cd to your demo repo, and run:
215-
```
216-
make build
217-
218-
make run
219-
```
220-
You will then be able to access the UI at http://localhost:8080:80 (if running using Docker for Mac or Docker for Windows)
221-
222-
To stop the Docker container:
223-
224-
```
225-
docker stop $(docker ps -q)
226-
```
227185

228-
Note: This will stop all running containers not just this one
186+
See `INSTALLATION` in the main php-demo README file: [Installation](/php-demo/README.md)
229187

230188
---
231189
## Environment Variables

php-demo/facerace/README.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,50 +38,8 @@ The uploaded image and ethnicity metrics are saved as an image on S3 and can be
3838
---
3939
## Installation
4040

41-
First, enter your personal keys into the docker-compose.yml file:
42-
43-
version: '2'
44-
services:
45-
demo:
46-
image: demo
47-
expose:
48-
- "8080"
49-
ports:
50-
- "8080:80"
51-
environment:
52-
STAGE: prod
53-
AWS_S3_REGION: "your-aws-s3-region"
54-
AWS_S3_UPLOAD_BUCKET: "your-aws-upload-bucket"
55-
APP_ID: "your-app-id"
56-
APP_KEY: "your-app-key"
57-
API_URL: "https://api.kairos.com"
58-
API_TIMEOUT: "10"
59-
POLL_TIMEOUT: "300"
60-
DEMO1_ID: "leave-blank"
61-
DEMO_SECRET_KEY: "leave-blank"
62-
XDEBUG: "true"
63-
XDEBUG_CONFIG: "remote_host=10.254.254.254"
64-
volumes:
65-
- .:/var/www/app/php-demo
66-
67-
The AWS keys aren't necessary unless you're running the Facerace demo. For more information about using XDEBUG with PHPStorm, go to: https://gist.github.com/coleca/c227543fbed515e4eb4c058a7455c581
68-
69-
70-
Then, cd to your demo repo, and run:
71-
```
72-
make build
73-
74-
make run
75-
```
76-
You will then be able to access the UI at http://localhost:8080:80 (if running using Docker for Mac or Docker for Windows)
77-
78-
To stop the Docker container:
79-
80-
```
81-
docker stop $(docker ps -q)
82-
```
83-
84-
Note: This will stop all running containers not just this one
41+
42+
See `INSTALLATION` in the main php-demo README file: [Installation](/php-demo/README.md)
8543

8644
---
8745
## Environment Variables

php-demo/recognize/README.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -72,50 +72,8 @@ If `?option-panel=yes` is added to the URL of the demo, a panel is revealed unde
7272
---
7373
## Installation
7474

75-
First, enter your personal keys into the docker-compose.yml file:
76-
77-
version: '2'
78-
services:
79-
demo:
80-
image: demo
81-
expose:
82-
- "8080"
83-
ports:
84-
- "8080:80"
85-
environment:
86-
STAGE: prod
87-
AWS_S3_REGION: "your-aws-s3-region"
88-
AWS_S3_UPLOAD_BUCKET: "your-aws-upload-bucket"
89-
APP_ID: "your-app-id"
90-
APP_KEY: "your-app-key"
91-
API_URL: "https://api.kairos.com"
92-
API_TIMEOUT: "10"
93-
POLL_TIMEOUT: "300"
94-
DEMO1_ID: "leave-blank"
95-
DEMO_SECRET_KEY: "leave-blank"
96-
XDEBUG: "true"
97-
XDEBUG_CONFIG: "remote_host=10.254.254.254"
98-
volumes:
99-
- .:/var/www/app/php-demo
100-
101-
The AWS keys aren't necessary unless you're running the Facerace demo. For more information about using XDEBUG with PHPStorm, go to: https://gist.github.com/coleca/c227543fbed515e4eb4c058a7455c581
102-
103-
104-
Then, cd to your demo repo, and run:
105-
```
106-
make build
107-
108-
make run
109-
```
110-
You will then be able to access the UI at http://localhost:8080:80 (if running using Docker for Mac or Docker for Windows)
111-
112-
To stop the Docker container:
113-
114-
```
115-
docker stop $(docker ps -q)
116-
```
117-
118-
Note: This will stop all running containers not just this one
75+
76+
See `INSTALLATION` in the main php-demo README file: [Installation](/php-demo/README.md)
11977

12078
---
12179

php-demo/recognize/Recognize_API_Tutorial.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ Insert your Kairos API ID and Key into the config.php file, which is at the root
3030

3131
![Config File](/php-demo/recognize/docs/config_file.png?raw=true)
3232

33-
The recognize demo should render at the the host that you designated in your stack or virtual machine.
33+
The recognize demo should render at the the host that you designated in your stack or virtual machine. {host}/recognize/
3434

35-
{host}/recognize/
3635

3736
#### Running the app in Docker
3837

0 commit comments

Comments
 (0)