Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikgraf/automerge-jumpstart
A boilerplate for building real-time collaborative editing applications with Automerge, React, tRPC, and more.
https://github.com/nikgraf/automerge-jumpstart
automerge boilerplate boilerplate-application crdt
Last synced: about 1 month ago
JSON representation
A boilerplate for building real-time collaborative editing applications with Automerge, React, tRPC, and more.
- Host: GitHub
- URL: https://github.com/nikgraf/automerge-jumpstart
- Owner: nikgraf
- License: agpl-3.0
- Created: 2024-04-29T16:20:17.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-16T13:25:07.000Z (7 months ago)
- Last Synced: 2025-01-03T13:52:38.914Z (about 1 month ago)
- Topics: automerge, boilerplate, boilerplate-application, crdt
- Language: TypeScript
- Homepage: https://www.automerge-jumpstart.com/
- Size: 107 KB
- Stars: 36
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Automerge Jumpstart
A comprehensive boilerplate for building real-time
collaborative editing applications with Automerge, React,
tRPC, and more.Website incl. explanation videos: [https://www.automerge-jumpstart.com/](https://www.automerge-jumpstart.com/)
## Development
### Setup
```sh
pnpm install
docker-compose up
``````sh
# in another tab
cd apps/backend
cp .env.example .env
npx @serenity-kit/opaque@latest create-server-setup
# copy the string value as OPAQUE_SERVER_SETUP .env
pnpm prisma migrate dev
pnpm prisma generate
pnpm dev
``````sh
# in another tab
cd apps/frontend
pnpm dev
```### Updating the Database Schema
1. Make changes
2. Run `pnpm prisma migrate dev`
3. Run `pnpm prisma generate`
4. Restart the TS server in your editor### DB UI
```bash
cd apps/backend
pnpm prisma studio
```### Wipe all local data
```bash
cd apps/backend
pnpm prisma migrate reset
```## Setup Production Environment and CI
see [docs/setup-production-environment-and-ci.md](docs/setup-production-environment-and-ci.md)
## Connect to the Production Database
```sh
fly postgres connect -a automerge-jumpstart-db
``````sh
# list dbs
\list;
# connect to a db
\c automerge_jumpstart;
# list tables
\dt
# query a table
SELECT * FROM "Document";
```## Upgrading Dependencies
Note: Automerge version is pinned in the root `package.json` file to avoid issues arising from different automerge versions.
```sh
pnpm up --interactive
cd apps/app
pnpm up --interactive
cd apps/server
pnpm up --interactive
```## Architecture
### Authentication
Users use OPAQUE to authenticate with the server. After Login the server creates a session in the database which includes Opaque's `sessionKey`. The `sessionKey` is used as `bearer` token to authenticate the user for authenticated requests and also to connect to the Websocket.