A FastAPI application that generates interactive logarithmic spiral charts of Bitcoin price data.
Before starting, ensure you have the following installed:
- Python 3.8+
- MySQL Server 8.0+
- pip (Python package manager)
git clone https://github.com/kOaDT/bitcoin-logarithmic-spiral-visualization.git
cd bitcoin-logarithmic-spiral-visualization# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
# venv\Scripts\activatepip install -r requirements.txtCREATE TABLE BitcoinPrice (
id INT AUTO_INCREMENT PRIMARY KEY,
price DECIMAL(20, 8) NOT NULL,
dateAdd DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
INDEX idx_dateAdd (dateAdd),
INDEX idx_price (price)
);Insert some sample Bitcoin price data:
INSERT INTO BitcoinPrice (price, dateAdd) VALUES
(50000.00, '2024-01-01 00:00:00'),
(52000.00, '2024-01-02 00:00:00'),
(48000.00, '2024-01-03 00:00:00'),
(51000.00, '2024-01-04 00:00:00'),
(53000.00, '2024-01-05 00:00:00'),
(49000.00, '2024-01-06 00:00:00'),
(54000.00, '2024-01-07 00:00:00');Create a .env file in the project root:
touch .envAdd the following configuration:
# Database Configuration
DB_USER=bitcoin_user
DB_PASS=SecurePassword123!
DB_HOST=localhost
DB_PORT=3306
DB_NAME=bitcoin_data
# Application Configuration
DEBUG=False# Using the start script (recommended)
chmod +x start.sh
./start.shOr manually:
python -m app.mainuvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4The application will be available at: http://localhost:8000
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Main dashboard with logarithmic spiral chart |
/health |
GET | Health check endpoint |
days(optional): Limit data to last N days (e.g.,/?days=365)
| Column | Type | Description |
|---|---|---|
id |
INT | Primary key, auto-increment |
price |
DECIMAL(20,8) | Bitcoin price in USD |
dateAdd |
DATETIME | Timestamp of price record |
- Fork the repository
- Create a 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
