Skip to content

Commit

Permalink
Merge branch 'tauri-example-postgres' of tb-github:electric-sql/elect…
Browse files Browse the repository at this point in the history
…ric into tauri-example-postgres
  • Loading branch information
tachyonicbytes committed Feb 1, 2024
2 parents 6f24ab7 + 11a43d2 commit 4e3cd26
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions examples/tauri-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ The demo app itself is a variation of [Electric's LinearLite example](https://el

For more information, see the blog post write up here: [Local AI with Postgres, pgvector and llama2, inside a Tauri app with ElectricSQL](https://electric-sql.com/blog/2024/01/25/local-first-ai-with-tauri-postgres-pgvector-llama).

## Prereqs
## Build and run the App

### Prerequisites

You need Docker, Docker Compose v2, Nodejs >= 16.14 and pnpm.

## Install
### Checkout and setup the Tauri project

Clone this repo and change directory into this folder:

Expand Down Expand Up @@ -53,7 +55,7 @@ Install the dependencies:
pnpm install
```

## Additional dependencies
### Additional dependencies

The example supports compilation for macOS and Linux. We provide shell scripts to setup the third party libraries and software that the app needs, according to your platform:

Expand All @@ -70,9 +72,9 @@ bash install-linux.sh

This will take up a few hundreds megabytes of space, during the installation, because the macOS postgres and the linux ollama download is large.

## Backend
### Run the backend

Start Postgres and Electric as normal using Docker (see [running the examples](https://electric-sql.com/docs/examples/notes/running) for more options):
Start Postgres and Electric using Docker (see [running the examples](https://electric-sql.com/docs/examples/notes/running) for more options):

```shell
pnpm run backend:up
Expand All @@ -92,15 +94,15 @@ You can apply it with:
pnpm run db:migrate
```

## Client
### Generate the client

Generate your [type-safe client](https://electric-sql.com/docs/usage/data-access/client):

```shell
pnpm run client:generate
```

## Run
### Run the app

The app is a Tauri application. To run it:

Expand All @@ -113,3 +115,13 @@ and to build a distributable package:
```bash
pnpm tauri build
```

### Run the app with the public backend

We also have a hosted Postgres and Electric sync service that you can connect the app to, this is pre-loaded with issues and vector embeddings.

```bash
ELECTRIC_URL='ws://backend.tauri-demo.electric-sql.com' pnpm tauri dev
```

*(Note that you will have had to have generated the client above first.)*

0 comments on commit 4e3cd26

Please sign in to comment.