Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
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
10 changes: 4 additions & 6 deletions apps/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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.2",
"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
9 changes: 7 additions & 2 deletions apps/docs/content/docs/concepts/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,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));
5 changes: 4 additions & 1 deletion apps/proxy/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ NITRO_MEETINGBAAS_S3_URL=https://s3.eu-west-3.amazonaws.com/meeting-baas-video

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

# Environment
NODE_ENV=development
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.2",
"date-fns": "^3.6.0",
"dotenv-cli": "catalog:",
"hls.js": "^1.5.13",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/settings/settings-form.tsx
Original file line number Diff line number Diff line change
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
{session?.user
? JSON.stringify(session.user)
: isSessionLoading
? 'loading...'
: 'not authenticated'}
</code>

{session.user && <SignOut />}
{session?.user && <SignOut />}

{!session.user && (
{!session?.user && (
<Link to="/login" className={cn(buttonVariants({ variant: 'default' }))}>
Login
</Link>
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function LoginPage() {
const [isPending, startTransition] = useTransition();

return (
<div className="flex h-full min-h-svh flex-col items-center justify-center">
<div className="flex h-full min-h-svh flex-col items-center justify-center px-2">
<div className="flex max-w-md flex-1 flex-col items-center justify-center gap-4">
<h1 className="text-4xl font-bold">Login</h1>
<p className="text-lg text-gray-500">
Expand All @@ -22,7 +22,8 @@ function LoginPage() {
startTransition(async () => {
await signIn.social({
provider: 'google',
callbackURL: '/meetings',
// todo: remove this when better auth resolves the callback url automatically
callbackURL: new URL('/meetings', document.location as any).href,
});
});
}}
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions scripts/one-click-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ echo "Environment set to production."
# Build and deploy apps/web
echo "Building and deploying apps/web..."
cd apps/web
pnpm build
NODE_ENV=production pnpm build
firebase deploy || { echo "Firebase deploy for apps/web failed"; exit 1; }
cd ../..

# Build and deploy apps/proxy
echo "Building and deploying apps/proxy..."
cd apps/proxy
pnpm build
NODE_ENV=production pnpm build
firebase deploy || { echo "Firebase deploy for apps/proxy failed"; exit 1; }
cd ../..

# Build apps/api
echo "Building apps/api..."
cd apps/api
pnpm build || { echo "Build failed for apps/api"; exit 1; }
NODE_ENV=production pnpm build || { echo "Build failed for apps/api"; exit 1; }
cd ../..

# Log Cloud Run deployment
Expand All @@ -40,7 +40,7 @@ echo "Preparing for Cloud Run deployment..."
export COMMIT_SHA=$(git rev-parse --short HEAD)
export DEPLOY_REGION="us-central1"
export SERVICE_NAME="transcript-seeker-api-prod"
export GITHUB_USERNAME="Meeting-Baas"
export GITHUB_USERNAME="techwithanirudh"

echo "Environment variables set:"
echo " COMMIT_SHA: $COMMIT_SHA"
Expand Down
7 changes: 5 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@
"TURSO_AUTH_TOKEN",
"BETTER_AUTH_SECRET",
"BETTER_AUTH_URL",
"BETTER_AUTH_TRUSTED_ORIGINS",
"ORAMA_PRIVATE_API_KEY"
"API_TRUSTED_ORIGINS",
"ORAMA_PRIVATE_API_KEY",
"ORAMA_INDEX_ID",
"NEXT_PUBLIC_ORAMA_API_KEY",
"NEXT_PUBLIC_ORAMA_ENDPOINT"
],
"globalPassThroughEnv": [
"NODE_ENV",
Expand Down