Thirosue / next-shadcn-sample

https://next-shadcn-sample-mu.vercel.app
MIT License
3 stars 1 forks source link
Next.js 14 Admin Dashboard Starter Template With Shadcn-ui
Built with the Next.js App Router and Server Actions


View Demo

require

Overview

This is a starter template using the following stack:

Pages

Pages Specifications
Signup Authentication with NextAuth supports Social logins and email logins(Enter dummy email for demo).
Dashboard Cards with recharts graphs for analytics.
Users Tanstack tables with user details client side searching, pagination etc
Users/new A User Form.
Not Found Not Found Page Added in the root level
- -

Getting Started

Follow these steps to clone the repository and start the development server:

Clone

gh repo clone Thirosue/next-shadcn-sample

dependencies installation

npm i

Setting up with vercel postgres (If you use docker, skip)

Setting up the environment

vercel env pull .env.development.local
cp .env.development.local .env
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXTAUTH_URL="http://localhost:3000"
head -n 6 .env
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXTAUTH_URL="http://localhost:3000"

# Created by Vercel CLI
NEXTAUTH_SECRET="••••••••••••••••••••••••••••••••••="
NX_DAEMON=""

Setting up with docker-compose (If you use vercel postgres, skip)

Setting up the environment

cp .env.example .env
Add the required environment variables to the .env file.
# generate a secret for the next-auth
openssl rand -base64 32
kk5DQe1JJKk6PIYoP06Ho4d0F9M6X0lcus7N5aYzG+Q= # Example secret
# paste the secret in the .env file
NEXTAUTH_SECRET={secret created above}

Running the database

docker-compose up -d

Running the migrations

npm run db:push
npm run db:push

> next-shadcn-sample@0.1.0 db:push
> dotenv drizzle-kit push:pg

drizzle-kit: v0.20.14
drizzle-orm: v0.30.4

No config path provided, using default path
Reading config file '/Users/hirosue/private/workspace/next-shadcn-sample/drizzle.config.ts'
[✓] Changes applied
npm run db:seed
npm run db:seed

> next-shadcn-sample@0.1.0 db:seed
> dotenv tsx src/db/seed.ts

⏳ Running seed...
📝 Inserting 30 users
📝 Inserting 4 categories
📝 Inserting 24 subcategories
📝 Inserting 100 products
✅ Seed completed in 149ms

Running the development server

You should now be able to access the application at http://localhost:3000.