- run
yarn
in root directory - make a copy of .env.local.example to
.env.local
- add the required Env Variables
- to start on local dev run:
yarn dev
There are some things you need to change including title, urls, favicons, etc.
Find all comments with !STARTERCONF, then follow the guide.
Don't forget to change the package name in package.json
This starter is using conventional commits, it is mandatory to use it to commit changes.
This starter is equipped with workspace-snippets, it is encouraged to use it, especially the np
and rc
File inside src/pages
will be the webpage route, there are 2 things that need to be added in Next.js page:
- Seo component
- Layout class to give constraint to viewport width. Read more about layout class.
Snippets: np
import * as React from 'react';
import Seo from '@/components/Seo';
export default function TestPage() {
return (
<>
<Seo templateTitle='Test' />
<main>
<section className=''>
<div className='layout'></div>
</section>
</main>
</>
);
}
To make a new component, It is encouraged to use export default function
. Because when we need to rename it, we only need to do it once.
Snippets: rc
import * as React from 'react';
export default function Component() {
return <div></div>;
}
Snippets: ir
import * as React from 'react';
Snippets: imimg
import Image from 'next/image';
Snippets: iml
import Link from 'next/link';
Snippets: us
const [state, setState] = React.useState(initialState);
Snippets: uf
React.useEffect(() => {}, []);
Snippets: ur
const [state, dispatch] = React.useReducer(someReducer, {});
Snippets: urf
const someRef = React.useRef();
It is really useful when we need to group code. It is also collapsible in VSCode
Snippets: reg
//#region //*============== FORM SUBMIT
//#endregion //*============== FORM SUBMIT
You should also use Better Comments extension.