Skip to content
Project template·Pro

Next.js + Tailwind + i18n

Next.js 15 project with next-intl and Tailwind CSS, and one page in English and Spanish at /en and /es. Dark mode follows the system. Needs the Linux environment with Node.js; the first npm install downloads around 400 MB.

You need PocketCode Pro to install it.

If PocketCode is installed on your Android device, this opens the page in the app.

Preview

Files

README.md
messages/en.json
messages/es.json
next.config.ts
package-lock.json
package.json
postcss.config.mjs
src/app/[locale]/layout.tsx
src/app/[locale]/page.tsx
src/app/globals.css
src/components/LocaleSwitcher.tsx
src/i18n/navigation.ts
src/i18n/request.ts
src/i18n/routing.ts
src/middleware.ts
tailwind.config.ts
tsconfig.json

README.md

# Next.js 15 + Tailwind + next-intl A one-page site in English and Spanish, with routes per language (`/en`, `/es`), Tailwind CSS and dark mode that follows the system setting. ## Run it in PocketCode You need the app's Linux environment with Node.js 18.18 or newer (the Developer pack in Terminal › Linux includes Node.js and npm). 1. Open the terminal in this project's folder. 2. Install the dependencies (the first time downloads around 400 MB and needs internet): ```sh npm install ``` 3. Start the development server: ```sh npm run dev ``` 4. Open http://localhost:3000 in the phone's browser. It redirects to `/en` or `/es` depending on the browser language. Other commands: `npm run build` (production build), `npm start` (serve that build), `npm run typecheck`. ## Where things are | Path | What it does | |---|---| | `messages/en.json`, `messages/es.json` | The texts of each language | | `src/i18n/routing.ts` | The list of languages and the default one | | `src/i18n/request.ts` | Loads the messages of the current language | | `src/middleware.ts` | Picks the language on the first visit and redirects | | `src/app/[locale]/page.tsx` | The page | | `src/components/LocaleSwitcher.tsx` | The language selector | | `tailwind.config.ts` | Tailwind settings (`darkMode: 'media'`) | ## Add a language 1. Add its code to `locales` in `src/i18n/routing.ts`, for example `'fr'`.

This preview is shortened. You get the full content when you install it.

Changes in 1.0.0

First version.

Related

Vite + React + TypeScriptProProject templateA habit tracker in React and TypeScript, built with Vite 8, with a weekly grid, streaks, a custom hook and a test. It needs the Linux environment with Node.js. The first npm install downloads about 25 packages (around 80 MB).Vite + Vue + TypeScriptProProject templateA focus timer in Vue 3 and TypeScript, built with Vite 8, with focus sessions, breaks and today's total. The code uses two composables and has a test. It needs the Linux environment with Node.js; the first npm install downloads about 50 packages (around 85 MB).Vite + Svelte + TypeScriptProProject templateFlashcards in Svelte 5 and TypeScript, built with Vite 8. Each card moves through five Leitner boxes and comes back when it is due. It needs the Linux environment with Node.js; the first npm install downloads about 45 packages (around 75 MB).Button (React + Tailwind)FreeButtonTypeScript button with primary and secondary styles, a visible focus ring and a loading spinner that also sets aria-busy. The secondary style has dark mode colours.Landing hero (Next.js + Tailwind)FreePageHero section for the Next.js App Router: a title, a subtitle and two links over a soft gradient. It uses dark colours when the system is in dark mode.Static landing pageProProject templateA one-page site in plain HTML and CSS with a header and folding menu, a hero, a feature grid, an FAQ and a footer. Colours follow the system's light or dark setting. There is no build step and it doesn't need Linux: open index.html and tap the globe icon.