Hoddler is a cryptocurrency portfolio tracking application that integrates with the Binance API to provide users with real-time data about their cryptocurrency trades and investments. The application allows users to track multiple cryptocurrencies, visualize price movements through candlestick charts, and analyze their trading performance.
-
Binance API Integration
- Connect to Binance using API keys
- Fetch user's trade history
- Retrieve candlestick (kline) data for cryptocurrencies
- Get current price information
-
Portfolio Tracking
- Track multiple cryptocurrency tickers
- Calculate and display portfolio statistics
- Show profit/loss metrics
-
Data Visualization
- Display interactive candlestick charts
- Mark buy/sell points on charts
- Show daily trading activity
-
Data Management
- Store historical trade data
- Maintain candlestick data for analysis
- Generate trading markers for significant events
- Backend: Ruby on Rails 7.0.7
- Database: MongoDB 4.x+ with Mongoid 8.0.2
- Frontend: Tailwind CSS, JavaScript, Lightweight Charts
- API: Binance API via binance-connector-ruby
Hoddler follows a service-oriented architecture within the Rails framework:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Controllers │────▶│ Services │────▶│ Models │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Views │ │ Binance API │ │ MongoDB │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Ruby 3.2.2
- MongoDB 4.x+
- Node.js and Yarn (for Tailwind CSS)
- Binance API credentials
-
Clone the repository
git clone https://github.com/mrz944/hoddler.git cd hoddler -
Install dependencies
bundle install
-
Configure MongoDB
- Update
config/mongoid.ymlwith your MongoDB connection settings
- Update
-
Set up environment variables
- Create a
.envfile in the root directory - Add your Binance API credentials (see
.env.example)
- Create a
-
Initialize the database
rails db:seed
-
Start the server
bin/dev
-
Visit
http://localhost:3000in your browser
- Create a new trader with your Binance API credentials
- The system will automatically fetch your trading history
- Navigate to the "Add Ticker" page
- Enter the cryptocurrency symbol (e.g., BTCUSDT, ETHUSDT)
- The system will import trades, klines, and generate markers
- Select a ticker from your dashboard
- View the candlestick chart with your trading markers
- Check the statistics panel for performance metrics
Hoddler uses a service-oriented design pattern:
-
API Services: Handle communication with Binance API
ImportTrades: Fetches and stores trade historyImportKlines: Retrieves candlestick data
-
Processing Services:
GenerateMarkers: Creates visual markers from trade dataUpdateTicker: Calculates and updates ticker statistics
rails test- User authentication and authorization
- Portfolio dashboard with overview of all tickers
- Enhanced chart visualization with technical indicators
- Real-time updates using WebSockets
- Mobile optimization
- 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.
- Binance API for cryptocurrency data
- Lightweight Charts for chart visualization
- Tailwind CSS for styling
