Skip to content

Switch to InstantDB driven backend #3190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
prisma
node_modules
26 changes: 0 additions & 26 deletions codegen.ts

This file was deleted.

4 changes: 0 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ const config = [
},
js.configs.recommended,
...ts.configs.recommended,
{
// temporary until code get changed
rules: { '@typescript-eslint/no-explicit-any': 'off' },
},
prettierConfigRecommended,
{
files: ['** / *.{js,tsx}'],
Expand Down
19 changes: 0 additions & 19 deletions instrumentation.js

This file was deleted.

53 changes: 0 additions & 53 deletions middleware.ts

This file was deleted.

19 changes: 7 additions & 12 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
// @ts-check

// eslint-disable-next-line no-undef
const disableOtel = process.env.OTEL_DISABLED;
const instrumentationHook = disableOtel !== 'true';
// eslint-disable-next-line no-undef
console.log(
`instrumentation via OTEL: ${
instrumentationHook ? 'enabled' : 'disabled'
} - by env: OTEL_DISABLED=${disableOtel}`
);

/**
* @type {import('next').NextConfig}
**/
const nextConfig = {
poweredByHeader: false,

reactStrictMode: true,

eslint: {
// Warning: This allows production builds to complete even if
// Your project has ESLint errors.
ignoreDuringBuilds: true,
},
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
};

export default nextConfig;
54 changes: 6 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,83 +8,41 @@
"type": "module",
"homepage": "/",
"dependencies": {
"@apollo/client": "3.13.8",
"@chakra-ui/icons": "2.2.4",
"@chakra-ui/react": "2.10.9",
"@clerk/nextjs": "6.23.0",
"@clerk/themes": "2.2.51",
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.1",
"@escape.tech/graphql-armor-block-field-suggestions": "^3.0.0",
"@graphql-yoga/plugin-disable-introspection": "^2.14.3",
"@neondatabase/serverless": "1.0.1",
"@opentelemetry/auto-instrumentations-node": "0.60.1",
"@opentelemetry/auto-instrumentations-web": "0.48.0",
"@opentelemetry/context-zone": "2.0.1",
"@opentelemetry/instrumentation-express": "0.51.0",
"@opentelemetry/instrumentation-graphql": "0.50.0",
"@opentelemetry/instrumentation-http": "0.202.0",
"@opentelemetry/instrumentation-winston": "0.47.0",
"@opentelemetry/sdk-trace-web": "2.0.1",
"@opentelemetry/winston-transport": "0.13.0",
"@pothos/core": "4.7.0",
"@pothos/plugin-prisma": "4.9.1",
"@pothos/plugin-with-input": "4.1.2",
"@prisma/adapter-neon": "6.10.1",
"@prisma/client": "6.10.1",
"@prisma/extension-accelerate": "2.0.1",
"@prisma/instrumentation": "6.10.1",
"@vercel/analytics": "1.5.0",
"@vercel/otel": "1.13.0",
"@vercel/speed-insights": "1.2.0",
"emitter-listener": "1.1.2",
"@emotion/styled": "11.14.0",
"framer-motion": "12.19.1",
"graphql": "16.11.0",
"graphql-scalars": "1.24.2",
"graphql-tag": "2.12.6",
"graphql-yoga": "5.13.5",
"inter-ui": "4.1.1",
"next": "15.3.4",
"prisma": "6.10.1",
"react": "19.1.0",
"react-apollo-network-status": "5.3.1",
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "16.0.1",
"react-dom": "19.1.0",
"react-icons": "5.5.0",
"react-is": "19.1.0",
"react-timeago": "8.2.0",
"utf-8-validate": "6.0.3",
"ws": "8.18.2",
"zone.js": "0.15.1"
"ws": "8.18.2"
},
"scripts": {
"dev": "echo you wanna run: yarn start instead; yarn start",
"start": "next dev",
"start:comment": "next dev ; # not with await+browser-otel: --turbo",
"start:comment": "next dev",
"start-production": "next start",
"lint": "eslint",
"trigger-e2e-smoke": "sh trigger-circleci-smoke.sh",
"smoketest": "cd smoketest; yarn --immutable ; yarn cy open --e2e -b electron",
"build": "yarn run metainfo && yarn run prisma:generate && next build",
"prisma:generate": "prisma generate",
"prisma:migrate": "DATABASE_URL=\"$MIGRATE_DATABASE_URL\" prisma migrate deploy",
"build": "yarn run metainfo && next build",
"metainfo": "sh storeMetaInfo.sh",
"vercel-build": "COMMIT_REF=$VERCEL_GITHUB_COMMIT_SHA yarn run build ; yarn trigger-e2e-smoke",
"vercel-fast-build": "COMMIT_REF=$VERCEL_GITHUB_COMMIT_SHA yarn run build",
"codegen": "graphql-codegen --config codegen.ts"
"vercel-fast-build": "COMMIT_REF=$VERCEL_GITHUB_COMMIT_SHA yarn run build"
},
"devDependencies": {
"@eslint/compat": "1.3.1",
"@eslint/eslintrc": "3.3.1",
"@eslint/js": "9.29.0",
"@graphql-codegen/cli": "5.0.7",
"@graphql-codegen/introspection": "4.0.3",
"@graphql-codegen/schema-ast": "4.1.0",
"@graphql-codegen/typescript": "4.1.6",
"@graphql-codegen/typescript-graphql-files-modules": "3.0.1",
"@graphql-codegen/typescript-operations": "4.6.1",
"@graphql-codegen/typescript-react-apollo": "4.3.3",
"@instantdb/react": "^0.10.10",
"@next/eslint-plugin-next": "15.3.4",
"@types/react": "19",
"@types/react-dom": "19.1.6",
Expand Down
30 changes: 9 additions & 21 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
import React, { Suspense } from 'react';
import React from 'react';
import Head from 'next/head';
import type { AppProps } from 'next/app';
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';
import { ClerkProvider } from '@clerk/nextjs';
import { ChakraProvider } from '@chakra-ui/react';

import 'public/index.css';

import { instrumentBrowserOtel } from 'src/instrumentBrowserOtel';
import { Footer } from 'components/Footer';
import { theme } from 'common/theme';

if (typeof window !== 'undefined') {
// TODO investigate later...: top-level await in this place
// Won't be possible with yarn next dev --turbo
// -> it hangs completely on the initial page load !
await instrumentBrowserOtel();
}
import { db, useAuth, DBContext, UserContext } from 'src/setupInstaWeb';

// The title of the Head and view-port-meta needs to go here, see https://nextjs.org/docs/messages/no-document-viewport-meta
import { theme } from 'common/theme';

export default function App({ Component, pageProps }: AppProps) {
const { user } = useAuth();
return (
<>
<Head>
<title>Coolboard - Hands-on Application Building with GraphQL</title>
<title>Coolboard</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
</Head>
<Suspense fallback={<span>Loading...</span>}>
<ClerkProvider dynamic {...pageProps}>
<UserContext.Provider value={user}>
<DBContext.Provider value={db}>
<ChakraProvider theme={theme}>
<div
style={{
Expand All @@ -44,11 +35,8 @@ export default function App({ Component, pageProps }: AppProps) {

<Footer />
</ChakraProvider>
</ClerkProvider>
</Suspense>

<Analytics />
<SpeedInsights />
</DBContext.Provider>
</UserContext.Provider>
</>
);
}
11 changes: 3 additions & 8 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { InstanaEumScripts } from 'common/instanaEumScripts';

class MyDocument extends Document {
render() {
Expand All @@ -10,18 +9,15 @@ class MyDocument extends Document {
<meta name="twitter:card" content="/screenshot.png" />
<meta name="twitter:site" content="@rhosts" />
<meta name="twitter:creator" content="@rhosts" />
<meta
name="twitter:title"
content="coolboard: graphql trello clone"
/>
<meta name="twitter:title" content="coolboard" />
<meta
name="twitter:description"
content="Working live demo of /building an entire Trello-like application using GraphQL and React/ video course on PacktPub.com"
content="Working live demo of /building an entire Trello-like application"
/>
<meta name="twitter:image" content="/screenshot.png" />
<meta
name="description"
content="Working live demo of /building an entire Trello-like application using GraphQL and React/ video course on PacktPub.com"
content="Working live demo of /building an entire Trello-like application"
/>
<link rel="manifest" href="/favicons/site.webmanifest" />
<link
Expand Down Expand Up @@ -67,7 +63,6 @@ class MyDocument extends Document {
</div>

<NextScript />
<InstanaEumScripts />
</body>
</Html>
);
Expand Down
Loading