This is a is inspired by project propmtopia created by adrianhajdin His YouTube Channel JavaScript Mastery.
I created this project using NextJs with TypeScript. And instedad of using mongoose for database connection I used Prisma(ORM) just for practicing and learning Prisma.
This is a Next.js project bootstrapped with create-next-app
.
Visit Website
-
Install all the dependencies
npm i
-
Add Eviroment Variables
NEXTAUTH_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# This was inserted by `prisma init`:
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
DATABASE_URL=
NEXTAUTH_URL=
- for NextAuth Secret add a random generated string
- For
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
you have to create an application on google console and get ID and SECRET - In
DATABASE_URL
add your database connection string - In NEXTAUTH_URL add your applications url
- Initialize prisma
npx prisma init
- Generate the schema mentioned in the schema file
npx prisma generate
- Now run the development server
npm run dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.