Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeevatkm/code-exercise-demo
https://github.com/jeevatkm/code-exercise-demo
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeevatkm/code-exercise-demo
- Owner: jeevatkm
- Created: 2015-03-31T00:57:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-31T22:19:39.000Z (almost 10 years ago)
- Last Synced: 2024-10-28T20:19:23.649Z (2 months ago)
- Language: Java
- Size: 164 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Demo Application
----------------Demo application using Spring Boot framework. Since it's one of the widely recognized open source framework in the industry.
Particularly [Sprint Boot](http://projects.spring.io/spring-boot/) provides OPS ready capability libraries. So I have given my favor to this.
Application uses following libraries-compile('org.springframework.boot:spring-boot-starter-data-mongodb',
'org.springframework.boot:spring-boot-starter-security',
'org.springframework.boot:spring-boot-starter-actuator',
'org.springframework.boot:spring-boot-starter-web')REST Endpoints
--------------
Appliation implementated with following endpoints. Supports only JSON message format.**Token**
HTTP Verb | Endpoint URI
--------- | ------------
POST | http://localhost:8080/token**Account**
Supports filter option on profession, city, zipCode attributes and Pagination (page, count, sort, order).
Should be passed as query param. Group by option is not implemented.HTTP Verb | Endpoint URI
--------- | ------------
GET | http://localhost:8080/accounts
POST | http://localhost:8080/accounts
GET | http://localhost:8080/accounts/{id}
UPDATE | http://localhost:8080/accounts/{id}
DELETE | http://localhost:8080/accounts/{id}
GET | http://localhost:8080/accounts?filter=true&city=los%angeles&profession=software%20engineer
GET | http://localhost:8080/accounts?page=2&count=1&sort=username&order=DESC
GET | http://localhost:8080/accounts?filter=true&city=los%angeles&profession=software%20engineer&page=0&count=1&sort=profession**File System**
HTTP Verb | Endpoint URI
--------- | ------------
GET | http://localhost:8080/fs
GET | http://localhost:8080/fs?rp=build**App Health**
Implemented via built-in capabilities of spring boot actuator libraries. Management endpoint can be access via `localhost:9001`
HTTP Verb | Endpoint URI
--------- | ------------
GET | http://localhost:9001/healthEnpoint Versioning
------------------In the industry various implementation concept floating around. From my point view nothing is wrong, I would its trade-off by organization/team.
* Content Negotiation via Header {Accept, Content-Type}
* Version info in endpoint pathFor REST API versioning, there are many debates around the internet, I personally perfer `Content Negotiation` approach.
Test Case
---------Demo application has a Integration test case. Test report is at -
<PROJECT_DIR>/build/reports/tests/classes/com.demo.exercise.it.DemoApplicationIntegrationTest.html