A production-ready cryptocurrency price narration platform with a modern React frontend and Flask API backend. Get real-time crypto prices with an intuitive dashboard and audio narration support.
- π¨ Modern React Frontend with TypeScript and Tailwind CSS
- π Fast cryptocurrency price fetching from CoinGecko API
- π΅ Text-to-speech narration for prices and custom text
- π Multiple cryptocurrency support with price change data
- π RESTful API with comprehensive endpoints
- π³ Docker-ready for easy deployment
- βοΈ Render deployment for quick demos
- π Health monitoring and logging
- π Production security with rate limiting and CORS
# Clone the repository
git clone https://github.com/yourusername/quantlink-fren-narrator.git
cd quantlink-fren-narrator
# Start development environment (builds frontend + starts backend)
./dev-start.sh
# Access the application
# Frontend: http://localhost:5000
# API: http://localhost:5000/api/# Terminal 1: Start backend API
python web_api.py --debug
# Terminal 2: Start frontend development server
cd frontend
npm install
npm run dev
# Frontend: http://localhost:5173 (with API proxy)Perfect for sharing demos internally
- Push your code to GitHub
- Connect your repo to Render
- Deploy automatically using the included
render.yaml - Your app will be live at
https://your-app.onrender.com
# Build and run with Docker
docker build -t quantlink-narrator .
docker run -p 8000:8000 quantlink-narrator
# Or use the quick test script
./quick-deploy.shThe React frontend provides:
- π Real-time price dashboard with live crypto feeds
- ποΈ Interactive controls for price fetching and narration
- π Price history visualization with candlestick charts
- π Audio narration controls with customizable options
- π± Responsive design for desktop and mobile
- π¨ Modern UI/UX with smooth animations
- React 19 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- Custom components for crypto visualization
- API integration with the Flask backend
GET /api/health
# Returns: {"status": "healthy", "version": "1.0.0"}# Single price
GET /api/crypto/price?crypto=bitcoin¤cy=usd
# Multiple prices
GET /api/crypto/prices?cryptos=bitcoin,ethereum¤cy=usd
# Price with 24h change
GET /api/crypto/price?crypto=bitcoin&with_24h_change=true# Narrate custom text
POST /api/narrator/text
{
"text": "Hello world",
"lang": "en",
"slow": false,
"return_audio": false
}
# Narrate crypto price
POST /api/narrator/crypto
{
"crypto": "bitcoin",
"currency": "usd",
"with_24h_change": true,
"return_audio": false
}
# Get audio file by ID
GET /api/narrator/audio/<file_id>- Setup time: 5 minutes
- Cost: Free tier available
- Perfect for: Quick demos, prototypes, team sharing
- Connect your GitHub repo to Render
- Render auto-detects the
render.yamlconfiguration - Deploy with one click β
- Features: Auto-deploy, SSL, monitoring
- Setup time: 15 minutes
- Cost: Variable (depends on hosting)
- Perfect for: Production environments, full control
# Test Docker setup
./quick-deploy.sh# Docker Compose (recommended)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down# Google Cloud Run
gcloud builds submit --tag gcr.io/PROJECT_ID/quantlink-narrator
gcloud run deploy --image gcr.io/PROJECT_ID/quantlink-narrator
# AWS/Azure - deploy to your preferred container serviceCopy env.example to .env and customize:
# Production settings
FLASK_ENV=production
DEFAULT_CRYPTO_ID=bitcoin
DEFAULT_VS_CURRENCY=usd
# Docker settings
HOST=0.0.0.0
PORT=8000
WORKERS=4- β Rate limiting (10 requests/second)
- β CORS protection
- β Security headers
- β Input validation
- β Error handling
# Test any deployment
python test_deployment.py http://localhost:8000
python test_deployment.py https://your-app.onrender.com# Health check
curl https://your-domain.com/api/health
# Price endpoint
curl "https://your-domain.com/api/crypto/price?crypto=bitcoin"
# Text narration
curl -X POST "https://your-domain.com/api/narrator/text" \
-H "Content-Type: application/json" \
-d '{"text":"Hello world"}'# Render: Built-in dashboard
# Docker: docker-compose logs -f
# Cloud: Provider log viewers| Platform | Setup Time | Monthly Cost | Best For |
|---|---|---|---|
| Render | 5 minutes | $0 (free tier) | Demos, prototypes |
| Docker + VPS | 15 minutes | $5-20 | Production |
| Cloud Run | 10 minutes | Pay-per-use | Variable traffic |
quantlink-fren-narrator/
βββ frontend/ # React frontend application
β βββ src/ # React source code
β β βββ components/ # React components
β β βββ App.tsx # Main App component
β β βββ main.tsx # Entry point
β βββ public/ # Public assets
β βββ package.json # Frontend dependencies
β βββ vite.config.ts # Vite configuration
β βββ dist/ # Built frontend (auto-generated)
βββ src/ # Backend core modules
β βββ narrator.py # Text-to-speech functionality
β βββ price_fetcher.py # Cryptocurrency price fetching
β βββ app_config.py # Configuration management
βββ static/ # Built frontend files (served by Flask)
βββ web_api.py # Main Flask application
βββ wsgi.py # WSGI entry point
βββ dev-start.sh # Development startup script
βββ Dockerfile # Multi-stage container build
βββ docker-compose.yml # Docker Compose setup
βββ render.yaml # Render deployment config
βββ quick-deploy.sh # Docker test script
βββ requirements.txt # Python dependencies
# Run deployment tests
python test_deployment.py http://localhost:8000
# Test Docker locally
./quick-deploy.sh
# Manual API testing
curl http://localhost:8000/api/crypto/price?crypto=bitcoin- Check build logs in Render dashboard
- Verify
render.yamlconfiguration - Ensure environment variables are set
- Check container logs:
docker logs <container_id> - Ensure all dependencies in requirements.txt
- Verify port mapping is correct
- Test health endpoint first:
/api/health - Check network connectivity to CoinGecko API
- Verify gTTS can connect for audio generation
Use Render when:
- π― Quick internal demos
- π― Prototyping and testing
- π― Want zero-config deployment
- π― Sharing with team members
Use Docker when:
- π― Production environments
- π― Need full control over environment
- π― Scaling requirements
- π― Want consistent dev/prod environments
git pushto GitHub- Connect repo to Render
- Deploy automatically β
./quick-deploy.sh(test locally)- Deploy to your cloud provider
- Set up monitoring β
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Ready to deploy?
- Quick demo: Use Render
- Production: Use Docker Get your API running in minutes! π