Skip to content

Commit

Permalink
Added information in README file
Browse files Browse the repository at this point in the history
Signed-off-by: iamabhishek-dubey <[email protected]>
  • Loading branch information
iamabhishek-dubey committed Oct 7, 2022
1 parent 88cefd3 commit acc7da4
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 190 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,25 @@ The purpose of creating this application is to provide an individual, a holistic

These are few microservices which are getting used in this complete project.

|**Application Name**|**Default Port**|**Dependency**|**Language**|**Description**|
|--------------------|----------------|------------|--------------|---------------|
| [attendance](./attendance) | 8081 | MySQL | <img src="https://cdn.worldvectorlogo.com/logos/gopher.svg" height="32" width="32"> | Attendance is a microservice which is designed in Golang to manage employee's attendance information. |
| [employee](./employee) | 8083 | Elasticsearch | <img src="https://cdn.worldvectorlogo.com/logos/gopher.svg" height="32" width="32"> | Employee microservice is also designed in Golang to manage employee's information. |
| [salary](./salary) | 8082 | Elasticsearch | <img src="https://cdn.worldvectorlogo.com/logos/gopher.svg" height="32" width="32"> | Salary is also a golang based application which creates and manages employee's salary information. |
| [notification](./notification) | - | SMTP Server | <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Python-logo-notext.svg/1200px-Python-logo-notext.svg.png" height="32" width="32"> | Notification is a scheduled service which gets used to send mail notifications to employees. |
| [frontend](./frontend) | 5000 | Gateway | <img src="https://www.vectorlogo.zone/logos/reactjs/reactjs-icon.svg" height="32" width="32"> | Frontend is written in ReactJS and gets served using nginx proxy, config can be found [here](./webserver) |
| [gateway](./gateway) | 8080 | <ul><li>attendance</li><li>employee</li><li>salary</li><li>notification</li></ul> | <img src="https://www.vectorlogo.zone/logos/java/java-icon.svg" height="32" width="32"> | Gateway is a springboot based API gateway which manages the routing between applications. |
| [webserver](./webserver) | 80 | frontend | <img src="https://cdn.worldvectorlogo.com/logos/gopher.svg" height="32" width="32"> | Webserver is a nginx based proxy which proxies the frontend application. |
| **Application Name** | **Default Port** | **Dependency** | **Language** | **Description** |
|--------------------------------|------------------|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| [attendance](./attendance) | 8081 | MySQL | <img src="https://cdn.worldvectorlogo.com/logos/python-5.svg" height="32" width="32"> | Attendance is a microservice which is designed in Golang to manage employee's attendance information. |
| [employee](./employee) | 8083 | Elasticsearch | <img src="https://cdn.worldvectorlogo.com/logos/gopher.svg" height="32" width="32"> | Employee microservice is also designed in Golang to manage employee's information. |
| [salary](./salary) | 8080 | Elasticsearch | <img src="https://cdn.worldvectorlogo.com/logos/java.svg" height="32" width="32"> | Salary is also a golang based application which creates and manages employee's salary information. |
| [notification](./notification) | - | SMTP Server | <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Python-logo-notext.svg/1200px-Python-logo-notext.svg.png" height="32" width="32"> | Notification is a scheduled service which gets used to send mail notifications to employees. |
| [frontend](./frontend) | 3000 | attendance, employeee, salary | <img src="https://www.vectorlogo.zone/logos/reactjs/reactjs-icon.svg" height="32" width="32"> | Frontend is written in ReactJS and gets served using proxy. |
| [traefik]() | 80 | frontend | <img src="https://cdn.worldvectorlogo.com/logos/gopher.svg" height="32" width="32"> | Webserver is a traefik based proxy which proxies the frontend application. |

For further information about the component you can click on the application.

## Databases

These applications are using two kinds of databases, one is structured and other is non-structured.

