vroqjs.com

06-big-tree-and-apis/00-overview.md

BigTree and API design overview

BigTree and API design overview

This section defines how Vroq apps should design and use APIs, especially BigTree scripts and RPC-style workflows.

The goal is to keep remote interaction structured, debuggable, and consistent. API code should not drift into scattered raw fetch calls or ad hoc transport logic spread across UI files.

Main goals

Good BigTree and API design should make it easy to:

  • decide when server-side code is needed
  • keep script boundaries clear
  • keep app-side transport code small and predictable
  • design stable request and response shapes
  • debug remote behavior cleanly
  • reuse existing API patterns instead of inventing new ones per feature

Main rule

Remote interaction should pass through explicit boundaries:

  • scripts on the server side
  • small API client files on the app side
  • reducers and actions for state transitions
  • sections and components for UI rendering

What this section covers

This section documents:

  • API design principles
  • when to write a script
  • how to write a script
  • how apps should call scripts
  • RPC design
  • error shapes
  • debuggable API design

Read next

Read these files next:

  • 01-api-design-principles.md
  • 02-when-to-write-a-script.md
  • 03-how-to-write-a-script.md
  • 04-how-apps-call-scripts.md
  • 05-rpc-design.md
  • 06-error-shapes.md
  • 07-debuggable-api-design.md