-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d669d5
commit e84097e
Showing
24 changed files
with
127 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
NODE_ENV="development" | ||
NEXT_PUBLIC_SITE_URL="http://localhost:3000" | ||
|
||
# AUTH with CLERK | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
NODE_ENV="development" | ||
NEXT_PUBLIC_SITE_URL="http://localhost:3000" | ||
|
||
# AUTH with CLERK | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/components/ui/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
declare global { | ||
var prisma: PrismaClient | undefined; | ||
} | ||
|
||
export { }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Server as NetServer } from "http"; | ||
import { Socket as NetSocket } from "net"; | ||
import { Server as ServerIOServer } from "socket.io"; | ||
import { NextApiResponse as OriginalNextApiResponse } from "next"; | ||
|
||
declare module "next" { | ||
type NextApiResponseWithSocket<T = any> = OriginalNextApiResponse<T> & { | ||
socket: NetSocket & { | ||
server: NetServer & { | ||
io?: ServerIOServer; | ||
}; | ||
}; | ||
}; | ||
|
||
export type NextApiResponse<T = any> = NextApiResponseWithSocket<T> | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { NextResponse } from "next/server"; | ||
import { db } from "@/lib/db"; | ||
import { currentProfile } from "@/lib/current-profile"; | ||
|
||
export const dynamic = 'force-dynamic'; | ||
|
||
export async function GET() { | ||
try { | ||
const profile = await currentProfile(); | ||
if (!profile) { | ||
return NextResponse.json({ serverUrl: "" }); | ||
} | ||
const server = await db.server.findFirst({ | ||
where: { | ||
members: { | ||
some: { | ||
profileId: profile.id | ||
} | ||
} | ||
} | ||
}); | ||
const serverUrl = server ? `/servers/${server.id}` : ""; | ||
return NextResponse.json({ serverUrl }); | ||
} catch (error) { | ||
console.error("[SERVER_URL_GET]", error); | ||
return NextResponse.json({ serverUrl: "" }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,10 @@ | ||
import { db } from '@/lib/db'; | ||
import { currentProfile } from '@/lib/current-profile'; | ||
import HomeClient from './client-page'; | ||
import dynamic from 'next/dynamic'; | ||
|
||
export default async function Home() { | ||
const profile = await currentProfile(); | ||
if (!profile) return null; | ||
const server = await db.server.findFirst({ | ||
where: { | ||
members: { | ||
some: { | ||
profileId: profile.id | ||
} | ||
} | ||
} | ||
}); | ||
let serverUrl = ""; | ||
if (server) { | ||
serverUrl = `/servers/${server.id}`; | ||
} | ||
const DynamicHomeClient = dynamic(() => import('./client-page'), { | ||
ssr: false, | ||
loading: () => <div>Loading...</div> | ||
}); | ||
|
||
return <HomeClient serverUrl={serverUrl} />; | ||
export default function Home() { | ||
return <DynamicHomeClient />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.