SQLite’s limits became noticeable while building with PocketBase, but replacing the database was not the first step. Screens that know collection names and raw response shapes would require broad changes alongside any storage migration. We first needed to reduce that dependency to leave room for PostgreSQL or another platform later.
For example, editing a game list involves permission checks, the current state and change history as well as saving values. Calling collections individually from a screen complicates recovery when only some writes succeed. Read rules for public documents and private drafts can also spread across screens.
API v2 therefore accepts a user operation as one request. The interface supplies intent; the server handles authorization, save order and failure behavior. This makes an operation’s rules easier to inspect while reducing knowledge of the storage structure.
PocketBase still supplies authentication and storage. Documented custom APIs expose the supported arcade operations, including request values, product responses and the meaning of authorization errors and conflicts. Keeping that interface stable can limit screen changes when internal collections evolve.
Browser interactions pass through a Next.js Route Handler to a DataKit service; server rendering calls the same service directly. DataKit handles authenticated server transport and response interpretation. Both paths use the same product types instead of forwarding raw storage responses to the browser.
A game edit includes the arcade ID, the state from which editing began and additions, modifications and removals. The server checks editing permission and current state. If someone else saved first, it returns a conflict while the interface keeps the draft available for comparison with the latest version.
A valid request saves the new game state, current reference, history and any required reward in one transaction. A transaction makes the group commit or roll back together. External service calls run outside it, avoiding a database lock held while waiting for another service.
Core owns reusable schemas and API behavior. Full adds operational migration of existing data, configuration and job registration. Creating a fresh environment and transforming existing history and references require different verification.
The current custom APIs still run on PocketBase and SQLite. Migration to PostgreSQL or another platform remains future work. The change gives screens the result of a complete user operation and lets the server validate authorization and persistence together. New features need to use the same APIs to retain those benefits.
Related articles and sources: Arcade change history · Musecat engineering notes