Skip to content

olivewind/next-starter

Repository files navigation

Next.js Starter

Out-of-the-box project template for Next.js

Features

  • Latest version of dependencies
    • Node ^16.x
    • Yarn ^1.22.x
    • React ^18.x
    • Next.js ^12.x
  • Sending Http Request with axios
  • Write stylesheet with less
  • Build UI with Arco Design, you can replace with other UI libraries(Antd、Material...) in minutes
  • Sign and encrypt cookies with iron-session, you can integration your backend api using JWT
  • Proxy all backend api with next-http-proxy-middleware
  • Logging with winston, rotating file each day
  • Deploy with docker and pm2
  • Very simple, no complex dependencies

Development

Step 1. Clone source code and install dependencies

git clone git@github.com:olivewind/next-starter.git
cd next-starter
yarn

Step 2. Set environment variables

# env.local
LOG_FILE_PERSISTENCE=1
SESSION_PASSWORD=password-must-be-at-least-32-characters-long
COOKIE_NAME=NEXT_STARTER
BACKEND_API_URL=http://localhost:3001

Step 3. Start Development Server

yarn dev

Deployment

docker build -t next-starter:tag -f Dockerfile .
docker run -p 3000:3000 next-starter:tag

or you can use Vercel to deploy your app in seconds.