Skip to content

AniketKu23/Multilingual-Language-Translator-API

Repository files navigation

Multilingual Translation API & AuraTranslate Dashboard

A fully featured Translation API and frontend dashboard that allows you to translate JSON and CSV language files seamlessly. The application features a premium, modern Light Pastel Theme dashboard for interactive file uploads, setting configurations, authentication renewal, and live translation previews.


Features

  • Gorgeously Styled Dashboard: Modern, light pastel UI (soft lavender, mint, and blue accents, glassmorphic cards, smooth animations, and Outfit typography) served at the root / path.
  • Demo JSON Inputs: Ready-to-use sample JSON inputs (Simple, Dashboard UI, and E-commerce) available in the dashboard to load directly or download.
  • JSON File Translation: Upload keys, translate them, and retrieve structured JSON translations.
  • CSV Export Support: Extract translations directly into standard CSV formats.
  • JWT Authentication: Secured routing with self-renewing token state on the dashboard.
  • Swagger Documentation: Self-documenting API spec available at /api-docs.
  • Translation Caching: Fast re-runs and reduced cost via node-cache.
  • Bulk Translation Optimization: Translations executed in parallel batches of 5.
  • Docker Support: Containerized configuration for easy deployment.

Installation & Setup

  1. Install dependencies:

    npm install
  2. Configure Environment Variables: Create a .env file in the root directory (already pre-configured for local testing):

    PORT=3000
    JWT_SECRET=IT4TSOLUTIONS

Run Locally

Start the translation server:

npm start

Or run in development mode with nodemon:

npm run dev

The app will be running at http://localhost:3000:


API Endpoints

1. Authentication

  • Endpoint: POST /api/auth/login
  • Response: Generates a JWT token for translation authorization.

2. Translation

  • Endpoint: POST /api/translate
  • Headers: Authorization: Bearer <JWT_TOKEN>
  • Content-Type: multipart/form-data
  • Parameters:
    • file: JSON translation file (binary)
    • Code: Translation namespace (e.g. shared, dashboard)
    • LanguageCode: Target language code (e.g. es, fr, de, ar, hi, ja)
    • filetype: Format of output (json or csv)

Docker Deployment

  1. Build the container:

    docker build -t multilingual-api .
  2. Run the container:

    docker run -p 3000:3000 -e PORT=3000 -e JWT_SECRET=IT4TSOLUTIONS multilingual-api

    Access the app in your browser at http://localhost:3000.

About

Node.js API for multilingual JSON translation with Swagger, JWT authentication, CSV export, caching, and Docker support.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors