Skip to content

refactor: Update DB schema, add API key & app validation, and domain checks - #12

Merged
Danziger merged 26 commits into
developmentfrom
arc-1071/applications-plans
Mar 6, 2025
Merged

refactor: Update DB schema, add API key & app validation, and domain checks#12
Danziger merged 26 commits into
developmentfrom
arc-1071/applications-plans

Conversation

@pawanpaudel93

@pawanpaudel93pawanpaudel93 commented Feb 27, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR includes the following:

  • Updated DB schema to include Organization, Team & Application.
  • Added triggers for Organization, Team and Api Key creation after user creation.
  • Implemented API key, application and domain validation in server context.
  • Modified .env.example to include temporary environment variables for application ID and API key.

How to Test

  • Run db migrations pnpm db:migrate
  • Create a user by going to Supabase project dashboard on Authentication -> Add user. After this create an organization, team, application (with domain as ["localhost:3000"]) and an api key.
  • Copy the Application Id and Api Key to .env
    NEXT_PUBLIC_APPLICATION_ID=""
    NEXT_PUBLIC_CLIENT_ID=""
  • Run pnpm dev and try to authenticate using another google account going to http://localhost:3000

Questions:

  • Should we validate the api key and application id on each request and if so should we use some caching mechanism ?

@vercel

vercelBot commented Feb 27, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

NameStatusPreviewCommentsUpdated (UTC)
embed-api✅ Ready (Inspect)Visit Preview💬 Add feedbackMar 6, 2025 3:23pm

@pawanpaudel93pawanpaudel93 changed the title WIP: Update DB schema, add API key & app validation, and domain checksrefactor: Update DB schema, add API key & app validation, and domain checksFeb 28, 2025
Comment threadprisma/schema.prisma Outdated
Comment threadprisma/schema.prisma Outdated
Comment threadprisma/schema.prisma Outdated
Comment threadprisma/schema.prisma
Comment threadprisma/migrations/20250221160426_user_trigger/migration.sql Outdated
Comment threadserver/context.ts Outdated
Comment threadserver/context.ts Outdated
Comment threadserver/context.ts
Comment threadprisma/schema.prisma Outdated
Comment threadprisma/schema.prisma
Comment threadprisma/schema.prisma Outdated
Comment threadserver/utils/validation/validation.utils.ts Outdated
Comment threadprisma/migrations/20250224085618_create_org_team_app/migration.sql Outdated
Comment threadprisma/schema.prisma Outdated
Comment threadprisma/schema.prisma Outdated
Comment threadprisma/schema.prisma Outdated
@Danziger
Danziger merged commit 88d2c04 into developmentMar 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@pawanpaudel93@Danziger@7i7o