Backend Tools

Tools for backend development — manage server code, cloud functions, and infrastructure.

Template-Driven Architecture

AppsAI supports multiple backend types (Parse Server, Express, Serverless, etc.). The tools below work with any backend template — the AI adapts to your project's configuration.

Code Management

backend_LIST_BACKEND_FILES

List all files in the backend directory.

Parameters

projectIdstringRequiredThe project ID
pathstringOptionalSubdirectory path to list (default: root)

Example

{
  "projectId": "abc123"
}

// Returns
{
  "files": [
    "src/cloud/main.ts",
    "src/cloud/triggers.ts",
    "src/cloud/functions/auth.ts",
    "package.json"
  ]
}
backend_READ_BACKEND_FILE

Read the contents of a backend file.

Parameters

projectIdstringRequiredThe project ID
filePathstringRequiredPath to the file

Example

{
  "projectId": "abc123",
  "filePath": "src/cloud/main.ts"
}

// Returns
{
  "content": "import Parse from 'parse/node';\n\nParse.Cloud.define('hello', () => {\n  return 'Hello World!';\n});",
  "filePath": "src/cloud/main.ts"
}
backend_SET_BACKEND_FILE

Create or update a backend file.

Parameters

projectIdstringRequiredThe project ID
filePathstringRequiredPath to the file
contentstringRequiredNew file contents

Example

{
  "projectId": "abc123",
  "filePath": "src/cloud/functions/users.ts",
  "content": "import Parse from 'parse/node';\n\nParse.Cloud.define('getUser', async (req) => {\n  const user = await new Parse.Query('User').get(req.params.userId);\n  return user.toJSON();\n});"
}
backend_GREP_BACKEND_FILES

Search for text patterns across backend files.

Parameters

projectIdstringRequiredThe project ID
patternstringRequiredSearch pattern (regex supported)
pathstringOptionalSubdirectory to search in

Example

{
  "projectId": "abc123",
  "pattern": "Parse.Cloud.define"
}

// Returns
{
  "matches": [
    { "file": "src/cloud/main.ts", "line": 3, "content": "Parse.Cloud.define('hello', () => {" },
    { "file": "src/cloud/functions/users.ts", "line": 5, "content": "Parse.Cloud.define('getUser', async (req) => {" }
  ]
}
backend_RUN_BUILD

Run the build process for the backend. This compiles TypeScript and validates the code.

Parameters

projectIdstringRequiredThe project ID

Example

{
  "projectId": "abc123"
}

// Returns
{
  "success": true,
  "output": "Build completed successfully",
  "errors": []
}
backend_SET_BACKEND_ENV_VARIABLE

Set an environment variable for the backend.

Parameters

projectIdstringRequiredThe project ID
keystringRequiredEnvironment variable name
valuestringRequiredEnvironment variable value

Example

{
  "projectId": "abc123",
  "key": "STRIPE_SECRET_KEY",
  "value": "sk_live_xxxxx"
}

Infrastructure

Backend AI also manages cloud infrastructure. See the AWS Tools page for CloudFormation, S3, SES, and other infrastructure tools.

Best Practices

Always run build after changes

After modifying backend files, run backend_RUN_BUILD to compile TypeScript and catch errors before deploying.

Use environment variables for secrets

Never hardcode API keys or secrets in your code. Use backend_SET_BACKEND_ENV_VARIABLE instead.

Organize code by domain

Keep related functions together in files like auth.ts, users.ts, orders.ts for maintainability.