CoolFace
Apppublic

OnyxMunk/text-transformer

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
App README

T3XT TR4N5F0RM3R ๐ŸŽฎ

<div align="center">

Text Transformer React Vite Tailwind

Your one-stop tool for text conversions โšก

Demo โ€ข Features โ€ข Installation โ€ข Documentation โ€ข Contributing

</div>


๐ŸŒŸ Overview

Text Transformer is a modern, cyberpunk-themed web application for converting text into various formats. Built with React and featuring a sleek, animated interface, it supports multiple conversion types with bidirectional transformation capabilities.

โœจ Features

๐Ÿ”„ Converters

  • โ€”Morse Code - Convert text to/from Morse code with proper spacing
  • โ€”Leet Speak - Transform text to/from 1337 5P34K
  • โ€”Binary - Encode/decode text to binary representation
  • โ€”Base64 - Standard Base64 encoding/decoding with Unicode support
  • โ€”Hexadecimal - Convert text to/from hexadecimal notation
  • โ€”Emoji - Text to emoji conversion (experimental)
  • โ€”TinyLlama - AI-powered text generation using TinyLlama model
  • โ€”MusicGen - AI music generation from text prompts and audio uploads

๐ŸŽฏ Core Features

  • โ€”โœ… Bidirectional Conversion - Swap between input/output formats instantly
  • โ€”โœ… Compounded Messages - Chain multiple conversions together
  • โ€”โœ… Error Handling - Graceful error messages for invalid inputs
  • โ€”โœ… Copy to Clipboard - One-click copying of results
  • โ€”โœ… Responsive Design - Works on desktop, tablet, and mobile
  • โ€”โœ… Accessibility - ARIA labels and keyboard navigation
  • โ€”โœ… Cyberpunk UI - Animated, modern interface with neon aesthetics

๐Ÿš€ Installation

Prerequisites

  • โ€”Node.js 16+
  • โ€”npm or yarn

Quick Start

bash
# Clone the repository
git clone https://github.com/kwizzlesurp10-ctrl/converter.git
cd converter

# Install dependencies
npm install

# Start development server
npm run dev

# Open http://localhost:5173 in your browser

Build for Production

bash
# Build the project
npm run build

# Preview production build
npm run preview

Run with Docker (HF Space image)

Run the pre-built image from Hugging Face (TinyLlama/HF Inference needs a token):

bash
docker run -it -p 7860:7860 --platform=linux/amd64 \
  -e VITE_HF_TOKEN="YOUR_VALUE_HERE" \
  registry.hf.space/onyxmunk-text-transformer:latest

Replace YOUR_VALUE_HERE with a Hugging Face token (or use --env-file .env if you have VITE_HF_TOKEN in .env). Then open http://localhost:7860.

On Windows you can run .\run-docker.ps1; it will use VITE_HF_TOKEN from your environment or from a .env file in the project root.

Deploy to Firebase

bash
# Install Firebase CLI
npm install -g firebase-tools

# Login to Firebase
firebase login

# Deploy
firebase deploy

๐Ÿ“ธ Demo

Main Interface

Main Page

Compounded Message Feature

Compounded Message

Error Handling

Error Handling

MusicGen Audio Generator

MusicGen Converter

๐ŸŽจ Tech Stack

  • โ€”Frontend Framework: React 18.3.1
  • โ€”Build Tool: Vite 7.2.4
  • โ€”Styling: Tailwind CSS 3.4.18
  • โ€”Testing: Vitest + Playwright
  • โ€”Hosting: Firebase Hosting
  • โ€”Icons/Emojis: OpenMoji 16.0.0

๐Ÿงช Testing

bash
# Run unit tests
npm run test

# Run tests in watch mode
npm run test:watch

# Build and verify
npm run build

๐ŸŽต MusicGen Setup (Optional)

The MusicGen converter requires a separate backend service to generate music. To use this feature:

Backend Requirements

  • โ€”A MusicGen API service running on http://localhost:8000
  • โ€”The service should expose a /api/musicgen/generate endpoint

Expected API Format

