A complete, production-grade Next.js starter with internationalization, authentication, UI components, testing and more. Production-ready Next.js boilerplate for authentication, i18n, theming and testing.
This project is live and deployed on Vercel!
Visit the live demo: Next Intl Auth Boilerplate Live
Make sure you have the following installed:
Clone the repository:
git clone https://github.com/Sayyat/next-intl-auth.git
cd next-intl-auth
Install dependencies:
yarn install
Create a .env
file in the root directory and add the following environment variables:
API_URL=<Your API URL>
AUTH_SECRET=<Your Auth Secret>
NEXTAUTH_URL=http://localhost:3000
API_URL=http://127.0.0.1:8000
Start the development server:
yarn dev
The application will be available at http://localhost:3000
.
src/
โโโ app/
โ โโโ (ui)/
โ โ โโโ group-1/
โ โ โ โโโ about
โ โ โ โ โโโ page.tsx
โ โ โ โโโ profile
โ โ โ โโโ page.tsx
โ โ โโโ group-2/
โ โ โ โโโ analytics
โ โ โ โ โโโ page.tsx
โ โ โ โโโ dashboard
โ โ โ โโโ page.tsx
โ โ โโโ settings
โ โ โ โโโ page.tsx
โ โ โโโ layout.tsx
โ โ โโโ page.tsx
โ โโโ api/
โ โ โโโ auth/
โ โ โ โโโ [...nextauth]/
โ โ โ โโโ route.ts
โ โ โโโ proxy/
โ โ โโโ [...pathname]/
โ โ โโโ route.ts
โ โโโ layout.tsx
โโโ core/
โ โโโ components/
โ โ โโโ AppSidebar.tsx
โ โ โโโ DynamicBreadcrumb.tsx
โ โ โโโ Footer.tsx
โ โ โโโ Header.test.tsx
โ โ โโโ Header.tsx
โ โ โโโ RenderSidebarGroup.tsx
โ โโโ config/
โ โ โโโ routes.ts
โ โโโ hooks/
โ โ โโโ useDynamicBreadcrumb.ts
โ โโโ providers/
โ โ โโโ ClientProvidersWrapper.tsx
โ โ โโโ ThemeProvider.tsx
โ โโโ styles/
โ โ โโโ globals.css
โ โโโ types/
โ โโโ header.d.ts
โ โโโ routes.d.ts
โโโ features/
โ โโโ authentication/
โ โ โโโ components/
โ โ โ โโโ EmailSentDialog.tsx
โ โ โ โโโ LoginDialog.tsx
โ โ โ โโโ ProfileDialog.tsx
โ โ โ โโโ ProfileImageIcon.tsx
โ โ โ โโโ RegisterDialog.tsx
โ โ โ โโโ ResetDialog.tsx
โ โ โโโ hooks/
โ โ โ โโโ useAuth.ts
โ โ โ โโโ useCities.ts
โ โ โ โโโ useProfile.ts
โ โ โโโ lib/
โ โ โโโ queryKeys.ts
โ โ โโโ zod.ts
โ โโโ services/
โ โ โโโ client.ts
โ โ โโโ server.ts
โ โโโ types/
โ โ โโโ city.d.ts
โ โ โโโ payload.d.ts
โ โ โโโ profile.d.ts
โ โ โโโ response.d.ts
โ โโโ index.ts
โโโ locales/
โ โโโ config/
โ โ โโโ locales.ts
โ โ โโโ request.ts
โ โ โโโ server.ts
โ โ โโโ translation.ts
โ โ โโโ translation-types.d.ts
โ โโโ messages/
โ โโโ en.json
โ โโโ kk.json
โ โโโ ru.json
โโโ shared/
โ โโโ components/
โ โ โโโ svg/
โ โ โ โโโ Loading.tsx
โ โ โโโ ui/ - shadcn ui components
โ โ โ โโโ accordion.tsx
โ โ โ โโโ ...............
โ โ โ โโโ tooltip.tsx
โ โ โโโ app-sidebar.tsx
โ โ โโโ Checkbox.tsx
โ โ โโโ FloatingLabelInput.tsx
โ โ โโโ FloatingLabelPasswordInput.tsx
โ โ โโโ FloatingLabelPhoneInput.tsx
โ โ โโโ Input.tsx
โ โ โโโ LanguageSelect.tsx
โ โ โโโ nav-main.tsx
โ โ โโโ nav-projects.tsx
โ โ โโโ nav-secondary.tsx
โ โ โโโ nav-user.tsx
โ โ โโโ Select.tsx
โ โ โโโ ThemeSelect.tsx
โ โโโ data/
โ โ โโโ env/
โ โ โโโ client.ts
โ โ โโโ server.ts
โ โโโ hooks/ shadcn hooks + custom shared hooks
โ โ โโโ use-mobile.ts
โ โ โโโ use-toast.ts
โ โโโ lib/
โ โ โโโ case.ts
โ โ โโโ constants.ts
โ โ โโโ query.ts
โ โ โโโ tokenService.ts
โ โ โโโ utils.ts
โ โโโ services/
โ โ โโโ api.ts
โ โ โโโ client.ts
โ โ โโโ server.ts
โ โโโ types/
โ โโโ api.d.ts
โ โโโ next-auth.d.ts
โ โโโ next-intl.d.ts
โโโ tests/
โ โโโ e2e/ - all e2e tests folder
โ โโโ setup.ts
โโโ auth.ts
โโโ middleware.ts
/register
page to create a new account. The backend API handles user registration and returns
access and refresh tokens./login
to authenticate users. Tokens are stored securely, and JWT is decoded for user details.next-intl
for localization.Kazakh
, English
, and Russian
.react-toastify
.Create a new JSON file in the locales/messages/
directory, e.g., fr.json
for French.
Add translations for the keys in the JSON file.
Update the locales
array in locales/config/locales.ts
:
export const locales = ['en', 'ru', 'kk', 'fr'];
The language will automatically be added to the selector.
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 |
Next-Intl | Localization and translation management |
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 | Type-safe environment variable management for Next.js |
@t3-oss/env-nextjs | End-to-end browser testing framework |
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 GNU General Public License v3.0.
See the LICENSE file for details.
This project is licensed under the terms of the GNU GPL v3.
Made with ๐ by Sayat Raykul (ZIZ INC)
If you like this project, please โญ๏ธ star it on GitHub!
It helps me continue building great open-source tools.