Next.js Version: 15.2.1
Some backend and frontend features of Next.js and this template are listed below.
This project is developed with TypeScript.
This page is rendered at the server side. You can see all the content in the first response.
Both SASS and SCSS are supported.
Sub-path routing is used for i18n. A redirection will be given to every page request with an URL without locale.
The below message is displayed with translation:
Redux is NOT included in this project. Instead, React hooks are used. Below is an example:
Accumulator: 0
Change Count: 0
You can see the debug logging in the console if the server is not run with NODE_ENV=production
. Please note that the reducer will be called twice for each action in non-production mode.
Object-Validator is used for form validation.
Here is a sample form with 2-side input validation.
Material UI is included as a UI component library.
If you do not need Material UI, you can make the changes below.
src/app/(pages)/[lang]/layout.tsx
, remove the AppRouterCacheProvider
, ThemeProvider
and CssBaseline
components. Also, unset the className
attribute of the body
elements.src/lib/fonts.ts
.src/lib/theme.ts
.@mui/
.yaml-loader is used to parse YAML files. If you do not use YAML, you can make the changes below.
next.config.ts
.src/yaml.d.ts
.yaml-loader
.The compilers, libraries and frameworks used are mentioned above. Here it is a summary.
All the default directories from Next.js are kept. The /src
directory and split project files by feature or route approaches with App Router are used. Extra directories are listed below:
Contains common React components for using in different pages.
A route group for all pages. Other route groups (e.g. (api)
) can be added under src/app
.
Contains translated text of different locales. Please see Internationalization.
Contains custom code for global use.
Contains global state management related code with Redux design pattern. You may customize state, actions and reducers respectively in index.ts, action and reducer.ts. Please note that it is not Redux.
These coding styles and naming conventions are recommended in the projects, but you are free to ignore some or all of them for your convenience. However, you should keep the coding styles and naming conventions consistent in the whole project.
SampleForm.tsx
.sample-form-handler.ts
.{
at the same line of classes or functions on declaration, and add 1 space in front of them. e.g.class A {
instead of class A{
orclass A
{
.(
in the condition expression of flow controls. e.g. use if (a === b)
instead of if(a === b)
.:
and ,
if there are no line breaks or spaces at that place.You should know the coding conventions of JavaScript and TypeScript before considering these rules. Also, please use TypeScript instead of JavaScript as much as possible to take the advantages of compile-time type checking.
=
, +=
, -=
etc.) and =>
if there are no line breaks or spaces at that place.property-value
syntax for utility classes. e.g. px-2
for the style padding x = 2 units.size:property-value
syntax for responsive layouts. e.g. md:px-2
.Subject-variant
syntax for element classes. e.g. List-dark
contains properties of a list with dark theme, and List-light
contains that with light theme. Common properties are included in List
. Then the element may look like <div class="List List-dark"></div>
.Text-highlight
instead of Text-background-yellow
, except it always has and only has the yellow background property.Parent-Child
syntax for element classes. e.g. Nav-Item
.NestedList-Item-light
, text-bluishGreen
.@function text-stroke()
.styles["class"]
instead of styles.class
. If the class name contains -
, only the bracket notation is available. So, always use the bracket notation for consistency.join()
to handle elements with multiple classes. e.g. use className={["global-class-1 global-class-2", styles["module-class-1"], styles["module-class-2"]].join(" ")}
instead of className={"global-class-1 global-class-2 " + styles["module-class-1"] + " " + styles["module-class-2"]}
.Copyright © 2025 Quicksilver0218.
Licensed under the MIT License.