Loading repository data…
Loading repository data…
arnobt78 / repository
A modern, user-friendly language translator web application built with Next.js, React, and TypeScript. It uses the free MyMemory Translation API to translate text between dozens of languages. The app features a responsive UI with TailwindCSS, smooth animations via Framer Motion, and a server-rendered shell for fast first paint—ideal for learning
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A modern, user-friendly language translator web application built with Next.js, React, and TypeScript. It uses the free MyMemory Translation API to translate text between dozens of languages. The app features a responsive UI with TailwindCSS, smooth animations via Framer Motion, and a server-rendered shell for fast first paint—ideal for learning full-stack React patterns, API integration, and deployment on Vercel.
This application lets users translate text between multiple languages in the browser. There is no custom backend—the frontend talks directly to the MyMemory Translation API. The app demonstrates Next.js App Router, server vs. client components, form state, API calls, and responsive design. It is suitable for beginners learning React/Next.js and for anyone who wants a ready-to-deploy translator UI.
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| UI | React 19, TypeScript 5.7 |
| Styling | TailwindCSS 3, tw-animate-css |
| Animation | Framer Motion 11 |
| UI Primitives | shadcn/ui, Base UI, Lucide React |
| API | MyMemory Translation API (REST, no key required) |
| Deployment | Vercel |
| Linting | ESLint (eslint-config-next) |
language-translator/
├── app/
│ ├── layout.tsx # Root layout: fonts, metadata, body background, critical CSS
│ ├── page.tsx # Home route: server-rendered card shell + ClientToggle
│ └── globals.css # Tailwind base, ripple, CTA shine, stream cursor
├── components/
│ ├── ClientToggle.tsx # Client: toggles between TranslatorStart and TranslatorApp
│ ├── pages/
│ │ ├── TranslatorStart.tsx # Start screen: greetings, CTA, “How it works”
│ │ ├── TranslatorApp.tsx # Main translator UI: languages, input, output, actions
│ │ └── HomePage.tsx # Legacy client wrapper (optional; page uses ClientToggle)
│ └── ui/
│ ├── RippleButton.tsx # Button with ripple effect
│ ├── card.tsx # Card / CardContent (shadcn)
│ ├── input.tsx # Input (shadcn)
│ ├── button.tsx # Button (shadcn)
│ ├── skeleton.tsx # Skeleton (shadcn)
│ └── badge.tsx # Badge (shadcn)
├── data/
│ └── languages.ts # Map of language codes → display names (MyMemory-compatible)
├── hooks/
│ └── useClickOutside.ts # Close dropdown when clicking outside
├── lib/
│ ├── api.ts # translate(), toApiLangCode() – MyMemory API
│ └── utils.ts # cn() – classnames merge (clsx + tailwind-merge)
├── types/
│ └── index.ts # LanguageCode, MyMemory response, component props
├── public/
│ ├── favicon.ico
│ └── hero1.webp # Hero background image
├── .env.example # Optional env vars (title, API URL override)
├── next.config.ts
├── tailwind.config.ts
├── tsconfig.json
├── eslint.config.mjs
├── package.json
└── README.md
Clone the repository
git clone https://github.com/arnobt78/Language-Translator--ReactVite.git
cd language-translator
Install dependencies
npm install
Optional: environment variables
Copy .env.example to .env.local if you want to override the app title or API base URL (see Environment Variables). You do not need any env vars to run the app; it works out of the box.
Start the development server
npm run dev
Open in the browser
Visit http://localhost:3000 (Next.js default port).
You do not need a .env file to run this project. The app works without any environment variables. All of the following are optional.
To customize behavior:
Copy the example file:
cp .env.example .env.local
Edit .env.local (never commit real secrets; .env.local is usually gitignored).
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_APP_TITLE | No | Browser tab / SEO title. Default: "Language Translator". |
NEXT_PUBLIC_MYMEMORY_API_URL | No | MyMemory API base URL. Only set this if you use a proxy; default is https://api.mymemory.translated.net. |
How to get / set them:
NEXT_PUBLIC_APP_TITLE=My Translator (or any string) in .env.local.NEXT_PUBLIC_MYMEMORY_API_URL to that base URL (e.g. https://your-proxy.com).No API key is required for the default MyMemory usage; check MyMemory docs for rate limits.
npm run dev → http://localhost:3000npm run build then npm run startnpm run lintUser flow:
The app uses the Next.js App Router with a single main route:
| Route | File | Description |
|---|---|---|
/ | app/page.tsx | Home. Renders a server-rendered card shell; inside it, the client component ClientToggle switches between the start screen and the translator. |
There are no other routes. All UI is on this single page; “Start” vs “Translator” is client-side state only.
There is no custom backend. The frontend calls the MyMemory Translation API from the client.
GET https://api.mymemory.translated.net/get?q={text}&langpair={from}|{to}lib/api.ts – translate(text, langPair) and toApiLangCode(code) (e.g. de-DE → de).Flow:
TranslatorApp calls translate(inputText, \${from}|${to}`)` with API-friendly language codes.lib/api.ts builds the URL, fetches, parses JSON, and returns responseData.translatedText (or handles same-language / errors).Important: Same-language pairs are blocked in the UI; invalid or error responses are surfaced as user-friendly messages. No API key is required for normal use.
| Component | Role | Reusable? |
|---|---|---|
| ClientToggle | Client-only. Holds showTranslatorApp state; renders either TranslatorStart or TranslatorApp. | Yes – pattern for “two views, one toggle”. |
| TranslatorStart | Start screen: Framer Motion greetings card, title, description, CTA button, “Pick languages / Type text / Get translation” row. | Yes – swap copy and onStart for your own flow. |
| TranslatorApp | Full translator: language dropdowns (with search), textarea, Translate/Swap/Copy/Clear, streaming output, close button. | Yes – pass onClose and optionally adapt language list or API. |
| RippleButton | Button that shows a ripple on click (see RIPPLE_BUTTON_EFFECT.md). Extends normal but |