The native core of BarqDB — a local-first database with real-time sync. It holds the storage engine, object store, query system, C API, and sync foundation shared by every Barq SDK.
Barq Core is a building block, not an end-user product — it has no publicly stable API. To build an app, use one of the SDKs, which embed this core:
| SDK | Platform |
|---|---|
| barq-js | JavaScript, React Native |
| barq-kotlin | Kotlin Multiplatform — Android, iOS, JVM |
| barq-swift | Swift, Objective-C |
| barq-native | C++ |
| Path | Contents |
|---|---|
src/barq |
storage engine, query engine, object store, sync client, C API, tools |
src/barq/sync/noinst/server |
sync server library and optional server executable |
src/external |
vendored third-party code |
test |
storage, sync, object-store, and C API tests |
Barq Core builds with CMake and C++17.
cmake -S . -B build
cmake --build buildBuild the optional server executable:
cmake -S . -B build -DBARQ_BUILD_SERVER=ON
cmake --build build --target BarqSyncServerRun it with a data directory and the public key it uses to verify client JWTs (the binary is under build/src/barq/sync/noinst/server/; debug builds append -dbg):
barq-server \
--root-dir ./barq-sync-data \
--jwt-public-key ./public.pem \
--host 127.0.0.1 --port 9090Add --tls-cert and --tls-key for TLS. --allow-unsigned-tokens skips signature checks for local testing only — production clients should send signed JWTs, and token signing belongs in your auth service, not in this library.
Point a client at the server through its configurable route:
barq_sync_manager_set_route(manager, "wss://your-server/barq-sync", true);
barq_sync_config_t* config = barq_sync_config_new(user, "partition");cmake --build build --target SyncTests
cmake --build build --target ObjectStoreTestsThe test binaries (barq-sync-tests, barq-object-store-tests) are written under build/test/.
Barq Core is a modified fork of Realm Core, licensed under the Apache License 2.0. The original Realm Inc. copyright headers are retained in every file they came from; see the Git history for what changed. Third-party notices are listed in THIRD-PARTY-NOTICES.
Barq is an independent project. It is not affiliated with, sponsored by, or endorsed by Realm, MongoDB, Inc., or MongoDB Atlas. "Realm", "MongoDB", and "MongoDB Atlas" are trademarks of MongoDB, Inc.