gaurv007 commited on
Commit
610b888
·
verified ·
1 Parent(s): 134d94f

Fix Next.js 16: restore @tailwindcss/postcss, middleware→proxy.ts, serverExternalPackages top-level, add .gitignore

Browse files
.gitignore ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+
6
+ # next.js
7
+ .next/
8
+ out/
9
+
10
+ # build
11
+ dist/
12
+ build/
13
+
14
+ # env files
15
+ .env
16
+ .env.local
17
+ .env.development.local
18
+ .env.test.local
19
+ .env.production.local
20
+
21
+ # debug
22
+ npm-debug.log*
23
+ yarn-debug.log*
24
+ yarn-error.log*
25
+
26
+ # misc
27
+ .DS_Store
28
+ *.pem
29
+ Thumbs.db
30
+
31
+ # IDE
32
+ .vscode/
33
+ .idea/
34
+ *.swp
35
+ *.swo
36
+
37
+ # typescript
38
+ *.tsbuildinfo
39
+ next-env.d.ts
40
+
41
+ # python
42
+ __pycache__/
43
+ *.pyc
44
+ *.pyo
45
+ .venv/
46
+ venv/
47
+ *.egg-info/
48
+
49
+ # model files (too large for git)
50
+ *.safetensors
51
+ *.bin
52
+ *.onnx
53
+ *.pt
54
+ *.pth
55
+ clauseguard-model/
web/.gitignore ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+
6
+ # next.js
7
+ .next/
8
+ out/
9
+
10
+ # build
11
+ dist/
12
+ build/
13
+
14
+ # env files
15
+ .env
16
+ .env.local
17
+ .env.development.local
18
+ .env.test.local
19
+ .env.production.local
20
+
21
+ # debug
22
+ npm-debug.log*
23
+ yarn-debug.log*
24
+ yarn-error.log*
25
+
26
+ # misc
27
+ .DS_Store
28
+ *.pem
29
+ Thumbs.db
30
+
31
+ # IDE
32
+ .vscode/
33
+ .idea/
34
+ *.swp
35
+ *.swo
36
+
37
+ # typescript
38
+ *.tsbuildinfo
39
+ next-env.d.ts
40
+
41
+ # python
42
+ __pycache__/
43
+ *.pyc
44
+ *.pyo
45
+ .venv/
46
+ venv/
47
+ *.egg-info/
48
+
49
+ # model files (too large for git)
50
+ *.safetensors
51
+ *.bin
52
+ *.onnx
53
+ *.pt
54
+ *.pth
55
+ clauseguard-model/
web/app/globals.css CHANGED
@@ -1,8 +1 @@
1
  @import "tailwindcss";
2
-
3
- @layer base {
4
- body {
5
- -webkit-font-smoothing: antialiased;
6
- -moz-osx-font-smoothing: grayscale;
7
- }
8
- }
 
1
  @import "tailwindcss";
 
 
 
 
 
 
 
web/next.config.ts CHANGED
@@ -2,16 +2,13 @@ import type { NextConfig } from "next";
2
 
3
  const nextConfig: NextConfig = {
4
  output: "standalone",
 
5
  images: {
6
  remotePatterns: [
7
  { protocol: "https", hostname: "avatars.githubusercontent.com" },
8
  { protocol: "https", hostname: "lh3.googleusercontent.com" },
9
  ],
10
  },
11
- experimental: {
12
- serverActions: { bodySizeLimit: "2mb" },
13
- serverComponentsExternalPackages: ["@react-pdf/renderer"],
14
- },
15
  };
16
 
17
  export default nextConfig;
 
2
 
3
  const nextConfig: NextConfig = {
4
  output: "standalone",
5
+ serverExternalPackages: ["@react-pdf/renderer"],
6
  images: {
7
  remotePatterns: [
8
  { protocol: "https", hostname: "avatars.githubusercontent.com" },
9
  { protocol: "https", hostname: "lh3.googleusercontent.com" },
10
  ],
11
  },
 
 
 
 
12
  };
13
 
14
  export default nextConfig;
web/postcss.config.mjs CHANGED
@@ -1,6 +1,5 @@
1
- /** @type {import('postcss-load-config').Config} */
2
- const config = {
3
- plugins: {},
 
4
  };
5
-
6
- export default config;
 
1
+ export default {
2
+ plugins: {
3
+ "@tailwindcss/postcss": {},
4
+ },
5
  };
 
 
web/{middleware.ts → proxy.ts} RENAMED
@@ -1,12 +1,17 @@
1
  import { createServerClient } from "@supabase/ssr";
2
  import { NextResponse, type NextRequest } from "next/server";
3
 
4
- export async function middleware(request: NextRequest) {
5
  let supabaseResponse = NextResponse.next({ request });
6
 
 
 
 
 
 
7
  const supabase = createServerClient(
8
- process.env.NEXT_PUBLIC_SUPABASE_URL!,
9
- process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY!,
10
  {
11
  cookies: {
12
  getAll() {
@@ -23,23 +28,8 @@ export async function middleware(request: NextRequest) {
23
  }
24
  );
25
 
26
- const { data } = await supabase.auth.getClaims();
27
- const user = data?.claims;
28
-
29
- // Protect dashboard
30
- if (request.nextUrl.pathname.startsWith("/dashboard-pages") && !user) {
31
- const url = request.nextUrl.clone();
32
- url.pathname = "/auth/login";
33
- url.searchParams.set("next", request.nextUrl.pathname);
34
- return NextResponse.redirect(url);
35
- }
36
-
37
- // Redirect logged-in away from auth pages (except callback)
38
- if (request.nextUrl.pathname.startsWith("/auth/") && user) {
39
- if (!request.nextUrl.pathname.includes("callback")) {
40
- return NextResponse.redirect(new URL("/dashboard-pages/dashboard", request.url));
41
- }
42
- }
43
 
44
  return supabaseResponse;
45
  }
 
1
  import { createServerClient } from "@supabase/ssr";
2
  import { NextResponse, type NextRequest } from "next/server";
3
 
4
+ export function proxy(request: NextRequest) {
5
  let supabaseResponse = NextResponse.next({ request });
6
 
7
+ // Skip Supabase auth if env vars not set (local dev without Supabase)
8
+ if (!process.env.NEXT_PUBLIC_SUPABASE_URL || !process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY) {
9
+ return supabaseResponse;
10
+ }
11
+
12
  const supabase = createServerClient(
13
+ process.env.NEXT_PUBLIC_SUPABASE_URL,
14
+ process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY,
15
  {
16
  cookies: {
17
  getAll() {
 
28
  }
29
  );
30
 
31
+ // Refresh session tokens
32
+ supabase.auth.getUser();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  return supabaseResponse;
35
  }