json
POST /api/musicgen/generate
{
  "prompt": "upbeat electronic dance music",
  "duration": 8,
  "melody": "data:audio/wav;base64,..." // optional
}

Response:
{
  "audio": "data:audio/wav;base64,...",
  "description": "Generated music description"
}

Setup Options

  1. 1.Use Meta's MusicGen: Follow the official MusicGen repository to set up the model
  2. 2.Use Replicate API: Integrate with Replicate's hosted MusicGen model
  3. 3.Use Hugging Face: Deploy using Hugging Face Inference API

Without the backend service, the MusicGen tab will display connection errors, but all other converters will work normally.

๐Ÿ“ Project Structure

converter/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # Converter components
โ”‚   โ”‚   โ”œโ”€โ”€ MorseCodeConverter.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ BinaryConverter.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ LeetConverter.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ Base64Converter.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ HexConverter.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ EmojiConverter.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ TinyLlamaConverter.jsx
โ”‚   โ”‚   โ””โ”€โ”€ MusicGenConverter.jsx
โ”‚   โ”œโ”€โ”€ hooks/              # Custom React hooks
โ”‚   โ”‚   โ””โ”€โ”€ useConverter.js # Shared converter logic
โ”‚   โ”œโ”€โ”€ App.jsx             # Main application component
โ”‚   โ”œโ”€โ”€ main.jsx            # Entry point
โ”‚   โ””โ”€โ”€ index.css           # Global styles and animations
โ”œโ”€โ”€ docs/                   # Comprehensive documentation
โ”œโ”€โ”€ public/                 # Static assets
โ”œโ”€โ”€ firebase.json           # Firebase configuration
โ”œโ”€โ”€ vite.config.js          # Vite configuration
โ””โ”€โ”€ tailwind.config.js      # Tailwind configuration

๐Ÿ“š Documentation

Comprehensive documentation is available in the docs/ directory:

  • โ€”[Architecture Overview](docs/architecture-enhancement-proposal.md) - System design and enhancement roadmap
  • โ€”[Quick Start Guide](docs/quick-start-guide.md) - Developer onboarding
  • โ€”[Role-Based Summary](docs/role-based-enhancement-summary.md) - Team structure and responsibilities
  • โ€”[Contributing Guide](CONTRIBUTING.md) - How to contribute

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. 1.Fork the repository
  2. 2.Create a feature branch (git checkout -b feature/amazing-feature)
  3. 3.Make your changes
  4. 4.Add tests if applicable
  5. 5.Commit your changes (git commit -m 'feat: add amazing feature')
  6. 6.Push to the branch (git push origin feature/amazing-feature)
  7. 7.Open a Pull Request

๐Ÿ—บ๏ธ Roadmap

See our complete roadmap for planned features.

Phase 1 (In Progress)

  • โ€”[x] Core converters (Morse, Leet, Binary, Base64, Hex)
  • โ€”[x] Compounded message feature
  • โ€”[x] Error handling
  • โ€”[x] Accessibility improvements
  • โ€”[ ] Additional converters (Upside Down, Zalgo, Markdown)

Phase 2 (Planned)

  • โ€”[ ] User authentication
  • โ€”[ ] Shareable links
  • โ€”[ ] Conversion history
  • โ€”[ ] Undo/redo functionality

Phase 3 (Future)

  • โ€”[ ] Text-to-Speech
  • โ€”[ ] Gamification features
  • โ€”[ ] Custom character mappings
  • โ€”[ ] Dark/Light theme toggle

๐Ÿ› Known Issues

  • โ€”Browser view tab is experimental
  • โ€”Emoji converter has limited character support

๐Ÿ“„ License

This project is open source and available under the MIT License.

๐Ÿ‘จโ€๐Ÿ’ป Author

kwizzlesurp10-ctrl

๐Ÿ™ Acknowledgments

  • โ€”React team for the amazing framework
  • โ€”Tailwind CSS for the utility-first CSS framework
  • โ€”OpenMoji for emoji support
  • โ€”All contributors and users

๐Ÿ“ž Support


<div align="center">

Made with โค๏ธ and โšก by the Text Transformer team

If you find this project useful, please consider giving it a โญ on GitHub!

</div>