0.1.0 • Published 6 months ago

next-auth-boilerplate v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Next.js Authentication Boilerplate

This is a boilerplate codebase for building web applications with Next.js that includes user authentication, SCSS for styling, and a structured API route setup. It utilizes the next-iron-session library for managing user sessions.

Features

  • User authentication (login, signup, logout) using Next.js API routes.
  • SCSS integration for styling your application.
  • Organized API routes for handling server-side logic.

Getting Started

Prerequisites

Before you begin, make sure you have the following software installed on your machine:

Installation

  1. Clone this repository to your local machine:

    git clone <repository_url>
    cd next-boilerplate
  2. Install dependencies

    npm install
    or
    yarn install
  3. Configure environment variables

    DATABASE_URL = 'YOUR_DATABASE_URL'
    APPLICATION_SECRET='YOUR_APPLICATION_SECRET'
    NODE_ENV='NODE_ENV'
  4. Start development server

    npm run dev
    or
    yarn dev
  5. Your application should now be running at http://localhost:3000.

Note: The DATABASE_URL environment variable should be a connection string to your database, Also you need to update the provider in schema.prisma file according to your database provider.

Usage

  • Authentication Routes: The pages/api/auth folder contains authentication API routes (login.js, signup.js, logout.js) for you to implement your authentication logic.

  • Styles: Add stylesheets in SCSS format to the styles folder and import them in your components.

  • Customization: Customize the pages in the pages directory according to your application requirements.

Deploying

To deploy your Next.js application, follow the deployment instructions for your chosen hosting platform. Popular options include:

Additional Resources