This project is designed to help you quickly set up a Next.js application. This starter is built with flexibility in mind, allowing you to choose how you want to deploy your Next.js application:
-
next export: You can easily export your application as static HTML and assets using Next.js's
next export
feature. This makes it suitable for hosting on platforms like GitHub Pages, Netlify, your own server, or any other static hosting provider. -
Vercel or other hosting providers: If you prefer serverless deployments, this starter seamlessly integrates with Vercel's serverless functions, providing a powerful hosting solution.
- Clone the repository.
- Install dependencies:
npm i
- Run your develop environment:
npm run dev
localhost:3000/
In this starter, we follow a naming convention for pages that aligns with DDD (Domain-driven design) principles. Each page file is named using the format page-name.page.tsx
, where page-name
represents the name of the page or route. For example, the main page of your application could be named index.page.tsx
.
Using this naming convention helps maintain a clean and organized folder structure that reflects the structure of your application's domains or features. By separating pages into their respective folders and adopting a consistent naming convention, you can easily locate and manage your application's routes.
In this project, we have integrated i18next to make it easy for you to create multi-language websites. Here's how we use i18next:
-
Translation Files: We maintain separate JSON translation files for each supported language. These files contain translation keys and their corresponding localized text. For example, you might find the English translation file for home page at
public/locales/en/homePage.json
-
Locale Configuration: We configure i18next to load the appropriate translation files based on the user's selected locale.
-
Integration with React: We use the
react-i18next
package to integrate i18next with React components, making it seamless to access translations in your React components.