- NextJS ✓
- Prettier ✓
- SCSS ✓
- Folder and pages structure ✓
- Layout page wrapper ✓
- Components collection ...
- RTK
- Slices
- Types
- Crud endpoint operations
- http-client
- env-files
- services, req/res typing
- filtering
- gzip
- Tests
- bundle analyzing
- Express, desktop-app
- Auth + private route
- User token saving
- alert-provider
- formik + yup
- Test-stages, deploy-scripts
- Utils and hooks
- Frontend lib: React 18v
- Builder: NextJs 13v
- Typing: TypeScript
- State-managment: Redux-toolkit
- Styles: SCSS with modules
- http-client: axios
- Form-validation: Formik with yup
- Linters: ESLint
- Code formatter: Prettier
- Test stages: Github pages and Netlify
- RTK deepening
- RTK-query
- NextJS new 18v features
- Promises, async actions
# inside current folder
npx create-next-app@latest .
# inside specify folder
npx create-next-app@latest folder-name
# ask for the questions
? Would you like to use TypeScript? No / Yes*
? Would you like to use ESLint? No / Yes*
? Would you like to use TailWindCss? No* / Yes
? Would you like to use src/ directory? No / Yes*
? Would you like to use App Router (recommended)? No* / Yes
? Would you like to customize the default import alias? No* / Yes
GitHub pages link: https://evgenyleukhin.github.io/frontend-starter
- GitHub repo --> Settings --> Pages --> Build and deployment --> GitHub Actions --> Choose NextJS --> auto-create
nextjs.yml
file in.github/workflows
- Each commit will be start auto-deploy by GitHub actions
- Check nodes version in nextjs.yml
node-version: '20'
- Check deploys - VS Code plugin GitHub Actions
- Not needed package
gh-pages
anymore
TODO
yarn add prettier
Sometimes has error with starting by yarn.
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write ."
{
"endOfLine": "auto",
"singleQuote": true,
"jsxSingleQuote": true,
"arrowParens": "avoid",
"semi": true,
"useTabs": false,
"trailingComma": "all",
"tabWidth": 2
}
# Ignore artifacts:
node_modules
public
build
.next
.swc
yarn.lock
package-lock.json
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"prettier.singleQuote": true,
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svg]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"svg.preview.background": "editor"
}
import cn from 'classnames';
import styles from './Test.module.scss';
type TProps = {
userName: string;
isLoading: boolean;
};
const Test = ({ userName, isLoading }: TProps) => {
return (
<div
className={cn(styles.Test, {
[styles.Test__isLoading]: isLoading,
})}
>
Hello, {userName}!
</div>
);
};
export default Test;
.Test {
background-color: rgba(255, 255, 255, 1);
&__isLoading {
background-color: rgba(255, 255, 255, 0.9);
}
}
====================================
This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.