Skip to content

Commit 864ce7e

Browse files
Merge pull request #2 from gitpod-io/chore/initial-scaffold
chore: initial project scaffold
2 parents 44ac53e + 544b95b commit 864ce7e

17 files changed

Lines changed: 109 additions & 28 deletions

.agents/architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ src/
7777
│ └── supabase/
7878
│ ├── client.ts # Browser client
7979
│ ├── server.ts # Server component client
80-
│ └── middleware.ts # Session refresh
81-
├── middleware.ts # Root middleware (Supabase session)
80+
│ └── proxy.ts # Session refresh
81+
├── proxy.ts # Root proxy (Supabase session, Next.js 16 convention)
8282
└── instrumentation.ts # Sentry server/edge init
8383
```
8484

.env.example

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
2-
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
3-
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
2+
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-supabase-publishable-key
3+
SUPABASE_SECRET_KEY=your-supabase-secret-key
4+
NEXT_PUBLIC_SENTRY_DSN=your-sentry-dsn
45
SENTRY_DSN=your-sentry-dsn
56
SENTRY_AUTH_TOKEN=your-sentry-auth-token
7+
SENTRY_ORG=your-sentry-org
8+
SENTRY_PROJECT=your-sentry-project
69
NEXT_PUBLIC_APP_URL=http://localhost:3000

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ yarn-error.log*
3333
# env files
3434
.env*
3535
!.env.example
36+
.env.sentry-build-plugin
3637

3738
# vercel
3839
.vercel

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ src/app/ → Pages and API routes (App Router)
1717
src/components/ → Reusable UI components (one per file, named exports)
1818
src/components/ui/ → shadcn/ui components (do not edit)
1919
src/lib/ → Utilities, types, constants
20-
src/lib/supabase/ → Supabase clients (client.ts, server.ts, middleware.ts)
20+
src/lib/supabase/ → Supabase clients (client.ts, server.ts, proxy.ts)
2121
supabase/migrations/ → Database migrations
2222
.agents/ → Agent knowledge base (architecture, conventions, plans)
2323
.ona/automations/ → Automation YAML definitions

instrumentation-client.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as Sentry from "@sentry/nextjs";
2+
3+
Sentry.init({
4+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
5+
6+
sendDefaultPii: true,
7+
8+
// 100% in dev, 10% in production
9+
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
10+
11+
// Session Replay: 10% of all sessions, 100% of sessions with errors
12+
replaysSessionSampleRate: 0.1,
13+
replaysOnErrorSampleRate: 1.0,
14+
15+
enableLogs: true,
16+
17+
integrations: [Sentry.replayIntegration()],
18+
});
19+
20+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;

next.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import type { NextConfig } from "next";
12
import { withSentryConfig } from "@sentry/nextjs";
23

3-
const nextConfig = {};
4+
const nextConfig: NextConfig = {};
45

56
export default withSentryConfig(nextConfig, {
67
org: process.env.SENTRY_ORG,
78
project: process.env.SENTRY_PROJECT,
8-
silent: !process.env.CI,
9+
authToken: process.env.SENTRY_AUTH_TOKEN,
910
widenClientFileUpload: true,
1011
tunnelRoute: "/monitoring",
12+
silent: !process.env.CI,
1113
});

sentry.edge.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@ import * as Sentry from "@sentry/nextjs";
22

33
Sentry.init({
44
dsn: process.env.SENTRY_DSN,
5-
tracesSampleRate: 1.0,
5+
6+
sendDefaultPii: true,
7+
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
8+
9+
enableLogs: true,
610
});

sentry.server.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@ import * as Sentry from "@sentry/nextjs";
22

33
Sentry.init({
44
dsn: process.env.SENTRY_DSN,
5-
tracesSampleRate: 1.0,
5+
6+
sendDefaultPii: true,
7+
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
8+
9+
includeLocalVariables: true,
10+
11+
enableLogs: true,
612
});

src/app/global-error.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"use client";
22

33
import * as Sentry from "@sentry/nextjs";
4+
import NextError from "next/error";
45
import { useEffect } from "react";
56

67
export default function GlobalError({
78
error,
8-
reset,
99
}: {
1010
error: Error & { digest?: string };
11-
reset: () => void;
1211
}) {
1312
useEffect(() => {
1413
Sentry.captureException(error);
@@ -17,10 +16,7 @@ export default function GlobalError({
1716
return (
1817
<html>
1918
<body>
20-
<div style={{ padding: "2rem", textAlign: "center" }}>
21-
<h2>Something went wrong</h2>
22-
<button onClick={() => reset()}>Try again</button>
23-
</div>
19+
<NextError statusCode={0} />
2420
</body>
2521
</html>
2622
);

src/app/globals.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
@import "tailwindcss";
2+
3+
@theme inline {
4+
--font-sans: var(--font-geist-sans);
5+
--font-mono: var(--font-geist-mono);
6+
}

0 commit comments

Comments
 (0)