A complete, production-grade Next.js starter with internationalization, authentication, UI components, testing, and more.
- Are you tired of manually managing translation files in your projects?
- Do you want to streamline your internationalization workflow with fully automated tooling?
- Are you looking for a robust, scalable architecture that combines authentication, localization, theming, and type safety β all in one place?
- Would you benefit from a modern stack with built-in support for testing, reusable UI components, and strict typing from end to end?
- Do you want to future-proof your application with a maintainable and extensible codebase?
If so, this boilerplate is for you. Fork it, customize it, and accelerate your development with a solid foundation that eliminates repetitive work and allows you to focus on what really matters β building great products.
This project is live and deployed on Vercel! Visit the live demo: Next i18n Auth Boilerplate Live
Make sure you have the following installed:
Clone the repository:
git clone https://github.com/Sayyat/next-i18n-auth.git
cd next-i18n-auth
Install dependencies:
yarn install
Create a .env
file in the root directory and add the following environment variables:
AUTH_URL=http://127.0.0.1:3001
AUTH_SECRET=<Your Auth Secret>
NEXT_PUBLIC_API_URL=<Your API URL>
API_URL=<Your API URL>
NODE_ENV=development
NEXT_TELEMETRY_DISABLED=1
RAPIDAPI_KEY=<Your RapidAPI key>
Start the development server:
yarn dev
The application will be available at http://localhost:3000
.
You can find the file structure of the project in the File Structure document.
register
modal to create a new account. The backend API handles user registration and returns
access and refresh tokens.login
modal to authenticate users. Tokens are stored securely, and JWT is decoded for user
details.i18next
for localization. See i18next for more details.Kazakh
, English
, and Russian
.react-toastify
.Add the new language key in i18n/lib/config.ts
:
To add French (fr
), update the languages
array as follows:
export const languages = ["kk", "ru", "en", "fr"] as const;
Generate language files for the new locale:
Run smart-i18n
or yarn si
command to generate the template language files for the newly added language (fr
in this
case).
Translate the new language files: To translate the language files using RapidAPI, run the following command:
smart-i18n generate-translations -l fr
Or use the alias:
yarn si:trs -l fr
Thatβs it! Your new language should now be added to the system.
Note: See Automation for more details..
app
directory, e.g., app/dashboard
.page.tsx
file inside the folder.Technology | Description |
---|---|
Next.js | React framework with server-side rendering |
Next-Auth | Authentication system for Next.js apps |
i18next | Localization and translation management |
gulp | A toolkit to automate & enhance your workflow |
Tailwind CSS | Utility-first CSS framework |
shadcn/ui | Beautiful prebuilt components |
TypeScript | Static typing for scalable applications |
Zod | Type-safe schema validation |
@tanstack/react-query | Powerful data fetching library |
Vitest | Fast unit testing framework |
Playwright | End-to-end browser testing framework |
@t3-oss/env-nextjs | Type-safe environment variable management for Next.js |
React-Toastify | Toast notifications |
This project includes a robust testing setup to ensure code quality and application reliability. Below are the details for running different types of tests:
We use Vitest with React Testing Library to write and run unit and integration tests.
yarn test
yarn test:watch
yarn coverage
We use Playwright for writing end-to-end tests.
yarn test:e2e
yarn test:e2e --ui
.env.test
for test-specific setups.src/
(next to each component)src/tests/e2e/
yarn test # Runs all unit and integration tests
yarn test:e2e # Runs all E2E tests
This project is licensed under the MIT License - see the LICENSE file for details.
Made with π by Sayat Raykul
If you like this project, please βοΈ star it on GitHub! It helps me continue building great open-source tools.
@sayyyat/smart-i18n
β The core CLI engine that provides scanning, merging, and type generation.@sayyyat/smart-i18n-react
β Feature-scaffolding CLI tool that integrates smart-i18n into React/Next.js projects with zero configs.