Skip to content

A full-stack application that instantly translates comics and manga using AI-powered OCR and translation services. Features a web application, Chrome extension, and production-ready deployment configuration.

Notifications You must be signed in to change notification settings

Opikadash/Inkverta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Comic and Novel Translator

A full-stack application that instantly translates comics and manga using AI-powered OCR and translation services. Features a web application, Chrome extension, and production-ready deployment configuration.

🌟 Features

Web Application

  • Drag & Drop Upload: Upload comic images with ease
  • Advanced OCR: Multi-language text extraction using Tesseract.js
  • Real-time Translation: Support for Google Translate and DeepL APIs
  • Image Editor: Interactive canvas for text selection and editing
  • Batch Processing: Handle multiple images simultaneously
  • Download Results: Export translated comics in various formats

Chrome Extension

  • Universal Compatibility: Works on MangaDex, Webtoons, Crunchyroll, and more
  • Right-click Translation: Instantly translate images from context menu
  • Overlay Display: Non-intrusive translation overlays
  • Auto-translate: Optional automatic translation on image click
  • Translation History: Keep track of previous translations
  • Customizable Settings: Configure languages, services, and behavior

Production Features

  • Docker Deployment: Complete containerization with Docker Compose
  • SSL/HTTPS Support: Automated certificate management
  • Health Monitoring: Prometheus, Grafana, and Alertmanager integration
  • Load Balancing: Nginx reverse proxy with rate limiting
  • Automated Backups: Scheduled backups for data persistence
  • Performance Optimization: Redis caching and image optimization

πŸš€ Quick Start

Prerequisites

  • Node.js 16+ and npm 8+
  • Docker and Docker Compose (for containerized deployment)
  • Google Translate API key (required)
  • DeepL API key (optional, for better translations)

1. Clone and Setup

git clone https://github.com/Opikadash/Inkverta.git
cd Inkverta
npm run setup

2. Configure Environment

# Edit backend/.env and add your API keys
cp backend/.env.example backend/.env
# Add your GOOGLE_TRANSLATE_API_KEY and DEEPL_API_KEY

3. Development Mode

# Start both backend and frontend
npm run dev

# Or start individually
npm run dev:backend  # Starts on http://localhost:3001
npm run dev:frontend # Starts on http://localhost:3000

4. Production Deployment

# Using Docker Compose (recommended)
npm run docker:prod

# Or manual deployment
npm run build
npm run start

πŸ“ Project Structure

comic-translator/
β”œβ”€β”€ backend/                    # Node.js/Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/        # Request handlers
β”‚   β”‚   β”œβ”€β”€ middleware/         # Express middleware
β”‚   β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   └── utils/             # Utility functions
β”‚   β”œβ”€β”€ uploads/               # File storage
β”‚   └── server.js              # Entry point
β”œβ”€β”€ frontend/                  # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”œβ”€β”€ services/         # API clients
β”‚   β”‚   └── utils/            # Utility functions
β”‚   └── vite.config.js        # Vite configuration
β”œβ”€β”€ chrome-extension/          # Browser extension
β”‚   β”œβ”€β”€ manifest.json         # Extension manifest
β”‚   β”œβ”€β”€ popup/               # Extension popup
β”‚   β”œβ”€β”€ content/             # Content scripts
β”‚   └── background/          # Background scripts
β”œβ”€β”€ docker/                   # Docker configurations
β”œβ”€β”€ deployment/              # Production configs
β”œβ”€β”€ monitoring/              # Monitoring setup
└── scripts/                 # Utility scripts

πŸ› οΈ API Documentation

Upload Endpoints

  • POST /api/upload/single - Upload single image
  • POST /api/upload/multiple - Upload multiple images

OCR Endpoints

  • POST /api/ocr/extract - Extract text from image
  • POST /api/ocr/batch - Batch text extraction

Translation Endpoints

  • POST /api/translate - Translate text
  • POST /api/translate/batch - Batch translation
  • GET /api/translate/languages - Get supported languages

Health Endpoints

  • GET /api/health - Application health status
  • GET /api/health/ready - Readiness probe

πŸ”§ Configuration

Environment Variables

# Server Configuration
NODE_ENV=production
PORT=3001
FRONTEND_URL=http://localhost:3000

# Translation APIs
GOOGLE_TRANSLATE_API_KEY=your_key_here
DEEPL_API_KEY=your_key_here

# OCR Configuration
OCR_LANGUAGE=eng+jpn+kor+chi_sim+chi_tra
OCR_PSM=6
OCR_OEM=3

# Cache and Performance
CACHE_TTL=3600
RATE_LIMIT_MAX=100

Chrome Extension Setup

  1. Open Chrome β†’ Extensions β†’ Developer mode
  2. Click "Load unpacked"
  3. Select the chrome-extension folder
  4. Configure settings in the extension popup

πŸš€ Deployment Options

1. Docker (Recommended)

# Production deployment
docker-compose -f deployment/docker-compose.prod.yml up -d

# Development
docker-compose -f docker/docker-compose.dev.yml up

# With monitoring
npm run monitoring:up

2. Railway

# Deploy backend to Railway
railway up --service backend

# Configure environment variables in Railway dashboard

3. Heroku

# Deploy using Heroku CLI
heroku create comic-translator-app
git push heroku main

4. Manual VPS

# Run setup script
./scripts/setup.sh

# Deploy with SSL
./scripts/deploy.sh production

πŸ“Š Monitoring

The application includes comprehensive monitoring:

  • Prometheus: Metrics collection and alerting
  • Grafana: Beautiful dashboards and visualizations
  • Alertmanager: Smart alert routing and management
  • Loki: Centralized logging
  • Node Exporter: System metrics

Access monitoring:

πŸ”’ Security Features

  • Rate limiting on all endpoints
  • CORS protection
  • Helmet.js security headers
  • File type validation
  • Size limits on uploads
  • SSL/TLS encryption
  • Input sanitization

πŸ§ͺ Testing

# Run all tests
npm run test

# Run backend tests
npm run test:backend

# Run frontend tests
npm run test:frontend

# Linting
npm run lint

# Code formatting
npm run format

πŸ“ Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run tests: npm run test
  5. Commit: git commit -m 'Add feature'
  6. Push: git push origin feature-name
  7. Create a Pull Request

πŸ“„ License

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

πŸ†˜ Support

πŸ™ Acknowledgments


⭐ If you find this project helpful, please give it a star on GitHub!

About

A full-stack application that instantly translates comics and manga using AI-powered OCR and translation services. Features a web application, Chrome extension, and production-ready deployment configuration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published