Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
feat: setup foundation for database and api
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-sanare committed Nov 12, 2022
1 parent 1536a49 commit a8275c0
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@
"[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
}
75 changes: 75 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
"dependencies": {
"@emotion/react": "^11.10.5",
"@reduxjs/toolkit": "^1.9.0",
"@prisma/client": "^4.4.0",
"classnames": "^2.3.2",
"mobile-detect": "^1.4.5",
"next": "^13.0.3",
"next-auth": "^4.16.4",
"prisma": "^4.4.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-icons": "^4.6.0",
Expand Down
11 changes: 11 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

generator client {
provider = "prisma-client-js"
}
2 changes: 1 addition & 1 deletion src/pages/api/restricted.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { unstable_getServerSession } from 'next-auth/next'
import { unstable_getServerSession } from 'next-auth/next';
import { authOptions } from './auth/[...nextauth]';

export default async (req, res) => {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/prisma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PrismaClient } from '@prisma/client';

export const prisma = new PrismaClient();

export type {User} from '@prisma/client';

0 comments on commit a8275c0

Please sign in to comment.