Skip to content

Conversation

@maparent
Copy link
Collaborator

@maparent maparent commented Jun 26, 2025

Summary by CodeRabbit

  • Documentation

    • Updated setup instructions and added detailed guides for configuring Supabase environments and handling migrations in both the main and database package README files.
    • Expanded example environment files across apps to include Supabase and PostgreSQL configuration variables for both local and production setups.
    • Added new example files for production database environment configuration in all apps.
  • Chores

    • Refined .gitignore rules to more precisely target environment files and include shell-specific variants.
  • Refactor

    • Adjusted script logic to further restrict when Supabase commands are executed during builds.

@supabase
Copy link

supabase bot commented Jun 26, 2025

This pull request has been ignored for the connected project plzkmulvmuhdpcmnyrhm because there are no changes detected in projects/database/supabase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@linear
Copy link

linear bot commented Jun 26, 2025

Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

add these keys to the env.example, even if they have no values
SUPABASE_URL
SUPABASE_ANON_KEY

@mdroidian
Copy link
Contributor

@maparent In the future, please make a separate linear task. Our linear automation changes the status of the linked task. (so this one changed ENG-520: Give access to supabase in frontend. back to Ready For Review

@maparent
Copy link
Collaborator Author

Not that important, but I'm curious why do you prefer a new task to reopening a task? Imho, this is adding (post hoc) something that was forgotten in the original definition of done for the task, but saying that it's a new part of the original task, that was discovered to not be fully complete and thus needs to be reopened, could also make sense, and how I'd do things myself. I'm not wedded to it, but curious if you have a rationale against it.

Copy link
Contributor

Sub task would also achieve this result, but would be more specific instead of adding confusion to the original task.

@maparent
Copy link
Collaborator Author

maparent commented Jun 26, 2025

As discussed: I'll remove anything having to do with self-hosting. But the need to have different instructions, and different '.env' files, for when you're testing your plugin against your local supabase, the production instance, or a branch instance, remains. I'll actually sit on this for a day or two, so I can document the branch flow.

@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch from 09d66ec to 0e06890 Compare June 29, 2025 14:39
@maparent maparent marked this pull request as draft July 1, 2025 15:20
@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch 4 times, most recently from e91184b to 93f0f98 Compare July 6, 2025 21:21
@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch 2 times, most recently from 8beb43c to 9143611 Compare July 7, 2025 15:32
@maparent maparent marked this pull request as ready for review July 7, 2025 15:33
@maparent
Copy link
Collaborator Author

maparent commented Jul 7, 2025

@CodeRabbit review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 7, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@maparent
Copy link
Collaborator Author

maparent commented Jul 7, 2025

I did an extensive rewrite, and as such I think it needs a new review.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 7, 2025

📝 Walkthrough

Walkthrough

This update refines environment configuration management and documentation across multiple apps and the shared database package. It introduces new example environment files, updates .gitignore rules for environment files, and significantly expands documentation for local and production Supabase setup, including detailed workflows for development and migration management.

Changes

File(s) Change Summary
.gitignore Replaced broad .env.* ignore pattern with targeted rules for .env.localdb, .env.productiondb, and shell variant files.
README.md Added database package to shared packages list; expanded "Getting Started" with detailed Supabase setup instructions for local, production, and branch environments.
apps/obsidian/.env.example
apps/roam/.env.example
apps/website/.env.example
Expanded example environment files to include Supabase and PostgreSQL configuration placeholders and example values.
apps/obsidian/.env.productiondb.example
apps/roam/.env.productiondb.example
apps/website/.env.productiondb.example
Added new production database environment example files with Supabase and PostgreSQL configuration templates.
packages/database/README.md Extensively expanded and restructured documentation for local development, environment management, migration workflow, and Supabase branch handling.
packages/database/scripts/build.ts Tightened conditional execution of Supabase commands: now requires both HOME ≠ "/vercel" and SUPABASE_URL = 'http://127.0.0.1:54321'.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant LocalEnv
    participant SupabaseCLI
    participant SupabaseStudio

    Developer->>LocalEnv: Set up .env.localdb / .env.productiondb
    Developer->>SupabaseCLI: Start Supabase (if local)
    SupabaseCLI->>LocalEnv: Provide connection info (URL, keys)
    Developer->>LocalEnv: Populate .env files with Supabase info
    Developer->>SupabaseStudio: Access Studio for inspection (if local)
    Developer->>SupabaseCLI: Run migrations, generate types (if local)
Loading

Possibly related PRs

  • DiscourseGraphs/discourse-graph#197: Introduced the cross-platform build.ts script in packages/database/scripts, which is directly modified in this PR to further restrict when Supabase commands are executed.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
packages/database/README.md (1)

36-41: Fix “supbase” typo in file paths

All documented paths use supabase/…, but this bullet uses supbase/…, which will mislead readers and copy-pasted commands.

-      1. If all goes well, there should be a new file named `supbase/migration/2..._some_meaningful_migration_name.sql` which you should `git add`.
+      1. If all goes well, there should be a new file named `supabase/migrations/2..._some_meaningful_migration_name.sql` which you should `git add`.
🧹 Nitpick comments (6)
packages/database/scripts/build.ts (1)

9-9: Consider improving the conditional logic.

The additional constraint correctly restricts Supabase command execution to local development, but consider these improvements:

  1. Use strict equality (===) instead of loose equality (==) for string comparison
  2. Consider using a constant or environment variable for the local Supabase URL to avoid hardcoding
-if (process.env.HOME !== "/vercel" && process.env.SUPABASE_URL == 'http://127.0.0.1:54321') {
+const LOCAL_SUPABASE_URL = 'http://127.0.0.1:54321';
+if (process.env.HOME !== "/vercel" && process.env.SUPABASE_URL === LOCAL_SUPABASE_URL) {
apps/obsidian/.env.example (1)

3-7: Double-check the default ports & URL scheme

SUPABASE_URL and POSTGRES_URL point to 127.0.0.1:54321 and 127.0.0.1:54322 respectively.
That matches the Supabase-CLI defaults, but developers who use the Docker images directly (port 5432) or a remote URL will have to edit both variables. Consider adding a short comment to avoid confusion.

-SUPABASE_URL=http://127.0.0.1:54321
-POSTGRES_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres
+# Local Supabase-CLI defaults; adjust if you mapped different ports / use https
+SUPABASE_URL=http://127.0.0.1:54321
+POSTGRES_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres
apps/roam/.env.example (1)

1-7: Mention that secrets must stay commented-out

Because Roam extension users often commit their whole workspace, explicitly remind them not to commit real SUPABASE_JWT_SECRET, SUPABASE_ANON_KEY, etc. Adding a single-line comment right above the secret placeholders will help.

 # SUPABASE_WORKDIR=/full/path/to/packages/database
+# ⚠️ Never commit the real keys below – keep them in a private *.env file
 # SUPABASE_JWT_SECRET=<'JWT secret' value from supabase start>
 # SUPABASE_ANON_KEY=<'anon key' value from supabase start>
README.md (1)

63-76: Fix broken Markdown & stray back-ticks

There are a couple of minor formatting issues that break rendered links and code blocks:

  1. Unclosed back-tick after Project Settings (l.​69).
  2. Missing closing back-tick in the API-keys link (l.​75).
  3. List indentation is off → MD005 warnings.
-         1. `SUPABASE_URL` from the `Project URL` in the [Data api tab](http://localhost:54323/settings/api) of `Project Settings`
-         2. `SUPABASE_ANON_KEY` from the `anon`, `public` API key in the [API Keys tab](http://localhost:54324/settings/api-keys) of `Project Settings.
+         1. `SUPABASE_URL` from the `Project URL` in the [Data API tab](http://localhost:54323/settings/api) of **Project Settings**
+         2. `SUPABASE_ANON_KEY` from the `anon` (public) API key in the [API Keys tab](http://localhost:54324/settings/api-keys) of **Project Settings**

Also consider reducing nested list indentation to 2 spaces to silence markdown-lint.

packages/database/README.md (2)

10-21: Tighten wording & avoid repetitive sentence starts

Three consecutive sentences start with “It”. This triggers the ENGLISH_WORD_REPEAT lint rule and slightly hurts readability. Merging them also shortens the paragraph:

-      It is obviously safer to use the local instance, but there may be discrepancies of behaviour, and you may need to talk to the production instance.
-      It may be a good strategy to setup both a `.env.localdb` and `.env.productiondb` and copy (or link) either to `.env` as appropriate.
+      The local instance is safer, but behaviour can differ from production. A practical approach is to keep **both** `.env.localdb` and `.env.productiondb`, and symlink the one you currently need to `.env`.

23-25: Grammar: “End your work session”

Minor grammar fix.

-   3. End you work session with `supabase end` to free docker resources.
+   3. End **your** work session with `supabase end` to free Docker resources.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eeb59df and 9143611.

📒 Files selected for processing (10)
  • .gitignore (1 hunks)
  • README.md (2 hunks)
  • apps/obsidian/.env.example (1 hunks)
  • apps/obsidian/.env.productiondb.example (1 hunks)
  • apps/roam/.env.example (1 hunks)
  • apps/roam/.env.productiondb.example (1 hunks)
  • apps/website/.env.example (1 hunks)
  • apps/website/.env.productiondb.example (1 hunks)
  • packages/database/README.md (2 hunks)
  • packages/database/scripts/build.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250504202930_content_tables.sql:37-45
Timestamp: 2025-05-20T03:11:07.917Z
Learning: When reviewing SQL migrations in the discourse-graph codebase, understand that historical migration files should not be modified once they're applied. Instead, issues should be fixed in subsequent migrations or schema definition files. This is why maparent indicated "migration, not changing. corrected in schema."
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/schemas/account.sql:0-0
Timestamp: 2025-06-09T16:55:48.941Z
Learning: Security work including RLS policies and permission restrictions is currently postponed in the discourse-graph project as communicated by maparent.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
packages/database/scripts/build.ts (10)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/scripts/deploy.ts:0-0
Timestamp: 2025-05-22T23:48:45.450Z
Learning: The database deployment script in packages/database/scripts/deploy.ts requires that the branch is 'main' and pristine (no uncommitted or unpushed changes) before allowing deployment to proceed.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#189
File: packages/database/types.gen.ts:336-371
Timestamp: 2025-06-04T11:54:37.239Z
Learning: The team prefers not to manually edit generated files (like Supabase TypeScript types) even when they contain inaccuracies, as manual changes would be overwritten during regeneration. They treat generated files as read-only artifacts.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/config.toml:0-0
Timestamp: 2025-05-20T15:51:22.084Z
Learning: Wildcard patterns in additional_redirect_urls within Supabase configuration are acceptable in this codebase when needed for Vercel branch deployments, despite the small security risk they introduce.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/schemas/extensions.sql:1-11
Timestamp: 2025-05-20T03:02:36.027Z
Learning: The necessary schemas for Supabase extensions (like 'extensions', 'graphql', and 'vault') are automatically created by Supabase before extensions are installed, so they don't need to be explicitly created in SQL migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250504195841_remote_schema.sql:1-7
Timestamp: 2025-05-20T03:01:11.220Z
Learning: Supabase automatically creates necessary schemas like the "extensions" schema before migrations run, so there's no need to explicitly create these schemas in migration files.
apps/obsidian/.env.productiondb.example (7)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#189
File: packages/database/supabase/migrations/20250603144146_account_centric.sql:123-136
Timestamp: 2025-06-04T11:41:08.589Z
Learning: Currently, there are no Obsidian spaces in the database - all existing spaces are Roam spaces. This means database migrations targeting space platform assignments only need to handle Roam for now.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/schemas/extensions.sql:1-11
Timestamp: 2025-05-20T03:02:36.027Z
Learning: The necessary schemas for Supabase extensions (like 'extensions', 'graphql', and 'vault') are automatically created by Supabase before extensions are installed, so they don't need to be explicitly created in SQL migration files.
apps/roam/.env.productiondb.example (8)
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-06-30T18:58:53.332Z
Learning: Applies to apps/roam/**/* : Use Roam Depot/Extension API documentation from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-06-30T18:58:53.332Z
Learning: Applies to apps/roam/**/* : Use the roamAlphaApi documentation from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#189
File: packages/database/supabase/migrations/20250603144146_account_centric.sql:123-136
Timestamp: 2025-06-04T11:41:08.589Z
Learning: Currently, there are no Obsidian spaces in the database - all existing spaces are Roam spaces. This means database migrations targeting space platform assignments only need to handle Roam for now.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
.gitignore (1)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
apps/website/.env.productiondb.example (6)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/config.toml:0-0
Timestamp: 2025-05-20T15:51:22.084Z
Learning: Wildcard patterns in additional_redirect_urls within Supabase configuration are acceptable in this codebase when needed for Vercel branch deployments, despite the small security risk they introduce.
apps/obsidian/.env.example (6)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/obsidian.mdc:0-0
Timestamp: 2025-06-30T18:58:43.737Z
Learning: Applies to apps/obsidian/Attachments/icons/*.svg : Store icons used in the Obsidian plugin in the Attachments/icons folder
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/schemas/extensions.sql:1-11
Timestamp: 2025-05-20T03:02:36.027Z
Learning: The necessary schemas for Supabase extensions (like 'extensions', 'graphql', and 'vault') are automatically created by Supabase before extensions are installed, so they don't need to be explicitly created in SQL migration files.
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/obsidian.mdc:0-0
Timestamp: 2025-06-30T18:58:43.737Z
Learning: Applies to apps/obsidian/Attachments/icons/*.svg : Use the SVG version of icons for the Obsidian plugin
apps/website/.env.example (6)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/config.toml:0-0
Timestamp: 2025-05-20T15:51:22.084Z
Learning: Wildcard patterns in additional_redirect_urls within Supabase configuration are acceptable in this codebase when needed for Vercel branch deployments, despite the small security risk they introduce.
apps/roam/.env.example (5)
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-06-30T18:58:53.332Z
Learning: Applies to apps/roam/**/* : Use Roam Depot/Extension API documentation from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-06-30T18:58:53.332Z
Learning: Applies to apps/roam/**/* : Use the roamAlphaApi documentation from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
packages/database/README.md (10)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/scripts/deploy.ts:0-0
Timestamp: 2025-05-22T23:48:45.450Z
Learning: The database deployment script in packages/database/scripts/deploy.ts requires that the branch is 'main' and pristine (no uncommitted or unpushed changes) before allowing deployment to proceed.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/schemas/extensions.sql:1-11
Timestamp: 2025-05-20T03:02:36.027Z
Learning: The necessary schemas for Supabase extensions (like 'extensions', 'graphql', and 'vault') are automatically created by Supabase before extensions are installed, so they don't need to be explicitly created in SQL migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250504195841_remote_schema.sql:1-7
Timestamp: 2025-05-20T03:01:11.220Z
Learning: Supabase automatically creates necessary schemas like the "extensions" schema before migrations run, so there's no need to explicitly create these schemas in migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/scripts/lint.ts:6-9
Timestamp: 2025-05-22T23:39:56.973Z
Learning: In the discourse-graph project, scripts should fail gracefully (exit with code 0) when optional tools like sqruff are not found, especially to avoid breaking CI pipelines. Installation instructions for such tools are documented in the README rather than duplicated in error messages.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#189
File: packages/database/types.gen.ts:336-371
Timestamp: 2025-06-04T11:54:37.239Z
Learning: The team prefers not to manually edit generated files (like Supabase TypeScript types) even when they contain inaccuracies, as manual changes would be overwritten during regeneration. They treat generated files as read-only artifacts.
README.md (18)
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/migrations/20250605083319_alpha_upload.sql:157-337
Timestamp: 2025-06-09T16:57:14.681Z
Learning: Migration files in packages/database/supabase/migrations/ are historical snapshots that preserve database schema and functions as they existed at the time of creation. These files should not be updated to reflect current schema changes, even if they reference tables or columns that have since been modified or removed. Schema incompatibilities in migration files are expected and acceptable as they represent the valid state at the time of migration.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#182
File: apps/website/app/utils/supabase/dbUtils.ts:22-28
Timestamp: 2025-05-30T14:49:24.016Z
Learning: In apps/website/app/utils/supabase/dbUtils.ts, expanding the KNOWN_EMBEDDINGS and DEFAULT_DIMENSIONS mappings to support additional embedding models requires corresponding database model changes (creating new embedding tables), which should be scoped as separate work from API route implementations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250512142307_sync_table.sql:20-21
Timestamp: 2025-05-20T03:04:21.602Z
Learning: Database migration files (like the SQL files in packages/database/supabase/migrations/) should not be modified after they're created, even to fix minor issues like unused variables. Issues should be addressed in newer schema files instead to maintain migration history integrity.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250513173724_content_concept_key.sql:37-60
Timestamp: 2025-05-22T23:50:23.771Z
Learning: For the discourse-graph project, database schema management focuses on the final state in the supabase/schemas directory, not on the individual migration files. When reviewing database changes, consider only the schema definitions in this directory, not potential duplications or conflicts across migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/scripts/deploy.ts:0-0
Timestamp: 2025-05-22T23:48:45.450Z
Learning: The database deployment script in packages/database/scripts/deploy.ts requires that the branch is 'main' and pristine (no uncommitted or unpushed changes) before allowing deployment to proceed.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/schemas/extensions.sql:1-11
Timestamp: 2025-05-20T03:02:36.027Z
Learning: The necessary schemas for Supabase extensions (like 'extensions', 'graphql', and 'vault') are automatically created by Supabase before extensions are installed, so they don't need to be explicitly created in SQL migration files.
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/api.mdc:0-0
Timestamp: 2025-06-30T18:58:19.625Z
Learning: You are working on the api routes for Discourse Graph which uses NextJS app router.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/scripts/lint.ts:6-9
Timestamp: 2025-05-22T23:39:56.973Z
Learning: In the discourse-graph project, scripts should fail gracefully (exit with code 0) when optional tools like sqruff are not found, especially to avoid breaking CI pipelines. Installation instructions for such tools are documented in the README rather than duplicated in error messages.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250504195841_remote_schema.sql:1-7
Timestamp: 2025-05-20T03:01:11.220Z
Learning: Supabase automatically creates necessary schemas like the "extensions" schema before migrations run, so there's no need to explicitly create these schemas in migration files.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#189
File: packages/database/supabase/migrations/20250603144146_account_centric.sql:50-63
Timestamp: 2025-06-04T11:41:34.951Z
Learning: In the discourse-graph database, all accounts currently stored are Roam platform accounts, making platform-specific migration logic safe for global operations.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/migrations/20250504202930_content_tables.sql:37-45
Timestamp: 2025-05-20T03:11:07.917Z
Learning: When reviewing SQL migrations in the discourse-graph codebase, understand that historical migration files should not be modified once they're applied. Instead, issues should be fixed in subsequent migrations or schema definition files. This is why maparent indicated "migration, not changing. corrected in schema."
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/supabase/config.toml:0-0
Timestamp: 2025-05-20T15:51:22.084Z
Learning: Wildcard patterns in additional_redirect_urls within Supabase configuration are acceptable in this codebase when needed for Vercel branch deployments, despite the small security risk they introduce.
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#198
File: packages/database/supabase/schemas/account.sql:0-0
Timestamp: 2025-06-09T16:55:48.941Z
Learning: Security work including RLS policies and permission restrictions is currently postponed in the discourse-graph project as communicated by maparent.
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/main.mdc:0-0
Timestamp: 2025-06-30T18:58:32.645Z
Learning: Applies to {apps/website,packages/ui}/**/*.tsx : Maintain visual consistency with the host application's design system
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-06-30T18:58:53.332Z
Learning: Applies to apps/roam/**/* : Use Roam Depot/Extension API documentation from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/roam.mdc:0-0
Timestamp: 2025-06-30T18:58:53.332Z
Learning: Applies to apps/roam/**/* : Use the roamAlphaApi documentation from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#220
File: apps/roam/src/utils/conceptConversion.ts:11-40
Timestamp: 2025-06-23T11:49:45.457Z
Learning: In the DiscourseGraphs/discourse-graph codebase, direct access to `window.roamAlphaAPI` is the established pattern throughout the codebase. The team prefers to maintain this pattern consistently rather than making piecemeal changes, and plans to address dependency injection as a global refactor when scheduled.
🪛 Gitleaks (8.26.0)
apps/obsidian/.env.productiondb.example

6-6: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


7-7: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.

(jwt)

apps/roam/.env.productiondb.example

6-6: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


7-7: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.

(jwt)

apps/website/.env.productiondb.example

3-3: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


8-8: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


9-9: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.

(jwt)

🪛 LanguageTool
packages/database/README.md

[style] ~10-~10: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... talk to the production instance. It may be a good strategy to setup both a ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[uncategorized] ~25-~25: “you” seems less likely than “your” (belonging to you).
Context: ...l is given by supabase start. 3. End you work session with supabase end to fre...

(AI_HYDRA_LEO_CP_YOU_YOUR)


[grammar] ~25-~25: There is an agreement error between ‘work’ and ‘session’. Insert ‘a(n)’ or change the noun to plural.
Context: ... given by supabase start. 3. End you work session with supabase end to free docker reso...

(PRP_VB_NN)


[style] ~49-~49: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...r in the studio, or psql. 3. If that fails, you can reset your local da...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

README.md

[uncategorized] ~68-~68: “of” seems less likely than “or” (‘either … or’).
Context: ...b](http://localhost:54323/settings/api) of Project Settings 2. `SUPABAS...

(AI_HYDRA_LEO_CP_OF_OR)

🪛 markdownlint-cli2 (0.17.2)
packages/database/README.md

13-13: Inconsistent indentation for list items at the same level
Expected: 6; Actual: 8

(MD005, list-indent)


14-14: Inconsistent indentation for list items at the same level
Expected: 6; Actual: 8

(MD005, list-indent)


16-16: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


21-21: Inconsistent indentation for list items at the same level
Expected: 6; Actual: 8

(MD005, list-indent)


52-52: Inconsistent indentation for list items at the same level
Expected: 3; Actual: 4

(MD005, list-indent)

🔇 Additional comments (5)
apps/obsidian/.env.productiondb.example (1)

1-8: Well-structured production environment template.

The file provides a comprehensive template for production Supabase configuration. The static analysis warnings about JWT and API keys are false positives since these are example values for template purposes.

.gitignore (1)

10-15: Improved specificity in gitignore patterns.

The updated patterns are more precise and align well with the new environment file structure. The inclusion of shell variants (.env.*sh, .env.localdb.*sh, .env.productiondb.*sh) is thoughtful and provides comprehensive coverage.

apps/website/.env.productiondb.example (1)

1-11: Comprehensive production environment template with good security practices.

The file provides a thorough template for production configuration. The reference to 1password for the service role key (line 10) demonstrates good security practices by not exposing actual secrets in example files.

apps/roam/.env.productiondb.example (1)

1-8: Consistent production environment template structure.

The file maintains consistency with other app environment templates and provides the necessary Supabase configuration variables. The commented-out BLOB_READ_WRITE_TOKEN suggests thoughtful consideration of app-specific requirements.

apps/website/.env.example (1)

4-10: Align variable names with runtime code

SUPABASE_PROJECT_ID is included here, but most frontend code only consumes SUPABASE_URL / SUPABASE_ANON_KEY. Make sure SUPABASE_PROJECT_ID is actually referenced in the Website app; otherwise remove it to prevent cargo-cult copy-paste of unused variables.

@maparent maparent requested a review from mdroidian July 7, 2025 15:52
@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch from 1d7512e to 5378661 Compare July 7, 2025 17:23
@maparent maparent requested a review from mdroidian July 7, 2025 17:52
@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch from 7dbdf0c to a505b0e Compare July 10, 2025 18:21
@maparent
Copy link
Collaborator Author

added some clarifications as discussed.

@maparent maparent requested a review from mdroidian July 11, 2025 20:16
@maparent
Copy link
Collaborator Author

We discussed it, but in case someone comes and read: .env.production.example is not accessed in the code. It is the responsibility of the developer to overwrite .env with a variant derived either from .env.production.example or .env.example

@maparent
Copy link
Collaborator Author

A new argument for leaving UI access to devs: The security advisory in the local supabase studio is less extensive than the one in the supabase studio for the database branch. (Significantly, it will not warn about tables that miss RLS.)

@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch 4 times, most recently from 4cfa314 to 9251377 Compare July 14, 2025 15:22
@maparent
Copy link
Collaborator Author

Added examples for a local .env, and code to use it. Clarified instructions. Simplified testing instructions.

@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch from 9251377 to 98794d8 Compare July 20, 2025 16:48
@maparent maparent force-pushed the ENG-520-supabase-dev-instructions branch from 98794d8 to 65098f4 Compare July 21, 2025 14:30
@maparent maparent removed the request for review from mdroidian July 22, 2025 01:52
@maparent
Copy link
Collaborator Author

Do not review now, this is being rewritten.

@maparent
Copy link
Collaborator Author

All this is now deprecated by the new PR #301 . It is cleaner and has a shorter history. Keeping this open for now so we can reference the comments.

@maparent maparent marked this pull request as draft July 22, 2025 13:15
@maparent
Copy link
Collaborator Author

Closing this, everything of value is in #301

@maparent maparent closed this Jul 26, 2025
@github-project-automation github-project-automation bot moved this to Done in General Jul 26, 2025
@maparent maparent deleted the ENG-520-supabase-dev-instructions branch July 26, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants