A web application to store and view data of environmental sensors.
- Composer
- Symfony CLI
- PHP >= 7.2
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
curl -d "group[name]=foo" -X POST -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/groups/add
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
curl -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/measurement_sources/group:1
curl -d "measurement[value]=foo&measurement[source]=1" -X POST -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/measurements/add
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
curl -H "X-AUTH-TOKEN: ..." http://127.0.0.1:8000/api/recording_sources/group:1
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