{"id":46755,"library":"vex-core","title":"Vex Core","description":"Local-first reactive backend engine with plugin architecture, SQLite storage, and real-time subscriptions via SSE. v0.7.2 (stable). Requires Bun 1.3+ or Node 24+ due to URLPattern dependency. Ship TypeScript types. Differentiates from similar tools (Convex, Firebase) by being self-hosted, fully local-first with SQLite, and providing a composable HTTP toolkit (vex-core/http) inspired by Vert.x Web and Koa. Peer dependency on React ^19 only for client-side usage. Plugin system allows file-based conventions via scanDirectory, defining tables, mutations, queries, webhooks, jobs, and middleware. Query builder supports filtering, aggregation, grouping, and pagination pushed down to SQL.","status":"active","version":"0.7.2","language":"javascript","source_language":"en","source_url":"https://github.com/Michaelliv/vex-core","tags":["javascript","database","reactive","sqlite","local-first","convex","plugin","backend","typescript"],"install":[{"cmd":"npm install vex-core","lang":"bash","label":"npm"},{"cmd":"yarn add vex-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add vex-core","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for vex-core/client (optional)","package":"react","optional":true}],"imports":[{"note":"ESM-only; no CommonJS support. Requires Node >=20 or Bun.","wrong":"const Vex = require('vex-core')","symbol":"Vex","correct":"import { Vex } from 'vex-core'"},{"note":"Exported from main entry, not a subpath.","wrong":"import { sqliteAdapter } from 'vex-core/sqlite'","symbol":"sqliteAdapter","correct":"import { sqliteAdapter } from 'vex-core'"},{"note":"Framework utilities are in 'vex-core/framework' subpath.","wrong":"import { table } from 'vex-core'","symbol":"table","correct":"import { table } from 'vex-core/framework'"},{"note":"HTTP toolkit is in 'vex-core/http' subpath.","wrong":"import { createRouter } from 'vex-core'","symbol":"createRouter","correct":"import { createRouter } from 'vex-core/http'"},{"note":"Connects router to Vex instance; only from 'vex-core/http'.","symbol":"vexHandler","correct":"import { vexHandler } from 'vex-core/http'"},{"note":"File-based plugin loader is in 'vex-core/framework'.","wrong":"import { scanDirectory } from 'vex-core'","symbol":"scanDirectory","correct":"import { scanDirectory } from 'vex-core/framework'"}],"quickstart":{"code":"import { Vex, sqliteAdapter } from 'vex-core';\n\nconst vex = await Vex.create({\n  storage: sqliteAdapter('.vex/data.db'),\n  plugins: [\n    (api) => {\n      api.setName('counter');\n      api.registerTable('counters', {\n        columns: { key: { type: 'string' }, value: { type: 'number' } },\n      });\n      api.registerMutation('set', {\n        args: { key: 'string', value: 'number' },\n        async handler(ctx, args) {\n          return ctx.db.table('counters').insert(args);\n        },\n      });\n      api.registerQuery('list', {\n        args: {},\n        async handler(ctx) {\n          return ctx.db.table('counters').all();\n        },\n      });\n    },\n  ],\n});\n\nawait vex.mutate('counter.set', { key: 'hits', value: 1 });\nawait vex.query('counter.list');\n\nconst unsub = await vex.subscribe('counter.list', {}, (rows) => {\n  console.log('changed:', rows);\n});\nunsub();","lang":"typescript","description":"Initializes Vex with SQLite storage, a plugin defining a counter table, mutation, and query, then demonstrates mutate, query, and subscribe."},"warnings":[{"fix":"Use Node 24+ or Bun 1.3+, or polyfill URLPattern with 'urlpattern-polyfill'.","message":"Requires Node >=24 or Bun >=1.3 due to URLPattern global (used in vex-core/http).","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Ensure project uses ESM (type: module in package.json) or import syntax in Node.","message":"ESM-only package; no CommonJS compatibility.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Do not install React unless using client features.","message":"React peer dependency is only for vex-core/client; other modules don't require it.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Provide absolute or valid relative path to sqliteAdapter.","message":"SQLite adapter writes to disk; ensure directory is writable.","severity":"gotcha","affected_versions":">=0.7.0"},{"fix":"Call the returned function on component unmount or when subscription is no longer needed.","message":"subscribe() returns an unsubscribe function; not calling it may leak subscriptions.","severity":"gotcha","affected_versions":">=0.7.0"},{"fix":"Use import { table } from 'vex-core/framework'.","message":"Framework utilities (table, query, mutation) must be imported from 'vex-core/framework', not 'vex-core'.","severity":"gotcha","affected_versions":">=0.7.0"}],"env_vars":null,"search_vec":"'/http':62 '1.3':25 '19':73 '24':28 'aggreg':101 'allow':82 'architectur':11 'backend':7,118 'base':85 'builder':98 'bun':24 'client':77 'client-sid':76 'compos':56 'convent':86 'convex':40,116 'core':2,61 'databas':110 'defin':89 'depend':32,70 'differenti':36 'due':29 'engin':8 'file':84 'file-bas':83 'filter':100 'firebas':41 'first':5,50,115 'fulli':47 'group':102 'host':46 'http':57 'inspir':63 'javascript':109 'job':94 'koa':68 'local':4,49,114 'local-first':3,48,113 'middlewar':96 'mutat':91 'node':27 'pagin':104 'peer':69 'plugin':10,80,117 'provid':54 'push':105 'queri':92,97 'react':72 'reactiv':6,111 'real':16 'real-tim':15 'requir':23 'scandirectori':88 'self':45 'self-host':44 'ship':33 'side':78 'similar':38 'sql':108 'sqlite':12,52,112 'sse':20 'stabl':22 'storag':13 'subscript':18 'support':99 'system':81 'tabl':90 'time':17 'tool':39 'toolkit':58 'type':35 'typescript':34,119 'urlpattern':31 'usag':79 'v0.7.2':21 'vert.x':65 'vex':1,60 'vex-cor':59 'via':19,87 'web':66 'webhook':93","created_at":"2026-06-07T13:01:28.510410+00:00","updated_at":"2026-06-07T13:01:28.510410+00:00","problems":[{"fix":"Run 'npm install vex-core'.","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'vex-core'"},{"fix":"Use 'import { Vex } from \"vex-core\"' instead of 'import Vex from \"vex-core\"'.","cause":"Wrong import (default import instead of named).","error":"TypeError: Vex.create is not a function"},{"fix":"Upgrade to Node 24+, Bun 1.3+, or install 'urlpattern-polyfill'.","cause":"Runtime too old for URLPattern global.","error":"Error: The 'urlpattern-polyfill' module is required for Node <24."},{"fix":"Switch to import syntax or use dynamic import().","cause":"Attempting to use require() on ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module not supported."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Michaelliv/vex-core#readme","github":"https://github.com/Michaelliv/vex-core","docs":null,"changelog":null,"pypi":null,"npm":"vex-core","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}