# Host client portal with Spring Boot: tenant-scoped workspaces

Deploy a client portal built with Spring Boot on Ample using the multi-tenant relational data pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. Verified on Spring Boot: a tenant column on every row and query, with a cross-tenant read returning nothing (tenant_isolation=ok). Not separately tested: your tenant model, membership and per-tenant authorization; treat the client portal-specific behavior as your application code.

## Inputs
- **env**: Encrypted environment variables (bucket credentials, secrets)
- **name**: App name
- **path**: Project directory or ample.toml service
- **release_command**: Migration command run before activation

## Resource Requirements
- **Compute**: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
- **Postgres**: Managed PostgreSQL 16 runs in its own microVM.

## Prerequisites
1. A Spring Boot project that builds and starts with the documented commands (./mvnw -q -DskipTests package or the Gradle wrapper).
2. A PostgreSQL driver reading DATABASE_URL at runtime.
3. An Ample account token with servers:write, databases:read.

## Workflow Steps
1. **Build and start**: `./mvnw -q -DskipTests package`, then `java -jar` on the jvm-21 template with server.port read from PORT.
2. **Implement the pattern on PostgreSQL**: A tenant column on every row and query, with cross-tenant read returning nothing.
3. **Deploy**: `ample deploy . --name <APP_NAME> --public`.
4. **Verify**: Fetch the live URL and run your own checks.

## Success Checks
- App responds on its public URL
- Multi-tenant-relational-data self-test at `/p/multi-tenant-relational-data`

## Limitations
- Verified on the jvm-21 template; other versions are not verified.
- The client portal behavior is application-specific code that was not tested separately.

## Cost Estimate
- Currency: USD, Monthly Amount: $10.00

## Evidence Summary
- Spring Boot pattern fixture deployed on Ample; checks passed for multi-tenant-relational-data.

## Formats
- [HTML Format](/content/recipes/client-portal/spring-boot/tenant-workspaces/index.html)  
- [Markdown Format](/content/recipes/client-portal/spring-boot/tenant-workspaces.md)  
- [JSON Format](https://api.ample.computer/v1/catalog/recipes/page%3Arecipes%3Aclient-portal%3Aspring-boot%3Atenant-workspaces)

## Next Actions
- Browse the catalog index
- Search published recipes by intent, stack, and constraints
- Prepare a side-effect-free deployment plan
- Read the existing agent authentication setup
- Browse Client portal
- Browse Spring Boot
- Browse Multi-tenant relational data
- Browse Deploy web app
