Skip to content

Latest commit

 

History

History
70 lines (37 loc) · 1.67 KB

README.md

File metadata and controls

70 lines (37 loc) · 1.67 KB

Cressinator

A web application to store and view data of environmental sensors.

Requirements

Development

Create copy .env.local of .env and modify to your needs:

cp .env .env.local

Install dependencies:

composer install

Create database:

./bin/console doctrine:database:create

Initialize database:

./bin/console doctrine:migrations:migrate

Load test data:

./bin/console doctrine:fixtures:load

Add user:

./bin/console user:create

Start test server:

symfony server:start

Examples

Add Group

curl -d "group[name]=foo" -X POST -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/groups/add

Add Measurement Source

curl -d "measurement_source[name]=foo&measurement_source[unit]=bar&measurement_source[group]=1" -X POST -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/measurement_sources/add

List Measurement Sources

curl -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/measurement_sources/group:1

Add Measurement

curl -d "measurement[value]=foo&measurement[source]=1" -X POST -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/measurements/add

Add Recording Source

curl -d "recording_source[name]=foo&recording_source[group]=1" -X POST -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/recording_sources/add

List MeaRecordingsurement Sources

curl -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/recording_sources/group:1

Upload Recording

curl -F "recording[file]=@/path/to/file.jpg" -F "recording[source]=1" -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/recordings/add