- Notifications
You must be signed in to change notification settings - Fork2
Next.js learn but using Postgres.js instead of @vercel/postgres
License
masfahru/nextjs-dashboard-example-with-authentication
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a modified result after followingNext.js learning course
Tech-stack:
- Nodejs v20
- Package Manager (npm, yarn, or bun)
- PostgreSQL server (if you want to use local database server)
- Clone this project to local
- Install dependencies:
npm i
- Copy .env.example to .env
- Modify .env as per the requirement
- Run database seed (just for once):
npm run seed
- run
npm run dev
- run
npm run build
- run
npm run start
after successful build.
There are some differences between the original result of the course and this repository, which are:
UsingPostgres.js
instead of@vercel/postgres
, both of them have a similiar syntax.
for example:
const[result]=sql``;
Implement a simple session manager, so we can force log-out other sessions by deleting their session id from the database.
Credentials:
{"email":"user@nextmail.com","password":"123456"}
- Signin
http://localhost:3000/login
- Dashboard
http://localhost:3000/dashboard
payload:
{"email":"user@nextmail.com","password":"123456","callbackUrl":"/api/auth/session"}
callbackUrl can be changed to any pathname to redirect after successful sign-in
payload:
{"callbackUrl":"/api/auth/providers"}
callbackUrl can be changed to any pathname to redirect after successful sign-out
About
Next.js learn but using Postgres.js instead of @vercel/postgres
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.