Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ VITE_PROXY_URL=https://localhost:3000
# API Config
VITE_API_URL=https://localhost:3001

# Web app URL
VITE_WEB_URL=http://localhost:5173

# Advanced
VITE_S3_PREFIX=https://s3.eu-west-3.amazonaws.com/meeting-baas-video
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
.pnpm-store/*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down
2 changes: 1 addition & 1 deletion apps/api/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MeetingBaas Proxy Config
MEETINGBAAS_API_URL="https://api.meeting-baas.com"
MEETINGBAAS_API_URL="https://api.meetingbaas.com"
MEETINGBAAS_S3_URL="https://s3.eu-west-3.amazonaws.com/meeting-baas-video"

# Google Auth
Expand Down
1 change: 1 addition & 0 deletions apps/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Once deployed, make sure to set the following environment variables:

- `NITRO_MEETINGBAAS_API_URL` - The URL for the MeetingBaas API
- `NITRO_MEETINGBAAS_S3_URL` - The URL for the MeetingBaas S3 bucket
- `NITRO_WEB_URL` - The URL for the Web App

### Local Development

Expand Down
1 change: 1 addition & 0 deletions apps/api/src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: 'sqlite',
}),
trustedOrigins: process.env.BETTER_AUTH_TRUSTED_ORIGINS?.split(',') ?? [],
logger: {
verboseLogging: true,
},
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/concepts/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Create a `.env.development.local` file in the below directory of your project an
These values are used by the api to figure out the api url for baas servers.

```txt title=".env.development.local"
MEETINGBAAS_API_URL="https://api.meeting-baas.com"
MEETINGBAAS_API_URL="https://api.meetingbaas.com"
MEETINGBAAS_S3_URL="https://s3.eu-west-3.amazonaws.com/meeting-baas-video"
```

Expand Down Expand Up @@ -252,7 +252,7 @@ Create a `.env.development.local` file in the below directory of your project an
These values are used by the api to figure out the api url for baas servers.

```txt title=".env.development.local"
MEETINGBAAS_API_URL="https://api.meeting-baas.com"
MEETINGBAAS_API_URL="https://api.meetingbaas.com"
MEETINGBAAS_S3_URL="https://s3.eu-west-3.amazonaws.com/meeting-baas-video"
```

Expand Down
1 change: 0 additions & 1 deletion apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const config = {
// Replaced by root workspace command
ignoreDuringBuilds: true,
},
serverExternalPackages: ["ts-morph", "typescript"],
images: {
unoptimized: true,
},
Expand Down
12 changes: 6 additions & 6 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"fumadocs-ui": "14.2.0",
"hast": "^1.0.0",
"hast-util-to-jsx-runtime": "^2.3.2",
"next": "15.0.1",
"next": "catalog:",
"next-validate-link": "^1.1.0",
"react": "catalog:react19",
"react-dom": "catalog:react19",
"react": "catalog:",
"react-dom": "catalog:",
"react-medium-image-zoom": "^5.2.10",
"rehype-katex": "^7.0.1",
"remark": "^15.0.1",
Expand All @@ -57,12 +57,12 @@
"@next/bundle-analyzer": "^15.0.2",
"@types/mdx": "^2.0.13",
"@types/node": "^22.8.4",
"@types/react": "catalog:react19",
"@types/react-dom": "catalog:react19",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"autoprefixer": "^10.4.20",
"lucide-react": "^0.453.0",
"postcss": "^8.4.47",
"tailwindcss": "catalog:",
"typescript": "catalog:"
}
}
}
3 changes: 2 additions & 1 deletion apps/proxy/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# MeetingBaas Proxy Config
NITRO_MEETINGBAAS_API_URL=https://api.meeting-baas.com
NITRO_MEETINGBAAS_API_URL=https://api.meetingbaas.com
NITRO_MEETINGBAAS_S3_URL=https://s3.eu-west-3.amazonaws.com/meeting-baas-video
NITRO_WEB_URL=http://localhost:5173

# Keyless Config
# This section is a work-in-progress
Expand Down
14 changes: 7 additions & 7 deletions apps/proxy/nitro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import process from 'node:process';

const env = process.env;

const MEETINGBAAS_API_URL = env.NITRO_MEETINGBAAS_API_URL || 'https://api.meeting-baas.com';
const MEETINGBAAS_API_URL = env.NITRO_MEETINGBAAS_API_URL || 'https://api.meetingbaas.com';
const MEETINGBAAS_S3_URL =
env.NITRO_MEETINGBAAS_S3_URL || 'https://s3.eu-west-3.amazonaws.com/meeting-baas-video';
const NITRO_WEB_URL = env.NITRO_WEB_URL || 'https://app.transcriptseeker.com';

export default defineNitroConfig({
srcDir: 'server',

// https://github.com/unjs/rou3/tree/radix3#route-matcher
routeRules: {
'/api/meetingbaas/**': { proxy: `${MEETINGBAAS_API_URL}/**`, cors: true },
'/api/s3/**': { proxy: `${MEETINGBAAS_S3_URL}/**`, cors: true },
// '/proxy/**': { proxy: '/api/**' },
runtimeConfig: {
trustedOrigins: NITRO_WEB_URL,
meetingBaasApiUrl: MEETINGBAAS_API_URL,
meetingBaasS3Url: MEETINGBAAS_S3_URL,
},

firebase: {
Expand All @@ -23,4 +23,4 @@ export default defineNitroConfig({
},

compatibilityDate: '2024-11-05',
});
});
3 changes: 2 additions & 1 deletion apps/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"dependencies": {
"firebase-admin": "^12.6.0",
"firebase-functions": "^6.0.1",
"firebase-functions-test": "^3.3.0"
"firebase-functions-test": "^3.3.0",
"h3-proxy": "^1.13.0"
}
}
15 changes: 15 additions & 0 deletions apps/proxy/server/middleware/cors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default defineEventHandler((event) => {
const trustedOrigins = useRuntimeConfig(event).trustedOrigins.split(',');
const corsHandled = handleCors(event, {
origin: trustedOrigins,
preflight: {
statusCode: 204,
},
credentials: true,
methods: '*',
});

if (corsHandled) {
return;
}
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Missing default handler for non-CORS requests

The middleware returns early if CORS is handled, but doesn't provide a default path for when CORS isn't handled. This might lead to incomplete request processing if this is the only middleware in the chain.

   if (corsHandled) {
     return;
   }
+  // Continue to the next handler for non-CORS requests
 });

Committable suggestion skipped: line range outside the PR's diff.

15 changes: 15 additions & 0 deletions apps/proxy/server/middleware/meetingbaas-proxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { createProxyEventHandler } from 'h3-proxy';

export default eventHandler((event) => {
const { meetingBaasApiUrl } = useRuntimeConfig(event);

const proxy = createProxyEventHandler({
target: meetingBaasApiUrl,
pathRewrite: {
'^/api/meetingbaas': '',
},
pathFilter: ['/api/meetingbaas/**'],
});

return proxy(event);
});
15 changes: 15 additions & 0 deletions apps/proxy/server/middleware/s3-proxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { createProxyEventHandler } from 'h3-proxy';

export default eventHandler((event) => {
const { meetingBaasS3Url } = useRuntimeConfig(event);

const proxy = createProxyEventHandler({
target: meetingBaasS3Url,
pathRewrite: {
'^/api/s3': '',
},
pathFilter: ['/api/s3/**'],
});

return proxy(event);
});
10 changes: 5 additions & 5 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"novel": "^0.4.3",
"nuqs": "^2.1.1",
"openai": "^4.52.7",
"react": "catalog:react19",
"react": "catalog:",
"react-day-picker": "8.10.1",
"react-dom": "catalog:react19",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.1",
"react-router-dom": "^6.24.1",
"sonner": "^1.5.0",
Expand All @@ -64,8 +64,8 @@
"@rollup/plugin-replace": "^6.0.1",
"@types/lodash": "^4.17.7",
"@types/node": "^22.8.4",
"@types/react": "catalog:react19",
"@types/react-dom": "catalog:react19",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@types/uuid": "^10.0.0",
"@vitejs/plugin-react-swc": "^3.7.1",
"autoprefixer": "^10.4.20",
Expand All @@ -81,4 +81,4 @@
"vite-plugin-checker": "^0.8.0"
},
"prettier": "@meeting-baas/prettier-config"
}
}
16 changes: 8 additions & 8 deletions apps/web/src/components/settings/settings-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const ApiKeyField: React.FC<ApiKeyFieldProps> = ({
};

export function SettingsForm() {
const { data: session, isPending: isSessionLoading } = useSession();
const { data: session, isPending: isSessionLoading, error: sessionError } = useSession();

const { apiKey: baasApiKey } = useApiKey({ type: 'meetingbaas' });
const { apiKey: openAIApiKey } = useApiKey({ type: 'openai' });
Expand Down Expand Up @@ -251,16 +251,16 @@ export function SettingsForm() {
</AccordionTrigger>
<AccordionContent className="flex flex-col space-y-6 px-1">
<code className="h-128 w-full rounded-md bg-muted p-4">
{session.user
? JSON.stringify(session.user)
: isSessionLoading
? 'loading...'
: 'not authenticated'}
{isSessionLoading
? 'loading...'
: sessionError
? 'not authenticated'
: JSON.stringify(session.user)}
</code>

{session.user && <SignOut />}
{!isSessionLoading && !sessionError && <SignOut />}

{!session.user && (
{!isSessionLoading && sessionError && (
<Link to="/login" className={cn(buttonVariants({ variant: 'default' }))}>
Login
</Link>
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const VITE_PROXY_URL = import.meta.env.VITE_PROXY_URL;
export const VITE_API_URL = import.meta.env.VITE_API_URL;
export const VITE_WEB_URL = import.meta.env.VITE_WEB_URL;
export const VITE_S3_PREFIX = import.meta.env.VITE_S3_PREFIX;
export const PROFILE = import.meta.env.VITE_PROFILE;

Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { LoaderIcon } from 'lucide-react';

import { Button } from '@meeting-baas/ui/button';

import { VITE_WEB_URL } from '../lib/constants';

function LoginPage() {
const [isPending, startTransition] = useTransition();

Expand All @@ -22,7 +24,7 @@ function LoginPage() {
startTransition(async () => {
await signIn.social({
provider: 'google',
callbackURL: '/meetings',
callbackURL: `${VITE_WEB_URL}/meetings`,
});
});
}}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
},
"devDependencies": {
"@meeting-baas/shared": "workspace:*",
"@types/react": "catalog:react19",
"@types/react-dom": "catalog:react19",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"cross-env": "^7.0.3",
"turbo": "^2.2.3",
"typescript": "^5.2.2"
Expand All @@ -50,4 +50,4 @@
}
},
"packageManager": "[email protected]"
}
}
4 changes: 2 additions & 2 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"@meeting-baas/tailwind-config": "workspace:*",
"@meeting-baas/tsconfig": "workspace:*",
"@types/node": "^22.8.4",
"@types/react": "catalog:react19",
"@types/react": "catalog:",
"eslint": "catalog:",
"prettier": "catalog:",
"typescript": "catalog:"
},
"prettier": "@meeting-baas/prettier-config"
}
}
8 changes: 4 additions & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@
"@meeting-baas/prettier-config": "workspace:*",
"@meeting-baas/tailwind-config": "workspace:*",
"@meeting-baas/tsconfig": "workspace:*",
"@types/react": "catalog:react19",
"@types/react": "catalog:",
"eslint": "catalog:",
"prettier": "catalog:",
"react": "catalog:react19",
"react": "catalog:",
"typescript": "catalog:",
"zod": "catalog:"
},
"peerDependencies": {
"react": "catalog:react19",
"react": "catalog:",
"zod": "catalog:"
},
"prettier": "@meeting-baas/prettier-config"
}
}
Loading