Skip to content

zapPilot/FromFedToChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

From Fed to Chain

A comprehensive content pipeline and streaming platform for crypto/macro economics educational content

From Fed to Chain is a dual-platform system that combines a powerful Node.js CLI pipeline for content management with a modern Flutter mobile/web app for audio streaming. The platform creates conversational Chinese explainers about cryptocurrency and macro economics in the style of premium educational platforms.

πŸ—οΈ Architecture Overview

The project consists of two main components working in harmony:

πŸ“± Flutter Audio Streaming App

A modern cross-platform app (Web/iOS/Android) featuring:

  • Background Audio Playback with media controls and lock screen support
  • Multi-language Content (Traditional Chinese, English, Japanese)
  • HLS Streaming for optimized audio delivery
  • Advanced Playback Features including speed control, seeking, and autoplay
  • Modern UI with dark theme and smooth animations

πŸ”§ Node.js CLI Pipeline

A powerful content management system featuring:

  • Interactive Content Review workflow with feedback collection
  • Automated Translation using Google Translate API
  • Text-to-Speech Generation with Google Cloud TTS
  • Social Media Hook Generation for content promotion
  • Cloudflare R2 Integration for M3U8 streaming file delivery

πŸš€ Quick Start

Prerequisites

  • Node.js (v18+)
  • Flutter (3.22.2+, Dart 3.0+)
  • FFmpeg (for audio processing)
  • rclone (for cloud uploads)

Installation

# Clone the repository
git clone <your-repo-url>
cd FromFedToChain

# Install Node.js dependencies
npm install

# Install Flutter dependencies
npm run install:flutter

# Check pipeline dependencies
npm run check-deps

Development Setup

Flutter App (Web Development)

# Run Flutter app in Chrome (with CORS disabled for development)
flutter run -d chrome --web-browser-flag="--disable-web-security"

# For mobile development
flutter run

Node.js CLI Pipeline

# Start interactive content review
npm run review

# Process content through full pipeline
npm run pipeline <content-id>

# Run comprehensive tests
npm run test

✨ Key Features

Content Management

  • Human-First Review Workflow - Interactive CLI for content quality assurance
  • Multi-language Support - Automatic translation to English and Japanese
  • Flexible Content Schema - Structured JSON with metadata and status tracking
  • Nested File Organization - Content organized by language and category

Audio Streaming

  • Modern Flutter UI - Responsive design with smooth animations
  • Background Playback - Continue listening while using other apps
  • Media Session Integration - Lock screen controls and system notifications
  • Playlist Management - Organize content by categories and completion status
  • Playback Controls - Speed adjustment, seeking, and autoplay features

Technical Excellence

  • Comprehensive Testing - 174+ Node.js tests, Flutter widget tests with coverage
  • CI/CD Pipeline - GitHub Actions with automated testing and formatting
  • Code Quality - ESLint, Prettier, Flutter analyze with pre-commit hooks
  • Cross-Platform - Web, iOS, and Android support from single codebase

πŸ“ Project Structure

FromFedToChain/
β”œβ”€β”€ src/                     # Node.js CLI Pipeline
β”‚   β”œβ”€β”€ cli.js              # Interactive CLI interface
β”‚   β”œβ”€β”€ ContentManager.js   # Content CRUD operations
β”‚   β”œβ”€β”€ ContentSchema.js    # Schema validation
β”‚   └── services/           # Pipeline services (TTS, Translation, etc.)
β”œβ”€β”€ app/                    # Flutter Streaming App
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ models/         # Data models
β”‚   β”‚   β”œβ”€β”€ services/       # Audio & content services
β”‚   β”‚   β”œβ”€β”€ screens/        # App screens
β”‚   β”‚   └── widgets/        # UI components
β”‚   └── pubspec.yaml       # Flutter dependencies
β”œβ”€β”€ content/                # Content files (nested by language/category)
β”œβ”€β”€ audio/                  # Generated audio files
β”œβ”€β”€ tests/                  # Comprehensive test suite
└── .github/workflows/      # CI/CD configuration

🎯 Content Workflow

1. Content Creation

# Create source content in Traditional Chinese
content/zh-TW/daily-news/2025-01-15-bitcoin-analysis.json

2. Interactive Review

npm run review
# Review content with feedback collection
# [a]ccept, [r]eject, [s]kip, [q]uit options

3. Automated Pipeline

npm run pipeline 2025-01-15-bitcoin-analysis
# Translation β†’ TTS β†’ Social Hooks β†’ M3U8 Generation

4. Audio Streaming

flutter run -d chrome
# Launch Flutter app to stream generated content

πŸ§ͺ Testing & Quality

Test Coverage

  • Node.js: 174 passing tests (12 skipped)
  • Flutter: 16 widget tests with coverage reporting
  • CI/CD: Automated testing on every commit

Quality Assurance

# Run all tests
npm run test

# Format all code
npm run format

# Lint and analyze
npm run lint

πŸ“Š Content Schema

Each content file follows a structured schema:

{
  "id": "2025-01-15-bitcoin-analysis",
  "status": "reviewed",
  "category": "daily-news",
  "date": "2025-01-15",
  "language": "zh-TW",
  "title": "ζ―”η‰ΉεΉ£εΈ‚ε ΄εˆ†ζž...",
  "content": "δ½ ζœ‰ζ²’ζœ‰ζƒ³ιŽ...",
  "references": ["資料來源"],
  "audio_file": "audio/zh-TW/2025-01-15-bitcoin-analysis.wav",
  "social_hook": "πŸš€ ζ―”η‰ΉεΉ£ηͺη ΄ζ–°ι«˜...",
  "streaming_urls": {
    "m3u8": "https://cdn.example.com/audio.m3u8"
  },
  "feedback": {
    "content_review": "Approved for publication"
  }
}

βš™οΈ Configuration

Environment Variables

# Copy example files
cp .env.sample .env
cp app/.env.example app/.env

# Configure required services:
# - Google Cloud TTS credentials
# - Cloudflare R2 storage
# - API endpoints

Pipeline Dependencies

# macOS setup
brew install ffmpeg

# Install and configure rclone
curl https://rclone.org/install.sh | sudo bash
rclone config create r2 s3 provider=Cloudflare ...

πŸš€ Deployment

Flutter Web

npm run build:flutter
# Builds optimized web version

Mobile Apps

cd app
flutter build appbundle --release
flutter build ios    # iOS (requires Xcode)

πŸ”§ Troubleshooting

Common Issues

Pipeline fails with "remote not configured"

  • Solution: Configure rclone with npm run check-deps

Flutter app CORS issues

  • Solution: Use --web-browser-flag="--disable-web-security" for development

Audio streaming not working

  • Solution: Ensure content has streaming_urls generated by pipeline

See CLAUDE.md for comprehensive troubleshooting guide.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Run tests (npm run test)
  4. Format code (npm run format)
  5. Commit changes (git commit -m 'Add amazing feature')
  6. Push to branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

All commits trigger automated CI testing and formatting checks.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Google Cloud - Text-to-Speech and Translation APIs
  • Cloudflare R2 - Audio streaming infrastructure
  • Flutter Community - Exceptional audio playback packages
  • Open Source - Built on the shoulders of giants

Built with ❀️ for educational content creators and crypto enthusiasts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •