Skip to content

Architecture ​

Chilibase is two libraries plus your app.

┌─────────────────────────────────────────┐
│  App frontend (Vite + React)            │
│  @chilibase/frontend                    │
│  PrimeReact, React Router               │
└──────────────────┬──────────────────────┘
                   │ HTTP JSON (JWT)
┌──────────────────▼──────────────────────┐
│  App backend (NestJS)                   │
│  ChilibaseModule.forRoot()              │
│  @chilibase/backend                     │
│  TypeORM + PostgreSQL                   │
└─────────────────────────────────────────┘

Both packages compile to ESM. Apps are typically deployed on a Linux VPS with Docker; GitHub Actions is used in existing projects.

Frontend ​

@chilibase/frontend is a React component library. Imports are per area, for example:

ts
import { LazyDataTable, Column } from '@chilibase/frontend/lazy-data-table'
import { FormBaseModif, FormFooter, FormHeader } from '@chilibase/frontend/form'
import { TextField } from '@chilibase/frontend/text-field'
import { App } from '@chilibase/frontend/auth'

The root App component selects the auth provider from VITE_AUTH (off / local / Auth0 / Microsoft Entra ID) and wraps the rest of the UI.

MenuBar renders a PrimeReact menubar and shows the current user (and backend URL on desktop).

Backend ​

Register the framework module in your Nest application:

ts
ChilibaseModule.forRoot()

That module brings in:

  • AuthModule (JWT / local login)
  • PersistenceController — find, save, remove, export, metadata, local login
  • FileController — upload / download
  • Services: persistence, lazy table, export (Excel / CSV / JSON), files, entity metadata, browse metadata

Your AppModule still owns TypeORM DataSource configuration, entity list, and the JWT APP_GUARD when auth is not OFF.

Persistence API (selected) ​

All of these are POST endpoints on the backend:

EndpointPurpose
x-lazy-data-table-find-rowsPaged, filtered, sorted rows
x-lazy-data-table-export-excel / -csv / -jsonExport current query
x-lazy-auto-complete-suggestionsAutocomplete search
x-find-row-by-idLoad one row (optional lock)
x-save-rowInsert or update, including cascaded details
x-remove-rowDelete
x-unlock-rowRelease pessimistic lock
x-get-entity-metadata-mapField / association metadata for the UI
x-get-browse-meta-mapStored browse column layout
x-local-auth-loginLocal login (@Public)
x-post-loginAfter login: resolve user in DB
x-user-save-rowSave user (hashes password for local auth)
x-upload-file-into-file-system / x-upload-file-into-dbFile upload

Metadata ​

On startup (after login), the frontend loads the entity map from x-get-entity-metadata-map. That map is derived from TypeORM metadata: entity name, id field, scalar fields, and associations (type, cascade, nullability).

Browse column layouts can be stored in x_browse_meta / x_column_meta and edited at runtime (DynamicBrowse).

Stack ​

LayerLibraries
UIReact 18, PrimeReact 10, PrimeFlex, PrimeIcons, React Router 7
Forms extrasQuill (rich text)
Auth clients@auth0/auth0-react, @azure/msal-browser / @azure/msal-react
APINestJS 11, Passport JWT
ORM / DBTypeORM 0.3, pg, PostgreSQL
Exportexceljs
ToolingVite, TypeScript, pnpm, ESM

Released under the MIT License.