MCPcopy Index your code
hub / github.com/clientdb/clientdb

github.com/clientdb/clientdb @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
319 symbols 686 edges 86 files 7 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ClientDB

ClientDB is an open-source in-memory database for enabling real-time web apps. Build fast, scalable apps that feel silky smooth for users.

Installation

Install clientdb with yarn

  yarn add @clientdb/core

Core parts of clientdb

Clientdb is a suite of components that enable real-time web apps. Most of them can be used independently, but they're used together to cover all the aspects of building real-time applications.

@clientdb/core

In-memory database for storing, modifying, and querying data. By itself, it is not synchronized with any server and it is not persisting any data offline.

@clientdb/sync

Work in progress (https://github.com/acapela/clientdb/pull/10)

Sync engine consists of 2 parts:

Server - HTTP server with a socket that can connect to any database and can keep the in-memory database in sync with the server according to defined access permissions.

Client - Wrapper on top of an in-memory database that connects to sync-server and can keep the in-memory database in sync with the server.

Read more about sync engine - engine/README.md

@clientdb/codegen (Work in progress)

Set of dev-toolings for generating TypeScript types and synced client database with all relations, validations, etc. included.


Tech Stack

The entire codebase is fully written in Typescript.

Build Locally

Clone the project

  git clone git@github.com:acapela/clientdb.git

Install dependencies

  yarn install

Build the client-side db

  yarn core build

Running Tests

To run tests, run the following command while in /core directory

  yarn test

Used By

This project is used by the following companies:

License

Apache-2.0

Extension points exported contracts — how you extend this code

EntityClient (Interface)
(no doc)
core/client.ts
ClientDbUtils (Interface)
(no doc)
core/db.ts
DbContextInstance (Interface)
(no doc)
core/context.ts
EntityCreatedEvent (Interface)
(no doc)
core/events.ts
CreateEntityInput (Interface)
(no doc)
core/entity.ts
EntityStorePublicMethods (Interface)
(no doc)
core/store.ts
EntityConfig (Interface)
(no doc)
core/definition.ts
QueryIndex (Interface)
(no doc)
core/queryIndex.ts

Core symbols most depended-on inside this repo

create
called by 60
core/client.ts
update
called by 23
core/queryIndex.ts
remove
called by 21
core/queryIndex.ts
cachedComputedWithoutArgs
called by 16
core/utils/cachedComputedWithoutArgs.ts
runTransaction
called by 12
core/transaction.ts
add
called by 11
core/store.ts
find
called by 10
core/queryIndex.ts
findById
called by 8
core/store.ts

Shape

Function 258
Interface 39
Method 20
Class 2

Languages

TypeScript100%

Modules by API surface

core/store.ts26 symbols
core/transaction.ts18 symbols
core/queryIndex.ts17 symbols
engine/introspection/pg/index.ts14 symbols
core/client.ts14 symbols
core/definition.ts13 symbols
engine/generate/all.ts12 symbols
core/query.ts12 symbols
core/entity.ts11 symbols
core/utils/deepMap.ts9 symbols
core/db.ts9 symbols
core/utils/eventManager.ts7 symbols

For agents

$ claude mcp add clientdb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact