Openstatus www.openstatus.dev

chore:Create env files that works (#64)

* chore: improve env

* chore: improve dev env

* fix: build

authored by

Thibault Le Ouay and committed by
GitHub
17c9b0a6 30364366

+56 -35
+19 -17
apps/web/.env.example
··· 1 - # For Clerk Auth 2 - NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= 3 - CLERK_SECRET_KEY= 4 - CLERK_WEBHOOK_SECRET= 5 - 1 + # CLERK for auth 2 + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=clerk-public-key 3 + CLERK_SECRET_KEY=clerk-secret-key 4 + CLERK_WEBHOOK_SECRET=clerk 6 5 NEXT_PUBLIC_CLERK_SIGN_IN_URL=/app/sign-in 7 6 NEXT_PUBLIC_CLERK_SIGN_UP_URL=/app/sign-up 8 7 NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/app 9 8 NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/app 10 9 11 - # TinyBird 12 - TINY_BIRD_API_KEY= 10 + # RESEND for email 11 + RESEND_API_KEY=resend-api-key 13 12 14 - # Resend 15 - RESEND_API_KEY= 13 + # UPSTASH for queue 14 + QSTASH_CURRENT_SIGNING_KEY=qstash-current-signing-key 15 + QSTASH_NEXT_SIGNING_KEY=qstash-next-signing-key 16 + QSTASH_TOKEN=qstash-token 17 + QSTASH_URL=https://qstash.upstash.io/v1/publish/ 16 18 17 - # Upstash 18 - UPSTASH_REDIS_REST_URL= 19 - UPSTASH_REDIS_REST_TOKEN= 19 + # UPSTASH redis for waiting list 20 + UPSTASH_REDIS_REST_URL=test 21 + UPSTASH_REDIS_REST_TOKEN=test 20 22 21 - QSTASH_CURRENT_SIGNING_KEY= 22 - QSTASH_NEXT_SIGNING_KEY= 23 - QSTASH_TOKEN= 23 + # TINY BIRD for time series data (trackers) 24 + TINY_BIRD_API_KEY=tiny-bird-api-key 24 25 25 - RESEND_API_KEY='api-key' 26 + # PlanetScale ( or a local mysql database) 27 + DATABASE_URL='mysql://root:password@localhost:3306/openstatus' 26 28 27 29 # Solves 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', see https://github.com/nextauthjs/next-auth/issues/3580 28 - # NODE_TLS_REJECT_UNAUTHORIZED="0" 30 + # NODE_TLS_REJECT_UNAUTHORIZED="0"
+2 -1
apps/web/src/app/layout.tsx
··· 3 3 import type { Metadata } from "next"; 4 4 import { Inter } from "next/font/google"; 5 5 import LocalFont from "next/font/local"; 6 - import { Toaster } from "@/components/ui/toaster"; 7 6 import { ClerkProvider } from "@clerk/nextjs"; 8 7 import PlausibleProvider from "next-plausible"; 9 8 9 + import { Toaster } from "@/components/ui/toaster"; 10 10 import Background from "./_components/background"; 11 11 12 12 const inter = Inter({ subsets: ["latin"] }); ··· 43 43 }: { 44 44 children: React.ReactNode; 45 45 }) { 46 + // If you want to develop locally with with Clerk, Comment the provider below 46 47 return ( 47 48 <ClerkProvider> 48 49 <html lang="en">
+1 -1
apps/web/src/app/monitor/[id]/page.tsx
··· 30 30 const data = search.success 31 31 ? await getResponseListData({ siteId: params.id, ...search.data }) 32 32 : await getResponseListData({ siteId: params.id }); 33 - 33 + if (!data) return <div>Something went wrong</div>; 34 34 return <DataTable columns={columns} data={data} />; 35 35 }
+8 -6
apps/web/src/app/page.tsx
··· 44 44 <div className="z-10 mx-auto w-full max-w-xl backdrop-blur-[2px]"> 45 45 <div className="border-border rounded-lg border p-8"> 46 46 <h1 className="font-cal mb-3 text-center text-2xl">Status</h1> 47 - <Tracker 48 - data={data} 49 - id="openstatus" 50 - name="Ping" 51 - url="https://openstatus.dev/api/ping" 52 - /> 47 + {data && ( 48 + <Tracker 49 + data={data} 50 + id="openstatus" 51 + name="Ping" 52 + url="https://openstatus.dev/api/ping" 53 + /> 54 + )} 53 55 </div> 54 56 </div> 55 57 </div>
+2
apps/web/src/app/play/@modal/(..)monitor/[id]/page.tsx
··· 32 32 ? await getResponseListData({ siteId: params.id, ...search.data }) 33 33 : await getResponseListData({ siteId: params.id }); 34 34 35 + if (!data) return <div>Something went wrong</div>; 36 + 35 37 return ( 36 38 <Modal> 37 39 <DataTable columns={columns} data={data} />
+8 -6
apps/web/src/app/play/page.tsx
··· 32 32 </div> 33 33 <p className="font-cal mb-2 text-3xl">Status</p> 34 34 <p className="text-lg font-light">Learn more on how to build your own.</p> 35 - <Tracker 36 - data={data} 37 - id="openstatus" 38 - name="Ping" 39 - url="https://openstatus.dev/api/ping" 40 - /> 35 + {data && ( 36 + <Tracker 37 + data={data} 38 + id="openstatus" 39 + name="Ping" 40 + url="https://openstatus.dev/api/ping" 41 + /> 42 + )} 41 43 </div> 42 44 ); 43 45 }
+2
apps/web/src/components/status-page/monitor.tsx
··· 14 14 // const data = await getMonitorListData({ siteId: String(monitor.pageId) }); 15 15 const data = await getMonitorListData({ siteId: "openstatus" }); 16 16 17 + if (!data) return <div>Something went wrong</div>; 18 + 17 19 return ( 18 20 <div className="border-border rounded-lg border p-8"> 19 21 <h1 className="font-cal mb-3 text-center text-2xl">Status</h1>
+14 -4
apps/web/src/lib/tb.ts
··· 18 18 Pick<ResponseListParams, "siteId" | "region" | "cronTimestamp" | "limit"> 19 19 >, 20 20 ) { 21 - const res = await getResponseList(tb)(props); 22 - return res.data; 21 + try { 22 + const res = await getResponseList(tb)(props); 23 + return res.data; 24 + } catch (e) { 25 + console.error(e); 26 + } 27 + return; 23 28 } 24 29 25 30 export async function getMonitorListData(props: Partial<MonitorListParams>) { 26 - const res = await getMonitorList(tb)(props); 27 - return res.data; 31 + try { 32 + const res = await getMonitorList(tb)(props); 33 + return res.data; 34 + } catch (e) { 35 + console.error(e); 36 + } 37 + return; 28 38 }