|**Application Name**|**Default Port**|**Dependency**|**Description**|
|--------------------|----------------|--------------|---------------|
| [elastic](./elastic) | 9200 | - | Elasticsearch is being used as non-structured database which manages the employee's information and salary. |
| [mysql](./mysql) | 3306 | - | MySQL is getting used for structured database which manages the employee's attendance information. |
| **Application Name** | **Default Port** | **Dependency** | **Description** |
|----------------------|------------------|----------------|---------------------------------------------------------------------------------------------------------------|
| [elastic](./elastic) | 9200 | - | Elasticsearch is being used as non-structured database which manages the employee's information and salary. |
| [mysql](./mysql) | 3306 | - | MySQL is getting used for structured database which manages the employee's attendance information. |

For further information, click on the DB.

Expand Down
24 changes: 10 additions & 14 deletions attendance/README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
# Attendance

Attendance is a microservice which is designed in Golang to manage employee's attendance information.
Attendance is a microservice which is designed in Python to manage employee's attendance information.

## Database

- [MySQL](../mysql) => Attendance application store information in MySQL database

## Environment Variable

|**ENVIRONMENT VARIABLE**|**DESCRIPTION**|
|------------------------|---------------|
| CONFIG_FILE | Path of configuration file |
| **ENVIRONMENT VARIABLE** | **DESCRIPTION** |
|--------------------------|----------------------------|
| CONFIG_FILE | Path of configuration file |

## Endpoints

The available endpoints for this application are:-

|**ENDPOINT**|**REQUEST TYPE**|**DESCRIPTION**|
|------------|----------------|---------------|
| `/attendance/create` | POST | create endpoint collects the JSON payload of request and write the data to MySQL. |
| `/attendance/search` | GET | search endpoint fetch the information from MySQL server and return the JSON reponse. |
| `/attendance/healthz` | GET | healthz endpoint checks the DB connectivity and tells that application is ready to serve the requests or not. |
| **ENDPOINT** | **REQUEST TYPE** | **DESCRIPTION** |
|------------------------|------------------|---------------------------------------------------------------------------------------------------------------|
| `/attendance/create` | POST | create endpoint collects the JSON payload of request and write the data to MySQL. |
| `/attendance/search` | GET | search endpoint fetch the information from MySQL server and return the JSON reponse. |
| `/attendance/healthz` | GET | healthz endpoint checks the DB connectivity and tells that application is ready to serve the requests or not. |

## Quickstart

```yaml
# Application port on which application will listen
attendance:
api_port: "8081"

# Mysql connection details
mysql:
enabled: true
db_name: "attendancedb"
Expand All @@ -50,5 +46,5 @@ export CONFIG_FILE=/path/to/config.yaml
```

```shell
make build-image
make image
```
26 changes: 13 additions & 13 deletions employee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ Employee microservice is also designed in Golang to manage employee's informatio

## Environment Variable

|**ENVIRONMENT VARIABLE**|**DESCRIPTION**|
|------------------------|---------------|
| CONFIG_FILE | Path of configuration file |
| **ENVIRONMENT VARIABLE** | **DESCRIPTION** |
|--------------------------|----------------------------|
| CONFIG_FILE | Path of configuration file |

## Endpoints

The available endpoints for this application are:-

|**ENDPOINT**|**REQUEST TYPE**|**DESCRIPTION**|
|------------|----------------|---------------|
| `/employee/create` | POST | create endpoint collects the JSON payload of request and write the data to elasticsearch database. |
| `/employee/search` | GET | search endpoint fetch the information from elasticsearch for a particular user by sending query in URL. |
| `/employee/search/all` | GET | search/all endpoint fetch the information for all users from elasticsearch server. |
| `/employee/search/roles` | GET | search/roles endpoint fetch the information for user's role from elasticsearch|
| `/employee/search/location` | GET | search/location endpoint fetch the information for user's location from elasticsearch |
| `/employee/search/status` | GET | search/status endpoint fetch the information for user's status from elasticsearch. |
| `/employee/healthz` | GET | healthz endpoint checks the DB connectivity and tells that application is ready to serve the requests or not. |
| **ENDPOINT** | **REQUEST TYPE** | **DESCRIPTION** |
|-----------------------------|------------------|---------------------------------------------------------------------------------------------------------------|
| `/employee/create` | POST | create endpoint collects the JSON payload of request and write the data to elasticsearch database. |
| `/employee/search` | GET | search endpoint fetch the information from elasticsearch for a particular user by sending query in URL. |
| `/employee/search/all` | GET | search/all endpoint fetch the information for all users from elasticsearch server. |
| `/employee/search/roles` | GET | search/roles endpoint fetch the information for user's role from elasticsearch |
| `/employee/search/location` | GET | search/location endpoint fetch the information for user's location from elasticsearch |
| `/employee/search/status` | GET | search/status endpoint fetch the information for user's status from elasticsearch. |
| `/employee/healthz` | GET | healthz endpoint checks the DB connectivity and tells that application is ready to serve the requests or not. |

