Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
794ffc8
fix: session
techwithanirudh Nov 5, 2024
f9f7eef
panik-fix: twa
techwithanirudh Nov 5, 2024
23acfb1
Merge branch 'Meeting-Baas:main' into main
techwithanirudh Nov 5, 2024
f2e66c2
Merge branch 'Meeting-Baas:main' into canary
techwithanirudh Nov 5, 2024
a8b7800
fix: .env.example
techwithanirudh Nov 5, 2024
b9f1fe0
Merge branch 'canary' of https://github.com/techwithanirudh/transcrip…
techwithanirudh Nov 5, 2024
8b4add4
Merge pull request #32 from techwithanirudh/canary
techwithanirudh Nov 5, 2024
21c681d
fix: nextjs output type
techwithanirudh Nov 5, 2024
6028b72
fix: prod
techwithanirudh Nov 5, 2024
41fcf3f
docs: fix api config
techwithanirudh Nov 5, 2024
49440ea
style: login px-2
techwithanirudh Nov 5, 2024
876b986
Merge pull request #33 from techwithanirudh/canary
techwithanirudh Nov 5, 2024
494fec9
fix: prodd!!!
techwithanirudh Nov 5, 2024
c26ab91
Merge pull request #34 from techwithanirudh/canary
techwithanirudh Nov 5, 2024
5c9c001
fix: bauth
techwithanirudh Nov 5, 2024
349a834
fix: cors handling
techwithanirudh Nov 5, 2024
1f8ec8d
fix: seperate cors in env
techwithanirudh Nov 5, 2024
bef2385
Merge pull request #35 from techwithanirudh/canary
techwithanirudh Nov 5, 2024
bae1087
fix: node-env to dev from prod
techwithanirudh Nov 5, 2024
bba672c
Merge pull request #36 from techwithanirudh/canary
techwithanirudh Nov 5, 2024
da89d8c
fix: update callbackURL in login.tsx
techwithanirudh Nov 5, 2024
dea72da
fix: build
techwithanirudh Nov 5, 2024
208a1a9
Merge pull request #37 from techwithanirudh/canary
techwithanirudh Nov 5, 2024
8a086db
fix: baas-url
techwithanirudh Nov 6, 2024
d51746d
fix: auth-logic
techwithanirudh Nov 6, 2024
75163d1
fix nitro cors handling
techwithanirudh Nov 6, 2024
c0f56b3
fix nitro cors handling (#44)
techwithanirudh Nov 6, 2024
3a8fe2e
fix types for fetching bot data
techwithanirudh Nov 6, 2024
dc2bdf9
fix types for fetching bot data (#45)
techwithanirudh Nov 6, 2024
e59d8a6
fix: credentials
techwithanirudh Nov 6, 2024
cb9d2b2
refactor: calendar sidebar and user menu
techwithanirudh Nov 6, 2024
2e7095c
Refactor sign-out button component
techwithanirudh Nov 6, 2024
81a760f
Refactor user menu and sign-out button components
techwithanirudh Nov 6, 2024
0af6e9a
feat: add user menu and calendar UI improvements (#48)
techwithanirudh Nov 6, 2024
7f4208b
refactor: replace custom proxy with h3-proxy
techwithanirudh Nov 6, 2024
fff5ad2
refactor: replace custom proxy with h3-proxy (#49)
techwithanirudh Nov 6, 2024
5945c0f
docs: fix confusing wording
techwithanirudh Nov 7, 2024
5d1af9d
fix: firebase cli config
techwithanirudh Nov 7, 2024
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: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
// "install_deno": "curl -fsSL https://deno.land/install.sh | sh",
"install_xdg-utils": "bash ./.devcontainer/scripts/install_xdg-utils.sh",
"install_gcloud-cli": "bash ./.devcontainer/scripts/install_gcloud-cli.sh",
"install_firebase-cli": "bash ./.devcontainers/scripts/install_firebase-cli.sh",
"configure_pnpm-cli": "bash ./.devcontainer/scripts/install_gcloud-cli.sh",
"configure_git-repo": "bash ./.devcontainer/scripts/configure_git-repo.sh"
},
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/scripts/install_firebase-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -sL https://firebase.tools | bash
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ VITE_PROXY_URL=https://localhost:3000
VITE_API_URL=https://localhost:3001

# Advanced
VITE_S3_PREFIX=https://s3.eu-west-3.amazonaws.com/meeting-baas-video
VITE_S3_PREFIX=https://s3.eu-west-3.amazonaws.com/meeting-baas-video

# Environment
NODE_ENV=development
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ web_modules/
.env.development.local
.env.test.local
.env.production.local
.env.pre-production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
Expand Down
12 changes: 5 additions & 7 deletions 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 All @@ -14,11 +14,9 @@ TURSO_AUTH_TOKEN=""
# Auth
BETTER_AUTH_SECRET=""
BETTER_AUTH_URL="http://localhost:3001"
BETTER_AUTH_TRUSTED_ORIGINS="http://localhost:5173"

# Keyless Config
# This section is a work-in-progress
# CORS
API_TRUSTED_ORIGINS="http://localhost:5173"

# Hono Firebase Compatability
# https://github.com/honojs/hono/issues/1695
# NODEJS_HELPERS="0"
# Environment
NODE_ENV=development
11 changes: 0 additions & 11 deletions apps/api/.firebaserc

This file was deleted.

2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@hono/node-server": "^1.13.2",
"@libsql/client": "^0.14.0",
"better-auth": "0.7.1-beta.6",
"better-auth": "0.7.3",
"dotenv": "^16.4.5",
"drizzle-orm": "^0.35.2",
"firebase-admin": "^12.6.0",
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 @@ -9,6 +9,7 @@ export const auth = betterAuth({
logger: {
verboseLogging: true,
},
trustedOrigins: process.env.API_TRUSTED_ORIGINS?.split(','),
socialProviders: {
google: {
clientId: process.env.GOOGLE_CLIENT_ID!,
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const authRouter = new Hono<Bindings>();
authRouter.use(
'/**',
cors({
origin: process.env.BETTER_AUTH_TRUSTED_ORIGINS!,
origin: process.env.API_TRUSTED_ORIGINS?.split(',') ?? [],
allowHeaders: ['Content-Type', 'Authorization'],
allowMethods: ['POST', 'GET', 'OPTIONS'],
exposeHeaders: ['Content-Length'],
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/calendars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const calendars = new Hono<Bindings>();
calendars.use(
'/*',
cors({
origin: process.env.BETTER_AUTH_TRUSTED_ORIGINS!,
origin: process.env.API_TRUSTED_ORIGINS?.split(',') ?? [],
exposeHeaders: ['Content-Length'],
maxAge: 600,
credentials: true,
Expand Down
8 changes: 7 additions & 1 deletion apps/docs/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
ORAMA_PRIVATE_API_KEY=""
ORAMA_INDEX_ID=""
ORAMA_INDEX_ID=""

NEXT_PUBLIC_ORAMA_API_KEY=""
NEXT_PUBLIC_ORAMA_ENDPOINT=""

# Environment
NODE_ENV=development
18 changes: 12 additions & 6 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 @@ -247,13 +247,14 @@ Create a `.env.development.local` file in the below directory of your project an

<Steps>
<Step>
### MeetingBaas Proxy Configuration
### MeetingBaas Configuration

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_S3_URL="https://s3.eu-west-3.amazonaws.com/meeting-baas-video"
NITRO_MEETINGBAAS_API_URL="https://api.meetingbaas.com"
NITRO_MEETINGBAAS_S3_URL="https://s3.eu-west-3.amazonaws.com/meeting-baas-video"
NITRO_TRUSTED_ORIGINS="http://localhost:5173" # comma separated list of trusted origins
```

</Step>
Expand Down Expand Up @@ -285,16 +286,21 @@ TURSO_AUTH_TOKEN=""
<Step>
### Authentication Configuration

<Callout>
When deploying to Google Cloud Run with a custom domain, you should set the
`BETTER_AUTH_URL` environment variable to the custom domain.
</Callout>

These values are used by the api to perform authentication. Please follow the [guide](/docs/concepts/api/authentication) for more details:

```txt title=".env.development.local"
BETTER_AUTH_SECRET=""
BETTER_AUTH_URL="http://localhost:3001"
BETTER_AUTH_TRUSTED_ORIGINS="http://localhost:5173"
API_TRUSTED_ORIGINS="http://localhost:5173"
```

<Callout>
The `BETTER_AUTH_TRUSTED_ORIGINS` is not only used for authentication but also
The `API_TRUSTED_ORIGINS` is not only used for authentication but also
for CORS configuration.
</Callout>

Expand Down
7 changes: 5 additions & 2 deletions apps/docs/content/docs/guides/deployment/firebase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ For more information on Firebase Hosting, refer to the official [Firebase Hostin
If not already, create a Firebase project in the Firebase Console:

1. Create a project named **Transcript Seeker**.
2. Then, create two new web apps:
- `transcript-seeker-api`: Replace `transcript-seeker-api-c8419` in `firebase.json` and `.firebaserc` with this new ID.
2. Then, create a new web app:
- `transcript-seeker-proxy`: Replace `transcript-seeker-proxy` in `firebase.json` and `.firebaserc` with this new ID.
3. Navigate to **Hosting** and click "Get Started."
4. Finally, Replace `transcript-seeker-bdc29` in `firebase.json` and `.firebaserc` with your project id. (This is for firebase hosting, when you click on get started it automatically creates a hosting project with ur app id)
Expand Down Expand Up @@ -197,6 +196,10 @@ The command below builds and deploys the Cloud Run service. Modify the `SERVICE_
can replace `COMMIT_SHA` with a unique identifier.
</Callout>

<Callout>
If you have already deployed the frontend and are encountering a CORS error, it may be due to the API being built for production. Once the build is complete, the CORS error should be resolved.
</Callout>

```bash title="Terminal"
export COMMIT_SHA=$(git rev-parse --short HEAD)
export DEPLOY_REGION="us-central1"
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ const withMDX = createMDX();
/** @type {import('next').NextConfig} */

const config = {
output: "export",
// output: "export",
reactStrictMode: true,
eslint: {
// Replaced by root workspace command
ignoreDuringBuilds: true,
},
serverExternalPackages: ["ts-morph", "typescript"],
images: {
unoptimized: true,
},
// serverExternalPackages: ["ts-morph", "typescript"],
// images: {
// unoptimized: true,
// },
};

export default withAnalyzer(withMDX(config));
10 changes: 8 additions & 2 deletions apps/proxy/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# 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

# Keyless Config
# This section is a work-in-progress

# Firebase Deployment Config
# Advanced, only use if using firebase deployment
# NITRO_PRESET=firebase
# NITRO_PRESET=firebase

# Cors
NITRO_TRUSTED_ORIGINS="http://localhost:5173"

# Environment
NODE_ENV=development
1 change: 1 addition & 0 deletions apps/proxy/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_TRUSTED_ORIGINS` - The trusted cors origins

### Local Development

Expand Down
17 changes: 4 additions & 13 deletions apps/proxy/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
//https://nitro.unjs.io/config
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_S3_URL =
env.NITRO_MEETINGBAAS_S3_URL || 'https://s3.eu-west-3.amazonaws.com/meeting-baas-video';

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: "https://app.transcriptseeker.com",
meetingbaasApiUrl: "https://api.meetingbaas.com",
meetingbaasS3Url: "https://s3.eu-west-3.amazonaws.com/meeting-baas-video",
},

firebase: {
Expand Down
4 changes: 1 addition & 3 deletions apps/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
},
"prettier": "@meeting-baas/prettier-config",
"dependencies": {
"firebase-admin": "^12.6.0",
"firebase-functions": "^6.0.1",
"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 didHandleCors = handleCors(event, {
origin: trustedOrigins,
preflight: {
statusCode: 204,
},
credentials: true,
methods: '*',
});

if (didHandleCors) {
return;
}
});
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);
});
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@tanstack/react-table": "^8.19.2",
"@vidstack/react": "^1.11.24",
"assemblyai": "^4.6.1",
"better-auth": "0.7.1-beta.6",
"better-auth": "0.7.3",
"date-fns": "^3.6.0",
"dotenv-cli": "catalog:",
"hls.js": "^1.5.13",
Expand Down
Loading