File tree Expand file tree Collapse file tree 8 files changed +29
-14
lines changed
Expand file tree Collapse file tree 8 files changed +29
-14
lines changed Original file line number Diff line number Diff line change @@ -38,4 +38,5 @@ bun.lock*
3838yarn.lock
3939package-lock.json
4040demo.db
41- demo.db-journal
41+ demo.db-journal
42+ generated
Original file line number Diff line number Diff line change 1313 },
1414 "dependencies" : {
1515 "@elysiajs/eden" : " 1.4.5" ,
16- "@prisma/client" : " 7.0.1 " ,
16+ "@prisma/client" : " 7.1.0 " ,
1717 "@tanstack/react-query" : " 5.90.11" ,
1818 "elysia" : " 1.4.17" ,
1919 "jose" : " 6.1.3" ,
20- "next" : " 16.0.6 " ,
20+ "next" : " 16.0.7 " ,
2121 "next-ws" : " 2.1.7" ,
22- "react" : " 19.2.0 " ,
23- "react-dom" : " 19.2.0 " ,
22+ "react" : " 19.2.1 " ,
23+ "react-dom" : " 19.2.1 " ,
2424 "ws" : " 8.18.3"
2525 },
2626 "devDependencies" : {
27+ "@prisma/adapter-better-sqlite3" : " ^7.1.0" ,
2728 "@tailwindcss/postcss" : " 4.1.17" ,
29+ "@types/better-sqlite3" : " ^7.6.13" ,
2830 "@types/node" : " 24.10.1" ,
2931 "@types/react" : " 19.2.7" ,
3032 "@types/react-dom" : " 19.2.3" ,
3133 "@types/ws" : " 8.18.1" ,
34+ "dotenv" : " ^17.2.3" ,
3235 "eslint" : " 9.39.1" ,
33- "eslint-config-next" : " 16.0.6 " ,
36+ "eslint-config-next" : " 16.0.7 " ,
3437 "postcss" : " 8.5.6" ,
35- "prettier" : " 3.7.3 " ,
38+ "prettier" : " 3.7.4 " ,
3639 "prettier-plugin-tailwindcss" : " 0.7.2" ,
37- "prisma" : " 7.0.1 " ,
40+ "prisma" : " 7.1.0 " ,
3841 "tailwindcss" : " 4.1.17" ,
42+ "tsx" : " ^4.21.0" ,
3943 "typescript" : " 5.9.3"
4044 }
4145}
File renamed without changes.
Original file line number Diff line number Diff line change 11# Please do not edit this file manually
2- # It should be added in your version-control system (i.e. Git)
3- provider = " sqlite"
2+ # It should be added in your version-control system (e.g., Git)
3+ provider = " sqlite"
Original file line number Diff line number Diff line change 11generator client {
2- provider = " prisma-client-js "
2+ provider = " prisma-client "
3+ output = " ../src/lib/generated/prisma "
34}
45
56datasource db {
Original file line number Diff line number Diff line change 1+ import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3" ;
12import { PrismaClient } from "@prisma/client" ;
23
3- const prisma = new PrismaClient ( ) ;
4+ const globalForPrisma = global as unknown as { prisma : PrismaClient } ;
5+
6+ const connectionString = `${ process . env . DATABASE_URL || "file:./demo.db" } ` ;
7+
8+ const adapter = new PrismaBetterSqlite3 ( { url : connectionString } ) ;
9+
10+ const prisma = globalForPrisma . prisma || new PrismaClient ( { adapter } ) ;
11+
12+ if ( process . env . NODE_ENV !== "production" ) globalForPrisma . prisma = prisma ;
413
514export default prisma ;
Original file line number Diff line number Diff line change 11import { serverEnv } from "@/lib/env/server" ;
2- import { encrypt } from "@/lib/jwt" ;
32import prisma from "@/lib/prisma" ;
43import { authenticationSchema } from "@/lib/typebox/auth" ;
54import { Elysia , InternalServerError } from "elysia" ;
65import { ResponseCookie } from "next/dist/compiled/@edge-runtime/cookies" ;
76import { cookies } from "next/headers" ;
7+ import { encrypt } from "../../lib/jwt" ;
88
99/**
1010 * Authentication routes for user registration, login, and logout.
Original file line number Diff line number Diff line change 11import { serverEnv } from "@/lib/env/server" ;
2- import { decrypt } from "@/lib/jwt" ;
32import { User } from "@prisma/client" ;
43import { Elysia , InternalServerError } from "elysia" ;
54import { cookies } from "next/headers" ;
5+ import { decrypt } from "../../lib/jwt" ;
66
77/**
88 * User route for retrieving the current user's information.
You can’t perform that action at this time.
0 commit comments