next-auth-boilerplate
v0.1.0
Published
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](https://github.com/vvo/next-iron-session) library for mana
Downloads
2
Readme
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
Clone this repository to your local machine:
git clone <repository_url> cd next-boilerplate
Install dependencies
npm install or yarn install
Configure environment variables
DATABASE_URL = 'YOUR_DATABASE_URL' APPLICATION_SECRET='YOUR_APPLICATION_SECRET' NODE_ENV='NODE_ENV'
Start development server
npm run dev or yarn dev
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: