See Stacksync in action with a solution architect. Book a demo ↗
Deploy applications

Connect resources to an app

Combine managed PostgreSQL, AI inference, and private file storage in a single application.

EOS resources work together through your application's server-side configuration. A partner portal can store its records in PostgreSQL, send model requests with an inference key, and upload documents to a storage bucket.

Create resources in the intended workspace, then configure your app with the credentials for those resources. A dashboard sharing grant lets a teammate manage a resource; your running application connects using its database credentials or scoped API key.

ResourceWhat the app receivesHow it connects
PostgreSQL databaseDedicated connection string or connection parametersStandard PostgreSQL driver or ORM.
AI inferenceInference API key and selected model IDEOS chat-completions API or compatible SDK.
Storage bucketBucket API key with required scopesEOS storage API or CLI file commands.

1. Provision the resources

Use the dashboard's Create database, Create API key, and Create bucket actions, or the CLI:

eos workspace current
eos database create 'Partner portal production' --json
eos inference keys create 'Partner portal AI' --limit 25 --every 1 --unit months --json
eos storage buckets create 'partner-portal-files' --region EU --json

Database and key creation can return credentials. Capture those responses privately rather than in shared logs. Give each app its own credentials so you can manage its access and spending independently.

For storage, create a key for the returned bucket ID:

eos storage keys create BUCKET_ID 'Portal backend' --scopes read,write,list

Add delete only if the application needs to remove files. AI and storage key values are shown once at creation; sharing the resource later does not reveal the original key.

2. Make the application read its configuration

Choose clear variable names, for example:

DATABASE_URL
STACKSYNC_AI_KEY
STACKSYNC_AI_MODEL
STORAGE_API_KEY

Use project-specific names when several projects share your development environment. Read the values in the backend; never place secret values in public frontend environment variables.

A Node.js application might read process.env.DATABASE_URL when initializing its PostgreSQL client. Its AI client uses STACKSYNC_AI_KEY and the EOS inference base URL. Its storage client sends STORAGE_API_KEY as a bearer credential to the storage API.

3. Supply the variables when deploying

With values already loaded securely in your shell environment:

eos deploy --dry-run --project=partner-portal   "--variable=DATABASE_URL=$DATABASE_URL"   "--variable=STACKSYNC_AI_KEY=$STACKSYNC_AI_KEY"   "--variable=STACKSYNC_AI_MODEL=$STACKSYNC_AI_MODEL"   "--variable=STORAGE_API_KEY=$STORAGE_API_KEY"

After reviewing the dry run, run the same command without --dry-run. A dry run does not persist configuration. Keep shell tracing off when passing secrets. You can also edit the variable JSON in the app's Deployments tab and deploy a new version.

4. Verify the complete workflow

Open the app and exercise a representative action: create a record, make an AI request, and upload a file. Check the database table, inference request log, and bucket file list in EOS. Then review the app's managed authentication and share it with its intended users.

See database connections, AI integration, and storage API keys for resource-specific instructions.

On this page