- Node@16+
- npm@8+
- next@13+
- react@18+
-
Install dependencies:
npm i
-
Create DB tables with Prisma (NOTE: Run this command whenever you make changes to
schema.prisma
file)npx prisma db push
-
Open Prisma studio
npx prisma studio
-
Generate
NEXTAUTH_SECRET
in.env
fileopenssl rand -base64 32
-
Create a Github OAuth app: here
GITHUB_ACCOUNT_ID= GITHUB_ID= GITHUB_SECRET= NEXTAUTH_URL=http://localhost:3000/api/auth
-
Start the dev server:
npm run dev
-
Start the dev server with Turbopack:
npm run dev:turbopack
-
See your binaries:
npx next info
-
Build Docker image
docker build -t unsplash-nextjs .
-
Deploy the image in your container and run it:
docker run --name unsplash-nextjs-container --env-file .env.local -p 0.0.0.0:3000:3000 unsplash-nextjs
Note: This app uses Tailwind CSS. However, Turbopack does not yet support fully PostCSS, but it does support CSS and CSS Modules.
Turbopack is a new incremental bundler optimized for JavaScript and TypeScript, written in Rust by the creators of Webpack and Next.js at Vercel. On large applications Turbopack updates 10x faster than Vite and 700x faster than Webpack (benchmark). For the biggest applications the difference grows even more stark with updates up to 20x faster than Vite.
As a reminder, Turbopack is currently in alpha and not yet ready for production, so that the build may not be successful for now.