https://github.com/alextraveylan/template_nextjs_14
nextjs typescript nextauth prisma
https://github.com/alextraveylan/template_nextjs_14
Last synced: 3 months ago
JSON representation
nextjs typescript nextauth prisma
- Host: GitHub
- URL: https://github.com/alextraveylan/template_nextjs_14
- Owner: AlexTraveylan
- License: mit
- Created: 2023-11-06T21:44:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-09T00:08:19.000Z (over 1 year ago)
- Last Synced: 2025-01-13T10:50:57.963Z (5 months ago)
- Language: TypeScript
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Template next.js
This project is a template for a Next.js application. It includes several features to help you get started with your Next.js project with nextauth and prisma.
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Installation](#installation)
- [Prisma Installation](#prisma-installation)
- [Special Thanks](#special-thanks)
- [License](#license)
- [Pull Requests](#pull-requests)## Features
- **Examples**: This template includes several examples to help you get started.
- **NextAuth**: Integrated with NextAuth for authentication.
- **Prisma**: Uses Prisma as an ORM for easier database management.## Installation
To install this project, follow these steps:
1. Clone the repository: `git clone `
2. Navigate to the project directory: `cd `
3. Install the dependencies: `npm install` or `yarn install`
4. Setup the environment variables:```bash
DATABASE_URL="file:./dev.db" //for sqlite
GITHUB_ID="your-github-id"
GITHUB_SECRET="your-github-secret"
NEXTAUTH_SECRET="whatever-you-want-in-development"
```- Generate NEXTAUTH_SECRET in production
- linux
```bash
openssl rand -base64 32
```- windows (use powershell)
```powershell
[Byte[]]$randomBytes = New-Object Byte[] 24
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($randomBytes)
[System.Convert]::ToBase64String($randomBytes)
```5. Start the development server: `npm run dev` or `yarn dev`
Please replace `` and `` with your actual repository URL and directory name respectively.
## Prisma Installation
To install Prisma in your project, follow these steps:
1. Install the Prisma CLI package globally on your machine with the following command:
```bash
npm install prisma -g
```2. Navigate to your project directory and initialize Prisma:
```bash
cd
npx prisma init --datasource-provider sqlite
```3. This will create a prisma/schema.prisma file. Modify this file to define your database model.
4. Then, you can generate the Prisma client with the following command:
```bash
npx prisma generate
```5. Now, you can use Prisma Client in your code to interact with your database.
Please replace with your actual project directory name.
## Special Thanks
[Melvynx](https://www.youtube.com/watch?v=LaMoteg626I)
## License
This project is licensed under the MIT license. Please read the [LICENSE](LICENSE) file for more details.
## Pull Requests
I welcome and encourage all pull requests.