/nextjs-express-auth0-template

A fullstack Node.js template that integrates a Next.js frontend with a stand alone Express.js Server and Auth0 authentication. This template is accompanied by blog post with details on how to build this template application.

Primary LanguageTypeScriptMIT LicenseMIT

Template: Next.js + Express.js + Auth0 + TypeScript + Tailwind

Demo GIF

This repository provides a full-stack Node.js boilerplate for building web applications using a tech stack that includes Next.js, Express.js, Auth0, TypeScript, and Tailwind CSS.

This template is a companion to a detailed blog post that explains how to integrate Next.js with Express.js and Auth0 for authentication. Read the full guide here.

Features

  • Next.js: For server-side rendered React applications.
  • Express.js: Backend server handling API requests and other server-side logic.
  • Auth0: Secure and scalable authentication and authorization.
  • TypeScript: Static typing for JavaScript, enhancing development experience and maintainability.
  • Tailwind CSS: Utility-first CSS framework for rapid UI development.

Getting Started

  1. Clone the Repository

    git clone git@github.com:benjamin-chavez/nextjs-express-auth0-template.git
  2. Install Dependencies

    pnpm install
  3. Setup Auth0

    • Create an account on Auth0.
    • In Auth0, set up a Next.js Application and an Express API.
    • Update the .env files with your Auth0 credentials.
  4. Run the Development Server

    pnpm run dev

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

Deployment

  • Build the application for production:

    pnpm run build
  • Start the production server:

    pnpm start

License

This project is licensed under the MIT License. See LICENSE for details.