data access

This commit is contained in:
Timur Ercan
2023-01-05 18:46:11 +01:00
parent c76f676ac8
commit 5c8a3a47b1
6 changed files with 830 additions and 398 deletions

View File

@ -1,15 +0,0 @@
# Database
# LIVE
DATABASE_URL="postgres://documenso_live:nsdzt5hrSIJXpqsGufa1kxvrNKbEC7pd@dpg-cdpbkkta499b1lmtodig-a.oregon-postgres.render.com/documenso_live"
# Host
NEXT_PUBLIC_WEBAPP_URL='http://localhost:3000'
# Email
EMAIL_FROM='notifications@yourselfhostedcal.com'
EMAIL_SERVER_HOST='smtp.office365.com'
EMAIL_SERVER_PORT=587
EMAIL_SERVER_USER=''
EMAIL_SERVER_PASSWORD=''
# API Keys

1
apps/web/.gitignore vendored
View File

@ -27,6 +27,7 @@ yarn-error.log*
# local env files # local env files
.env*.local .env*.local
.env
# vercel # vercel
.vercel .vercel

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.4.13", "autoprefixer": "^10.4.13",
"postcss": "^8.4.19", "postcss": "^8.4.19",
"prisma": "^4.6.1", "prisma": "^4.8.0",
"tailwindcss": "^3.2.4" "tailwindcss": "^3.2.4"
} }
} }

View File

@ -0,0 +1,22 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { PrismaClient } from "@prisma/client";
type Data = {
status: string;
};
export default async function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
const prisma = new PrismaClient();
const user = await prisma.user.create({
data: {
email: "m@ouse.de",
name: "Mickey Mouse",
},
});
res.status(200).json({ status: "User created" });
}

View File

@ -0,0 +1,14 @@
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
name String? @db.VarChar(255)
email String @unique @db.VarChar(255)
}