Skip to content

Commit

Permalink
Updated ReadMe file
Browse files Browse the repository at this point in the history
  • Loading branch information
sainik73 committed Feb 4, 2021
1 parent c8951cf commit fb4da9d
Showing 1 changed file with 54 additions and 5 deletions.
59 changes: 54 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ regenerate the API and Model classes. This is done using the swagger-codegen-mav
REST Controller 'StudentsApiController' consumes these generated classes.

Version
-----------------
- v0.1:
Initial version with mocked api response
- v1.0:
----------------
v1.0:
The repository now supports Mongo DB as storage.
students-api repository connects to Mongo DB, which is run as a Docker container.
Java Logs (students-api-logger.log) are created under project root/logs directory.

v2.0:
The repository now supports spring boot application and MongoDB deployment to Kubernetes local cluster.
MongoDB credentials are stored in secret file.

Instructions
-----------------

#### v1.0 Build Instructions:
1. Clone this repository:

`git clone https://github.com/sainik73/students-api`
Expand All @@ -36,3 +38,50 @@ mvn clean install
```
4. Run the spring boot application 'StudentsApplication'
5. Test the application using postman [![Run in Postman](https://run.pstmn.io/button.svg)](https://god.postman.co/run-collection/04fec31e35710e9bdb41#?env%5Bstudents-api-local-env%5D=W3sia2V5IjoiYmFzZVVybCIsInZhbHVlIjoibG9jYWxob3N0OjgxODAiLCJlbmFibGVkIjp0cnVlfV0=)

#### v2.0 Build Instructions:
1. Clone this repository:

`git clone https://github.com/sainik73/students-api`
2. Build the project with Maven:

```
cd students-api/
mvn clean install
```
The build will output a docker image.

3. Add image to minikube
3.1 Delete any existing image from minikube cache
```
> minikube cache delete <image-name>
```
3.2 Enter interactive terminal to minikube and remove image from docker in minikube
```
> docker exec minikube bash
> docker image rm <image-name>
> exit
```
3.3 Add image to minikube cache
```
> minikube cache add <image-name>
```
4. Setup Kubernetes resources (deployment, services etc)
4.1 Change directory to "k8s" in terminal [Its located under <project-root>/src/main/resources]
```
> kubectl apply -f .
```
5. Start service on windows host [It will expose port on host to access service]
```
> minikube service students-api
```
6. Test application
6.1 Modify the postman environment for exposed port
6.2 Run postman collection [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/04fec31e35710e9bdb41#?env%5Bstudents-api-local-env%5D=W3sia2V5IjoiYmFzZVVybCIsInZhbHVlIjoibG9jYWxob3N0OjgxODAiLCJlbmFibGVkIjp0cnVlLCJ0eXBlIjoidGV4dCJ9XQ==)


Known Issues
-----------------
Version v2.0:
1) Constraints defined in yaml are not validated for request payload because of open issue (<a href= "https://github.com/swagger-api/swagger-codegen/issues/7058">#7058</a>)
in swagger code gen plugin v 3.0.24

0 comments on commit fb4da9d

Please sign in to comment.