- Install NodeJS. Check
.nvmrc
for the version used by this project. - Run
npm install
in the project root to install the necessary dependencies. - If using VSCode, install the reccomended extensions.
- Run
npm run dev
to start NextJS dev server. - Browse to
http://localhost:3000
to view the site.
Note
Learn more about NextJS App Router here.
- Go to
src/app
and create a new directory for the page.- For example, if you want to create a page at
scstem.org/hello-world
, you'd create a folder namedhello-world
in thesrc/app
directory.
- For example, if you want to create a page at
- Add
page.tsx
to your new directory with the following code (suggested: ReplacePageName
with the name of your page):- Note: Anything returned from your page's default function is wrapped by
src/app/layout.tsx
. That file adds things like the navigation bar, footer, etc.
- Note: Anything returned from your page's default function is wrapped by
export const metadata: Metadata = {
title: "My New Page",
description:
"This is my new page",
// ... other metadata fields
};
export default function PageName(): JSX.Element {
return <div>Hello World!</div>;
}