This is a Next 13 project bootstrapped with create-next-app
This is a project to learn Next.js as fullstack framework.
The goal is to create a clone of myspace.com.
And to learn how to use Next.js with serverless database and without back-end framework.
- Fully serverless with Neon database.
- Authentication with NextAuth.js.
- Database with Prisma.
- Deployed on Vercel.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm devOpen 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.
go to : https://neon.tech/ create new project create new database with the name you want. create new database with the name 'shadow'. add the database url to the .env file.
npx prisma init // create the prisma folder allow migration to the database at the file : prisma/schema.prisma add shadow database to the file : prisma/schema.prisma npx prisma migrate dev // create the migration
/lib/prisma.ts // create the prisma client export const prisma = new PrismaClient() that allow to use prisma in the app like : prisma.user.findMany()
npm i @next-auth/prisma-adapter add adapter to the file : pages/api/auth/[...nextauth].ts add the secret to the .env file add the database url and the shadow url to the .env file