Skip to content

Cli local dev entities#279

Draft
artemdemo wants to merge 5 commits intomainfrom
cli-local-dev-entities
Draft

Cli local dev entities#279
artemdemo wants to merge 5 commits intomainfrom
cli-local-dev-entities

Conversation

@artemdemo
Copy link
Contributor

@artemdemo artemdemo commented Feb 19, 2026

Note

Description

This PR adds full CRUD entity support to the local dev server, allowing developers to work with entity data entirely in-memory without hitting the remote Base44 API. It introduces an in-memory database layer using @seald-io/nedb that initializes a separate datastore per entity, and wires up an Express router with standard REST endpoints for each entity. The dev command is also updated to load entity schemas in parallel with functions on startup.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added @seald-io/nedb as a dev dependency for in-memory database support
  • Created src/cli/dev/dev-server/database.ts: a Database class that manages per-entity NeDB datastores
  • Created src/cli/dev/dev-server/routes/entities.ts: Express router with full CRUD endpoints for entities:
    • GET /User/me — proxied to remote
    • GET /:entityName — list records (supports sort, limit, skip, fields, q query params)
    • GET /:entityName/:id — get a single record by ID
    • POST /:entityName — create a record (auto-assigns id, created_date, updated_date)
    • POST /:entityName/bulk — bulk insert an array of records
    • PUT /:entityName/:id — update a record (updates updated_date automatically)
    • DELETE /:entityName/:id — delete a single record
    • DELETE /:entityName — delete multiple records matching a query body
  • Updated src/cli/dev/dev-server/main.ts to initialize the Database and mount entity routes at /api/apps/:appId/entities
  • Updated src/cli/commands/dev.ts to load entities in parallel with functions using Promise.all
  • Updated README.md command table to include eject, connectors pull, connectors push, and types generate

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

The entity routes follow the same pattern as the existing function routes. The /User/me endpoint is explicitly proxied to remote since user identity must come from the real Base44 backend. All other entity collections are served locally from in-memory NeDB datastores, which are initialized fresh on each base44 dev invocation (data does not persist between runs).


🤖 Generated by Claude | 2026-02-19 15:18 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.33-pr.279.c3fe9fe

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.33-pr.279.c3fe9fe"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.33-pr.279.c3fe9fe"
  }
}

Preview published to npm registry — try new features instantly!

@claude
Copy link

claude bot commented Feb 19, 2026

README check ran. 4 issue(s) found and applied: added missing connectors pull, connectors push, and types generate commands to the command table; uncommented and corrected the eject command description. README.md has been updated in this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments