Skip to content

Local Development

Local development means running the services on your machine — the App API on :8000, the Inference API on :8001, and the Angular SPA on :4200 — while they talk to real AWS resources in a deployed environment. There is no offline mode.

ServiceCommandPortTalks to
App APIuv run python main.py:8000Deployed DynamoDB, Cognito, S3, Secrets Manager
Inference APIuv run python main.py:8001Deployed Bedrock, AgentCore Memory + tools
Angular SPAnpm start:4200The local App API at :8000

You need Python with uv, Node.js, and AWS credentials for an account where a stack is deployed (with read access to its SSM parameters).

Install dependencies and copy the environment template:

Terminal window
cd backend
uv sync --extra agentcore --extra dev
cp src/.env.example src/.env

Then fill in src/.env. The required values come from your deployed stack’s SSM parameters — pull them with the CLI rather than hand-copying from the console:

Terminal window
aws ssm get-parameters-by-path --path "/<your-prefix>/" --recursive \
--query 'Parameters[].[Name,Value]' --output text

Each variable in src/.env.example documents where its value comes from. backend/README.md and the Configuration section cover the full catalog. Make sure your AWS credentials resolve (via AWS_PROFILE or the default chain) and that the account has Bedrock model access enabled for the models in your seed data.

Run each API in its own terminal:

Terminal window
cd src/apis/app_api && uv run python main.py # http://localhost:8000
cd src/apis/inference_api && uv run python main.py # http://localhost:8001

Run the backend test suite:

Terminal window
cd backend && uv run python -m pytest tests/ -v

The SPA authenticates through Cognito, which means a round-trip you may not want on every local run. Two options:

  • Full Cognito (BFF). Set the COGNITO_* and BFF_* variables in src/.env from the deployed stack, with BFF_AUTH_CALLBACK_URL=http://localhost:8000/auth/callback. The deployed Cognito app client must allow that callback URL. This exercises the real login flow.
  • Auth bypass (SKIP_AUTH=true). Returns a fake admin user and skips Cognito entirely — handy when you have no IdP access or are driving the app unattended.
Terminal window
cd frontend/ai.client
npm install
npm start # ng serve → http://localhost:4200
npm test # ng test

The SPA reads its API base URL from src/environments/environment.ts, which points at the local App API (http://localhost:8000). For browser calls to succeed, the App API’s CORS_ORIGINS must include http://localhost:4200 — the .env.example default already does. If you instead point the SPA at a deployed backend, that environment must allow http://localhost:4200 in its CDK_CORS_ORIGINS (and, for MCP Apps or artifact iframes, its *_EXTRA_FRAME_ANCESTORS); see Environments.

To iterate on the CDK constructs themselves, the tooling runs locally even though deploying happens in CI:

Terminal window
cd infrastructure
npm ci
npx tsc --noEmit
npx jest
npx cdk synth

Synth and tests run on your machine; the actual cdk deploy is owned by the platform.yml workflow — see Platform (CDK).