Spring Boot Rest API that allows users to search for stocks and follow/unfollow stocks
StocksAPI allows users to
Request Method | URI | Body (JSON) | Description | |
---|---|---|---|---|
GET | http://localhost:8080/stocks/search?keywords=apple | - | Search for stocks using keywords. Returns the best-matching symbols and market information based on keywords of your choice. | |
POST | http://localhost:8080/user/stocks | [ { “symbol”: “NKE”,”name”: “NIKE Inc.”,”region”: “United States”,”currency”: “USD”}] | Creates a new set of ‘followed’ stocks for the authorized user | |
GET | http://localhost:8080/user/stocks | Gets a set of ‘followed’ stocks for the authorized user | ||
PUT | http://localhost:8080/user/stocks/{userStockId} | Updates the set of ‘followed’ stocks using the userStocksId |
To access the protected server, you need a valid JSON Web Token.
Details on how to set up your own Okta Authorization server and get a JWT token can be found here
From root of the project
gradle:
./gradlew clean build
MongoDB - The mongo daemon process needs to be running on localhost:27017. Steps on how to install with homebrew are outlined here
Ensure you have set Okta oauth config values in application.yml file. Populate ‘issuer’, ‘client-id’ and ‘client-secret’ properties
okta:
oauth2:
issuer: https://dev-8153053.okta.com/oauth2/default
client-id: 1234567688
client-secret: 1234567688
./gradlew bootRun