Skip to content

inputlogic/next-starter

Repository files navigation

This is a Next.js project bootstrapped with create-next-app and modified with some useful utilities, components, and settings that we (Input Logic) often need.

Local development

Start by creating a .env.local file in the project root. You can use the 1Password Generator to create a random session secret easily.

NEXT_PUBLIC_ENV=dev
API_URL=http://localhost:8000 or http://localhost:8000/api depending on your setup
SESSION_SECRET=[RANDOM-32-CHARACTER-STRING]

Now install and run the project:

npm install
npm run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

DEMOS

Connect to the API

Now that your frontend is running, you'll need an API. For a local development API, setup the Ninja Starter.

If you'd like to skip this step, simply update your .env.local file to point to our staging API on Heroku:

API_URL=https://ninja-starter-9ee94834650e.herokuapp.com

Learn More

To learn more, take a look at the following resources:

Storybook

Next Starter supports Storybook, a component documentation tool. Adding stories for components is entirely optional, but it is encouraged for any components that are reused in many locations.

run storybook:

npm run storybook

see https://storybook.js.org/ for more info.