A project for departments and employees management
- JDK 8
- Docker 18.09.1 - Docker
- Docker compose 1.23.2 - Docker Compose
- Maven 3.6.0 - Dependency Management
- Apache Tomcat 9.0.13 - Tomcat
- Zipkin Brave 5.6.3 Zipkin
- ElasticSearch 6.7.0 ElasticSearch
- Logstash 6.7.0 Logstash
- Kibana 6.7.0 Kibana
- Clone this project,
git clone https://github.com/MikalaiKazak/department-app.git
- Install Tomcat --- sudo apt-get install tomcat9
- Modify tomcat-users.xml file accordingly
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-jmx,manager-script,manager-status"/>
- Start the Tomcat server:sudo service tomcat run
- Build the war file with maven, mvn clean install
- Copy war-files which you can find in
/rest/target/rest.war
and/webapp/target/webapp.war
to your tomcat server webapps folder. - Restart the Tomcat server: sudo service tomcat restart
- And then you can see result in browser: http://localhost:8080/webapp/ For REST service: http://localhost:8080/rest/department/ or http://localhost:8080/rest/employee
- Install docker --- sudo apt install docker-ce
- Install docker-compose --- sudo apt install docker-compose
- sudo chmod +x build.sh
- ./build.sh
- And then you can see result in browser: http://localhost:8082/webapp/ For Rest service: http://localhost:8081/rest/department or http://localhost:8081/rest/employee
You can open Zipkin in the browser: http://localhost:9411
You can open Kibana in the browser: http://localhost:5601
You can open Logstash in the browser: http://localhost:9600
You can open ElasticSearch in the browser: http://localhost:9200
curl -X GET -v http://localhost:8080/rest/department/ --- Return all departments
curl -X GET -v http://localhost:8080/rest/department/0
curl -X DELETE -v http://localhost:8080/rest/department/0
curl -X GET -v http://localhost:8080/employee/ --- Return all employees
curl -X GET -v http://localhost:8080/rest/employee/0
URL | Description |
---|---|
GET http://localhost:8080/rest/department/ | Return all departments |
GET http://localhost:8080/rest/department/{id} | Return department by identifier |
DELETE http://localhost:8080/rest/department/{id} | Delete department by identifier |
POST http://localhost:8080/rest/department/ | Create new department (The values are sent in the request body) |
PUT http://localhost:8080/rest/department/ | Update department (The values are sent in the request body) |
GET http://localhost:8080/rest/employee/ | Return all employees |
GET http://localhost:8080/rest/employee/{id} | Return employee by identifier |
GET http://localhost:8080/rest/employee/?date={date} | Return employees by date of birthday |
GET http://localhost:8080/rest/employee/?dateFrom={dateFrom}&dateTo={dateTo} | Return employees with day of birthday in interval |
DELETE http://localhost:8080/rest/employee/{id} | Delete employee by edintifier |
POST http://localhost:8080/rest/employee/ | Add new employee (The values are sent in the request body) |
PUT http://localhost:8080/rest/employee/ | Update employee (The values are sent in the request body) |