FunTimes API is a Ruby on Rails application that fetches real-time cryptocurrency market data from multiple sources, including Binance, KuCoin, and CoinGecko. It aggregates data to provide users with a reliable market overview.
- Fetches cryptocurrency prices from multiple sources
- Aggregates data with built-in error handling
- Supports Redis caching for performance optimization
- Uses GraphQL for flexible querying
- Implements JWT authentication (Auth0)
- Ruby 3.4.2
- Rails 8.0.1
- PostgreSQL
- Redis (for caching)
- Bundler installed (
gem install bundler
)
Clone the repository and install dependencies:
git clone https://github.com/MrTafadzwaCodes/fun_times_api.git
cd fun_times_api
bundle install
Copy .env.example
to .env
and set up your API keys:
cp .env.example .env
Fill in required credentials in .env
:
BINANCE_API_KEY=your_binance_key
KUCOIN_API_KEY=your_kucoin_key
COINGECKO_API_KEY=your_coingecko_key
REDIS_URL=redis://localhost:6379/1
Create and migrate the database:
rails db:create
rails db:migrate
Start the Rails server:
rails s
Execute the test suite:
rspec
query {
marketData(coinSymbol: "BTC") {
success
market_data {
source
price
}
errors {
source
error
}
}
}
{
"data": {
"marketData": {
"success": true,
"market_data": [
{ "source": "Binance", "price": "50234.56" },
{ "source": "CoinGecko", "price": "50300.00" }
],
"errors": []
}
}
}
- Fork the repository.
- Create a new feature branch (
git checkout -b feature-name
). - Implement changes and write tests.
- Run tests locally before pushing.
- Submit a pull request for review.
This project is licensed under the MIT License.