# CC-Data | Traveloptimizer Campus Cup AKMC Data Traveloptimizer ## Backend ### Requirements - MariaDB or MySQL - node `10.12` or higher - Configure database in `.env`-file or environment variables. See `.env` for reference - Set API-Key for meteostat.net in `.env`-file or environment variable - import `setup.sql` for sample data ### Start - Run `$(cd backend && npm run start)` - call http://localhost:3000/v1/update/climate to fetch climate data for sample entries. ### Search Customize your search with query parameters. For now, only climate parameters are supported. If you omit climate queries, all climate parameters will be randomized. Following queries are supperted by now: - from=YYYY-MM-DD _(required)_ - to=YYYY-MM-DD _(required)_ - temperature=NUMBER,NUMBER - raindays=NUMBER,NUMBER - sunhours=NUMBER,NUMBER - precipitation=NUMBER,NUMBER __Examples:__ http://localhost:3000/v1/search?from=2020-06-14&to=2020-07-29&temperature=27,29&raindays=8,12&sunhours=250,300 http://localhost:3000/v1/search?from=2020-06-14&to=2020-07-29 ### More To get more search results, add more entries with meteostat station IDs to the `regions` table in the database ## Frontend ### Installation - Install node 10.15.3 - Run "(cd frontend && npm i)" ### Start dev server - Run "(cd frontend && npm run start)"