Skip to content

A Nextjs template with all the Boring Bits you need to build an API-powered frontend.

Notifications You must be signed in to change notification settings

alazycoder101/boring-bits-nextjs

 
 

Repository files navigation

😴 Boring Bits: Nextjs Edition

A Nextjs template with all the Boring Bits™ you need to build an API-powered frontend.

It's not glamourous. It's not sexy. It's just a dependably Boring starting point for your next frontend.

Plays nicely with Boring Bits: Rails API Edition.

Highlights

Boring Login Screen

Nextjs and storybook setup

Clone the repo and install dependencies with yarn.

Run Nextjs with:

$ yarn dev

And storybook with:

$ storybook

That's it. In the app you've got a login form, a signup form, and a protected route. You'll also find storybook running with your basic UI components. The rest - as they say - is up to you.

Docker

Run Nextjs with:

$ docker-compose build

$ docker-compose up app

Post mapped from container 3000 to host 3000. Goto http://0.0.0.0:3000/ to see the page

Connect to an API

Authentication itself happens through an API (e.g. if you're in the market, check out this Rails API template. Whatever solution you use, you'll need to add the same JWT key you use on the server to your .env.local. file (see below). Note that all client-side ENV variables must be prefixed with NEXT_PUBLIC_. Please check the key in .env file

start rails api server with port 3707

docker-compose up web

next local configure

# .env.local
NEXT_PUBLIC_JWT_SECRET_KEY=some-secret
NEXT_PUBLIC_API_URL=http://0.0.0.0:3707

About

A Nextjs template with all the Boring Bits you need to build an API-powered frontend.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.1%
  • CSS 9.0%
  • Dockerfile 0.9%