Reporter is an simple application which helps user to create reports about their employees divided on 3 categories:
- recent employees report (you can specify total number of records in report)
- top-salaries report (10 employees)
- report of employees with specifies badge (you can specify total number of records in report)
As a simple storage for users info was chosen lowDb
package. Information about employees is stored on Yandex Dysk, settings for reports - Yandex DataSync.
All API is secured with Bearer Auth, so you should provide it in Auth header for all request.
This is application was made as a first project with Node Js Express for educational purposes.
Configuration for application should be located in .env
file, which is ignored by git for security reasons. It contains next properties:
- HOST - host of server
- PORT - port of server
- YANDEX_TOKEN - token for yandex Auth
- REPORT_NUM_OF_RECORDS - max number of records in "recent employees" and "employee with badge" reports
- REPORT_EXCH_RATE - exchange rate of US dollar for USD salary calculation
npm start
Or you can start application with nodemon
lib for auto restart after changes.
nodemon /bin/www.js
If you wan't to run tests:
npm test
In case if you want get test coverage:
npm run coverage
If you want to check code style run next command:
npm run lint
It will invoke xo
linter execution.
All API is documented in swagger, which is located by next url: /api-docs
.