https://github.com/exposedcat/university-rest
BotsCrew test task: REST API for the university, which consists of departments and lectors.
https://github.com/exposedcat/university-rest
Last synced: 18 days ago
JSON representation
BotsCrew test task: REST API for the university, which consists of departments and lectors.
- Host: GitHub
- URL: https://github.com/exposedcat/university-rest
- Owner: ExposedCat
- Created: 2021-09-20T20:11:56.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-24T14:17:59.000Z (over 4 years ago)
- Last Synced: 2025-03-12T04:41:23.372Z (10 months ago)
- Language: JavaScript
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# University REST
## Setup db with test data
Config: `connector/src/config/manifest.js`
Running: `cd connector && npm run prepare` or `cd connector && node src/utilites/fill-db.js`.
It will clear `university-rest-db` collection (default, can be changed in config) and add 4 lectors in 2 departments with different salaries and degrees.
## Connector
Config: `connector/src/config/manifest.js`
Dependencies: `cd connector && npm install`
Running: `cd connector && npm start` or `cd connector && node src/app.js`. By default running port is 3000 (can be changed in config).
Endpoints:
- `/getHeadOfDepartment?name={department_name}` - get head of the department
- `/getDepartmentStatistic?name={department_name}` - get department statistic
- `/getAverageSalaryOfDepartment?name={department_name}` - get average salary of lectors of the department
- `/getCountOfEmployeeForDepartment?name={department_name}` - get count of employee of the department
- `/globalSearch?query={query_to_search}` - global lectors names search
## Client
Config: `clinet/src/utilites/config.js`
Dependencies: `cd clinet && npm install`
Running: `cd clinet && npm start` or `cd clinet && node src/app.js`. By default running port is 8080 and using connector on 3000 (can be changed in config).
Endpoints:
- `/search?query={search_query}` - get data using commands:
- Who is head of department {department_name}
- Show {department_name} statistic
- Show the average salary for department {department_name}
- Show count of employee for {department_name}
- Global search by {template}