Skip to content

Repository files navigation

πŸ“ˆ BitFlow Dashboard

Modern Bitcoin tracking dashboard with beautiful interactive charts and real-time data

Bitcoin Nuxt.js TypeScript Tailwind CSS

✨ Features

🎨 Dynamic Charts - colors change based on trend (green for growth, red for decline)
πŸ“Š Interactive Tooltips - detailed information with percentage changes
⚑ Real-time Updates - data updates automatically
🎯 Trend Indicator - visual price direction indicator
πŸ“± Responsive Design - works on all devices
πŸš€ Fast Animations - smooth transitions and modern UI

πŸ›  Tech Stack

  • Frontend: Nuxt 4, Vue 3, TypeScript, Tailwind CSS
  • Charts: Chart.js + Vue-ChartJS with custom gradients
  • Backend: Prisma ORM + PostgreSQL
  • API: Binance API for real-time price data
  • Styling: Modern dark theme with gradients

πŸš€ Quick Start

1. πŸ“¦ Installation

# Clone the project
git clone https://github.com/authorless/BitFlow-Dashboard.git
cd BitFlow-Dashboard

# Install exactly the tested dependency tree
npm ci

2. πŸ—ƒοΈ Database Setup

# Copy environment settings
cp .env.example .env

# Edit .env and use your own password
DATABASE_URL="postgresql://bitflow:change-me@localhost:5432/bitcoin_db"

# Apply the existing migrations
npm run prisma:deploy

# Generate Prisma client
npm run prisma:generate

3. 🎯 Launch

# Development mode
npm run dev
# 🌐 http://localhost:3000

# Production build
npm run build
npm run start

🐳 Automatic Docker Build with GitHub Actions

The project verifies every pull request and publishes a Docker image after a successful push to main using GitHub Actions.

The Docker image is published to DockerHub with the tag:

<your_dockerhub>/bitflow-dashboard:latest

You need to set up the secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN in your repository settings.

Workflow file: .github/workflows/docker-image.yml

🐳 Docker (Recommended)

# Create local settings and change POSTGRES_PASSWORD first
cp .env.example .env

# Start the entire environment with one command
npm run docker:up

# Stop
npm run docker:down

# Rebuild images
npm run docker:build

πŸ“ Project Structure

BitFlow-Dashboard/
β”œβ”€β”€ components/
β”‚   └── BitcoinChart.vue       # Interactive chart with animations
β”œβ”€β”€ pages/
β”‚   └── index.vue              # Main dashboard page
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ api/                   # REST API endpoints
β”‚   β”‚   β”œβ”€β”€ price.ts           # Current Bitcoin price
β”‚   β”‚   β”œβ”€β”€ historical.ts      # Historical data by periods
β”‚   β”‚   └── health.ts          # Application and database health check
β”‚   β”œβ”€β”€ db/
β”‚   β”‚   └── prisma.ts          # PostgreSQL connection
β”‚   └── services/
β”‚       β”œβ”€β”€ binance.ts         # Binance API integration
β”‚       β”œβ”€β”€ database.ts        # Database operations
β”‚       └── historical.ts      # Historical data logic
β”œβ”€β”€ plugins/
β”‚   └── chartjs.client.ts      # Chart.js configuration
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma          # Database schema
└── docker-compose.yml         # Docker environment

πŸ”Œ API Endpoints

Method Endpoint Description
GET /api/price πŸ’° Current Bitcoin price
GET /api/historical πŸ“Š Historical data by period and timestamp range
GET /api/health ❀️ Application and database readiness

Request Examples:

# Current price
curl http://localhost:3000/api/price

# Historical data (timestamps are milliseconds since Unix epoch)
curl "http://localhost:3000/api/historical?period=day&startDate=1755907200000&endDate=1755993600000"

# Health check
curl http://localhost:3000/api/health

βš™οΈ Available Scripts

npm run dev              # πŸš€ Start development
npm run build            # πŸ“¦ Build for production
npm run start            # 🎯 Start production server
npm run typecheck        # βœ… Validate TypeScript and Vue files
npm run prisma:studio    # πŸ” Open Prisma Studio
npm run prisma:deploy    # πŸ—ƒοΈ Apply existing migrations
npm run prisma:migrate   # πŸ—ƒοΈ Create database migration
npm run prisma:generate  # ⚑ Generate Prisma client

πŸ“‹ Requirements

  • Node.js 24+
  • npm 11+
  • PostgreSQL 18 recommended
  • Docker (recommended)

πŸ”§ Environment Variables

# Database
DATABASE_URL="postgresql://bitflow:change-me@db:5432/bitcoin_db"
POSTGRES_DB=bitcoin_db
POSTGRES_USER=bitflow
POSTGRES_PASSWORD=change-me

# Market data
BINANCE_API_BASE_URL=https://api.binance.com/api/v3

# Enable only behind a trusted reverse proxy
TRUST_PROXY=false

πŸ” Security and reliability

  • API inputs are validated and request ranges are limited to 366 days.
  • Public market-data routes have per-client rate limits and upstream timeouts.
  • Database refreshes are atomic, and cached prices remain available if the provider fails.
  • Production responses include security headers; the Docker app runs as an unprivileged, read-only container.
  • Major dependency upgrades require manual review, while CI installs, type-checks, and builds every pull request.

Upgrading an existing Docker database

PostgreSQL data directories cannot be reused across major versions. Before starting this version over an existing PostgreSQL 16 Docker volume, run:

./scripts/migrate-postgres-18.sh

The migration stops the Compose stack, copies the application database into a new PostgreSQL 18 volume, verifies the restored database, and keeps the original PostgreSQL 16 volume as a rollback copy.

🎨 What's New in Design

  • βœ… Dynamic Colors - chart changes color based on trend
  • βœ… Modern Gradients - beautiful gradients for chart fills
  • βœ… Smooth Animations - fast and responsive transitions (800ms)
  • βœ… Enhanced Tooltips - show percentage changes
  • βœ… Trend Indicator - visual price direction indicator
  • βœ… Responsive Design - looks great on any screen size

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the GNU AGPL v3. See LICENSE file for details.


Made with ❀️ for the crypto community

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages