A real-time Bitcoin price monitoring dashboard built with Ruby on Rails. This application fetches Bitcoin prices from the CoinGecko API, stores them in a database, and displays them in a beautiful, responsive interface with real-time updates.
- Real-time Bitcoin price updates every 10 seconds
- 24-hour price change percentage
- Interactive price chart showing last 30 data points
- Responsive design using Tailwind CSS
- Real-time updates using JavaScript
- Error handling and fallback mechanisms
- Ruby 3.2.2 or higher
- Rails 8.0.2
- SQLite3
- Node.js (for asset compilation)
- Clone the repository:
git clone https://github.com/yourusername/bitcoin_monitor.git
cd bitcoin_monitor
- Install dependencies:
bundle install
- Set up the database:
rails db:create db:migrate db:seed
- Start the Rails server:
rails server
- Visit
http://localhost:3000
in your browser
bitcoin_monitor/
├── app/
│ ├── controllers/
│ │ └── bitcoin_controller.rb # Handles price fetching and API responses
│ ├── models/
│ │ └── bitcoin.rb # Bitcoin model with price fetching logic
│ └── views/
│ └── home/
│ └── index.html.erb # Main dashboard view
├── db/
│ └── migrate/
│ └── YYYYMMDDHHMMSS_create_bitcoins_table.rb # Database schema
└── config/
└── routes.rb # Application routes
The application uses a single table bitcoins
with the following structure:
price
: decimal (precision: 20, scale: 8)timestamp
: datetimecreated_at
: datetimeupdated_at
: datetime
The application fetches Bitcoin prices from the CoinGecko API:
- Endpoint:
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
- Updates every 10 seconds
- Includes error handling and fallback mechanisms
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- CoinGecko API for providing Bitcoin price data
- Tailwind CSS for the beautiful UI
- Chart.js for the interactive charts