Realtime Crypto (RCrypto) is a build a system that saves real-time BTC & ETH prices in Kenya Shilling.
Live API View Here
Compiled Build : Download Here
Run the package using java -jar RCrypto<version>.jar
- Users can sync realtime BTC and ETH prices.
- Users can retrieve BTC and Historical prices from the database.
- Users can add new BTC and ETH records manually
- [TO DO] The api has basic authentication.
1. [junit-jupiter-api] 'org.junit.jupiter:junit-jupiter-api:5.8.1'
2. [junit-jupiter-engine] 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
3. [spark-core] 'com.sparkjava:spark-core:2.9.3'
4. [slf4j-simple] 'org.slf4j:slf4j-simple:1.7.32'
5. [gson] 'com.google.code.gson:gson:2.8.9'
6. [retrofit] 'com.squareup.retrofit2:retrofit:2.9.0'
7. [postgresql] group: 'org.postgresql', name: 'postgresql', version: '42.2.2'
8. [okhttp] 'com.squareup.okhttp3:okhttp:4.9.3'
9. [sql2o] 'group: 'org.sql2o', name: 'sql2o', version: '1.5.4'
10.[converter-gson] 'com.squareup.retrofit2:converter-gson:2.9.0'
1. git clone https://github.com/Chal13W1zz/RCrypto.git
2. cd RCrypto
3. edit postgresql username and password in App.java
4. run psql < create.sql in the project root to create the database
5. gradle compilejava / mvn compile to compile the project
6. gradle run to host a local server
1. cd RCrypto
2. gradle test
EndPoint | Functionality |
---|---|
GET /records/sync | sync and save realtime crypto prices |
GET /records/view | View historical prices |
POST /records/add | Manually add new price records |
Request curl /records/add
curl --location --request POST 'https://rcrypto.herokuapp.com/records/add' \
--header 'Content-Type: application/json' \
--data-raw ' {
"bitcoin": {
"usd": 41493
},
"ethereum": {
"usd": 3026.81
}
}'
Response (application/json)
{
"bitcoin": {
"usd": 41493
},
"ethereum": {
"usd": 3026.81
},
"id": 44
}
Request curl /records/sync
curl --location --request GET 'https://rcrypto.herokuapp.com/records/sync' \
--header 'Content-Type: application/json'
Response (application/json)
{
"bitcoin": {
"usd": 41493
},
"ethereum": {
"usd": 3026.81
},
"id": 0
}
- The API only responds with JSON
- TO DO "respond with xml"
- Fork it! 🍴
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git add -A && git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request