Skip to content
Closed
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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Learn more about how monorepos improve development workflows [here](https://verc
- [typescript-config](https://github.com/DiscourseGraphs/discourse-graph/tree/main/packages/typescript-config): Shared tsconfig.jsons
- [eslint-config](https://github.com/DiscourseGraphs/discourse-graph/tree/main/packages/eslint-config): ESLint preset
- [ui](https://github.com/DiscourseGraphs/discourse-graph/tree/main/packages/ui): Core React components
- [database](https://github.com/DiscourseGraphs/discourse-graph/tree/main/packages/database): Database configuration

### Getting Started

Expand Down Expand Up @@ -59,6 +60,21 @@ You can use the `--filter` flag to run a single application, eg:
turbo dev --filter roam
```

4. Set up a supabase environment. This will cache and optimize some semantic queries. You may not need both environments, but you cannot develop unless `SUPABASE_URL` and `SUPABASE_ANON_KEY` are defined.
1. For local development:
1. Follow the local development setup steps [here](https://github.com/DiscourseGraphs/discourse-graph/tree/main/packages/database/README.md)
2. Start the local environment with `turbo dev`, and navigate to the (studio)[http://localhost:54323].
3. create a `.env.local` environment file, and set:
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.
2. To use your production database:
1. Create an account and project on [Supabase](https://supabase.com). (Free tiers available.) There you will get a <project_id>.
2. Navigate to your project studio. (URL should look like `https://supabase.com/dashboard/project/<project_id>`)
3. Set up a `.env.production` file
1. `SUPABASE_URL` from the `Project URL` in the `Data api` tab of `Project Settings`. URL should look like `https://supabase.com/dashboard/project/<project_id>/settings/api`
2. `SUPABASE_ANON_KEY` from the `anon`, `public` API key in the `API Keys` tab of `Project Settings`. URL should look like `https://supabase.com/dashboard/project/<project_id>/settings/api-keys`
3. To use a database branch on supabase (on the paid tier): Instructions (here)[https://supabase.com/docs/guides/deployment/branching]

#### Roam

- go to your graph, open up settings, and go to the extensions tab
Expand Down
5 changes: 3 additions & 2 deletions packages/database/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
This contains the database schema for vector embeddings and concepts.
All CLI commands below should be run in this directory (`packages/database`.)

1. Setup
1. Local development setup
1. Install [Docker](https://www.docker.com)
2. Install the [supabase CLI](https://supabase.com/docs/guides/local-development). (There is a brew version)
3. `supabase login` with your (account-specific) supabase access token. (TODO: Create a group access token.)
4. `supabase link`. It will ask you for a project name, use `discourse-graphs`. (Production for now.) It will also ask you for the database password (See 1password.)
4. If you have a supabase instance, connect to it with `supabase link`. It will ask you for its project name and password.
1. Team development: use `discourse-graphs`. (Production for now.) It will also ask you for the database password (See 1password.)
5. Install [sqruff](https://github.com/quarylabs/sqruff)
2. Usage:
1. Use `turbo dev`, (alias for `supabase start`) before you use your local database. URLs will be given for your local supabase database, api endpoint, etc.
Expand Down