How slashdb/js-slashdb works
This repo is a JavaScript ES6 SDK (a client library), not a deployed “system” by itself. Its purpose is to help an application (browser or Node) authenticate to a SlashDB instance and then call two major SlashDB feature areas:
• Data Discovery (REST over database resources: tables/views/etc.)
• SQL Pass-Thru (execute predefined queries via SlashDB)
What the file tree tells you (map code to components)
Top-level:
• src/ = the SDK modules (core of the product)
• tests/ = Jest unit tests (verifies module behavior; not runtime architecture but good for component boundaries)
• docs/ = generated JSDoc (confirms public APIs / classes)
• Build/tooling: .babelrc, package.json, jest.config.js, jsdoc.conf.json
Inside src/, the architecture is clearly layered:
Public API surface (what consumers import)
• src/index.js (barrel export)
• src/slashdbclient.js (entry point / session/auth/config)
• src/datadiscovery.js (DataDiscoveryDatabase, DataDiscoveryResource)
• src/datadiscoveryfilter.js (DataDiscoveryFilter URL/options builder)
• src/sqlpassthru.js (SQLPassThruQuery)
• src/sqlpassthrufilter.js (SQLPassThruFilter URL/options builder)
• src/filterfunctions.js (composable filter DSL helpers like eq, any, and, asc/desc)
Internal foundations (supporting layers)
• src/baserequesthandler.js (shared request execution logic)
• src/fetchwrapper.js (HTTP fetch abstraction)
• src/basefilter.js (shared filter builder primitives)
• src/pkce.js (SSO / OAuth PKCE support)
• src/utils.js (shared helpers)
This strongly suggests drawing it as:
App → SDK public modules → internal request/filter utilities → HTTP → SlashDB
Login/auth
• API key based login OR username/password login
• SSO login (with PKCE + redirect/popup)
Data Discovery call flow
• Create SlashDBClient (host + auth)
• Instantiate DataDiscoveryDatabase
• Instantiate DataDiscoveryResource
• Build DataDiscoveryFilter
• Call resource.get/post/put/delete(filter) → HTTP to SlashDB
SQL Pass-Thru call flow
• Create SQLPassThruQuery(name, client)
• Build SQLPassThruFilter(params).limit().sort()...
• Call query.accept('csv').get(filter) → HTTP to SlashDB
Consumer Application
• Browser app (examples/*.html) and/or Node app
SDK Package: @slashdb/js-slashdb
• Public modules:
• SlashDBClient
• DataDiscoveryDatabase
• DataDiscoveryResource
• DataDiscoveryFilter
• SQLPassThruQuery
• SQLPassThruFilter
• filterfunctions (eq/any/between/and/asc/desc…)
• Internal modules:
• BaseRequestHandler
• FetchWrapper
• BaseFilter
• PKCE
• Utils
External systems
SlashDB Server (external)
• Data Discovery REST endpoints
• SQL Pass-Thru endpoints
• Auth/SSO endpoints (IdP mediated)
Identity Provider (optional, external)
• Okta/etc (SSO), via PKCE redirect/popup
• DataDiscoveryResource → BaseRequestHandler (uses shared request logic)
• SQLPassThruQuery → BaseRequestHandler
• DataDiscoveryFilter → BaseFilter + filterfunctions
• SQLPassThruFilter → BaseFilter (or equivalent shared logic)
• SlashDBClient → FetchWrapper + PKCE + Utils
• BaseRequestHandler → FetchWrapper
• Consumer App → SlashDBClient.login() → (HTTP) → SlashDB auth endpoints
• Consumer App → DataDiscoveryResource.get(filter) → BaseRequestHandler → FetchWrapper → (HTTP) → SlashDB Data Discovery endpoints
• Consumer App → SQLPassThruQuery.get(filter) → BaseRequestHandler → FetchWrapper → (HTTP) → SlashDB SQL Pass-Thru endpoints
• If SSO: SlashDBClient.login() → PKCE → browser redirect/popup → IdP → SlashDB
• Data Discovery: typically JSON (but accept types exist)
• SQL Pass-Thru: may return CSV/JSON/etc depending on .accept(...)
Architectural patterns used
• Layering: public domain objects (Client/Resource/Query) on top of shared request + fetch abstraction.
• Builder pattern: DataDiscoveryFilter / SQLPassThruFilter are fluent option builders producing URL/query configuration.
• Facade: SlashDBClient hides auth/session/config mechanics (including SSO/PKCE).
• Transport abstraction: FetchWrapper isolates fetch usage for testability/environment differences.
Relevant technologies that matter
• ES6 modules
• fetch (via wrapper)
• Jest (tests) and JSDoc (docs) — tooling lane, not runtime lane
• PKCE for SSO
(Optional) SSO login (PKCE redirect/popup loop)
These sequences will make it obvious what’s synchronous/async, where HTTP happens, and what objects are responsible.
Public
• SlashDBClient
• DataDiscoveryDatabase
• DataDiscoveryResource
• DataDiscoveryFilter
• SQLPassThruQuery
• SQLPassThruFilter
• filterfunctions (eq/any/between/gte/lte/not/and/asc/desc/chgPlaceHolder)
Internal
• BaseRequestHandler
• FetchWrapper
• BaseFilter
• PKCE
• Utils
External
• SlashDB server:
• Auth endpoints
• Data Discovery endpoints
• SQL Pass-Thru endpoints
• (Optional) Identity Provider (Okta/etc)
Title it something like:
• “js-slashdb SDK Architecture & Runtime Interactions”
And put a subtitle:
• “Client-side library used by apps to authenticate and call SlashDB Data Discovery and SQL Pass-Thru APIs.”
That framing prevents reviewers from expecting deployable services inside this repo, while still being “system design accurate.”