## Quickstart

Expand Down Expand Up @@ -54,5 +54,5 @@ export CONFIG_FILE=/path/to/config.yaml
```

```shell
make build-image
make image
```
3 changes: 3 additions & 0 deletions employee/employee_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func main() {
config := cors.DefaultConfig()
router.Use(apmgin.Middleware(router))
config.AllowOrigins = []string{"*"}
config.AllowMethods = []string{"*"}
config.AllowHeaders = []string{"*"}
config.AllowCredentials = true
router.Use(cors.New(config))
router.POST("/employee/create", pushEmployeeData)
router.GET("/employee/search", fetchEmployeeData)
Expand Down
39 changes: 13 additions & 26 deletions salary/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Salary

Salary is also a golang based application which creates and manages employee's salary information.
Salary is also a java based application which creates and manages employee's salary information.

## Database

Expand All @@ -10,44 +10,31 @@ Salary is also a golang based application which creates and manages employee's s

The available endpoints for this application are:-

|**ENDPOINT**|**REQUEST TYPE**|**DESCRIPTION**|
|------------|----------------|---------------|
| `/salary/search` | GET | search will fetches the salary of a user based on URL query. |
| `/salary/healthz` | GET | healthz will check the DB connectivity and return the status of application that whether it can serve the requests or not. |
| `/salary/configure/liveness` | POST | configure/liveness healthcheck will slow the response of healthcheck to simulate liveness in Kubernetes |
| **ENDPOINT** | **REQUEST TYPE** | **DESCRIPTION** |
|------------------------------|------------------|----------------------------------------------------------------------------------------------------------------------------|
| `/salary/search/all` | GET | search will fetches the salary of all users. |
| `/salary/healthz` | GET | healthz will check the DB connectivity and return the status of application that whether it can serve the requests or not. |

## Environment Variable

|**ENVIRONMENT VARIABLE**|**DESCRIPTION**|
|------------------------|---------------|
| CONFIG_FILE | Path of configuration file |
| DELAY_TIME | This will delay the bootup time of the application to simulate readiness in Kubernetes |
| **ENVIRONMENT VARIABLE** | **DESCRIPTION** |
|-------------------------------------|--------------------------------------------------|
| ELASTIC_APM_SERVICE_NAME | Service name of elastic APM configuration |
| ELASTIC_APM_SERVER_URL | APM service URL for sending metrics and insights |
| SPRING_ELASTICSEARCH_REST_URIS | URL for elasticsearch database for interaction |
| SPRING_ELASTICSEARCH_REST_USERNAME | Username for elasticsearch database |
| SPRING_ELASTICSEARCH_REST_PASSWORD | Password for elasticsearch database |

## Quickstart

```yaml
---
# elasticsearch connection details
elasticsearch:
enabled: true
host: http://elastic:9200
username: elastic
password: elastic

# Salary application api port
salary:
api_port: "8082"
```
```shell
# For compiling code
make build
```

```shell
# For running code locally
export CONFIG_FILE=/path/to/config.yaml
./salary
java -jar target/salary.jar
```

```shell
Expand Down
3 changes: 0 additions & 3 deletions webserver/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions webserver/Makefile

This file was deleted.

18 changes: 0 additions & 18 deletions webserver/README.md

This file was deleted.

101 changes: 0 additions & 101 deletions webserver/nginx.conf

This file was deleted.

0 comments on commit acc7da4

Please sign in to comment.