Skip to content

Commit b7ecdbe

Browse files
committed
docs(readme): Complete README with full deployment steps
This commit brings the Python project's README.md to full documentation parity with the Node.js version. The previous version of the README referred to the Node.js documentation for deployment and setup instructions, which did not meet the goal of creating a complete, standalone starter project. This update replaces the incomplete sections with full, explicit, and Python-specific instructions for: - Manual Heroku Deployment - Heroku AppLink Setup, including connecting to Salesforce and publishing the application. The Python project now serves as a true, self-contained guide for developers.
1 parent f58488c commit b7ecdbe

File tree

1 file changed

+98
-5
lines changed

1 file changed

+98
-5
lines changed

README.md

Lines changed: 98 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/heroku-reference-apps/applink-getting-started-python)
44

5-
The Heroku AppLink Python app template is a [FastAPI](https://fastapi.tiangolo.com/) web application that demonstrates how to build APIs for Salesforce integration using Heroku AppLink. This template includes authentication, authorization, and API specifications for seamless integration with Salesforce, Data Cloud, and Agentforce.
5+
The Heroku AppLink Python app template is a [FastAPI](https://fastapi.tiangolo.com/) web application that demonstrates how to build APIs for Salesforce integration using Heroku AppLink. This template includes authentication, authorization, and API specifications for seamless integration with Salesforce and Data Cloud.
66

77
## Table of Contents
88

@@ -12,8 +12,6 @@ The Heroku AppLink Python app template is a [FastAPI](https://fastapi.tiangolo.c
1212
- [Running Automated Tests](#running-automated-tests)
1313
- [Manual Heroku Deployment](#manual-heroku-deployment)
1414
- [Heroku AppLink Setup](#heroku-applink-setup)
15-
- [Project Structure](#project-structure)
16-
- [API Documentation](#api-documentation)
1715
- [Additional Resources](#additional-resources)
1816

1917
## Quick Start
@@ -104,11 +102,106 @@ pytest
104102

105103
## Manual Heroku Deployment
106104

107-
(Instructions for `heroku create`, buildpacks, add-ons, and deployment are unchanged.)
105+
### 1. Prerequisites
106+
107+
- [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) installed
108+
- Git repository initialized
109+
- Heroku account with billing enabled (for add-ons)
110+
111+
### 2. Create Heroku App
112+
113+
```bash
114+
# Create a new Heroku app
115+
heroku create your-app-name
116+
117+
# Or let Heroku generate a name
118+
heroku create
119+
```
120+
121+
### 3. Add Required Buildpacks
122+
123+
The app requires two buildpacks in the correct order:
124+
125+
```bash
126+
# Add the AppLink Service Mesh buildpack first
127+
heroku buildpacks:add heroku/heroku-applink-service-mesh
128+
129+
# Add the Python buildpack second
130+
heroku buildpacks:add heroku/python
131+
```
132+
133+
### 4. Provision the AppLink Add-on
134+
135+
```bash
136+
# Provision the Heroku AppLink add-on
137+
heroku addons:create heroku-applink
138+
139+
# Set the required HEROKU_APP_ID config var
140+
heroku config:set HEROKU_APP_ID="$(heroku apps:info --json | jq -r '.app.id')"
141+
```
142+
143+
### 5. Deploy the Application
144+
145+
```bash
146+
# Deploy to Heroku
147+
git push heroku main
148+
149+
# Check deployment status
150+
heroku ps:scale web=1
151+
heroku open
152+
```
153+
154+
### 6. Verify Deployment
155+
156+
```bash
157+
# Check app logs
158+
heroku logs --tail
159+
```
108160

109161
## Heroku AppLink Setup
110162

111-
(Instructions for `heroku salesforce:connect`, `heroku salesforce:authorizations:add`, and `heroku salesforce:publish` are identical to the Node.js version and can be referenced from the official documentation.)
163+
### 1. Install AppLink CLI Plugin
164+
165+
```bash
166+
# Install the AppLink CLI plugin
167+
heroku plugins:install @heroku-cli/plugin-applink
168+
```
169+
170+
### 2. Connect to Salesforce Org
171+
172+
```bash
173+
# Connect to a production org (replace your-addon-name and your-app-name)
174+
heroku salesforce:connect production-org --addon your-addon-name -a your-app-name
175+
176+
# Connect to a sandbox org
177+
heroku salesforce:connect sandbox-org --addon your-addon-name -a your-app-name --login-url https://test.salesforce.com
178+
```
179+
180+
### 3. Authorize a User
181+
182+
```bash
183+
# Authorize a Salesforce user for API access
184+
heroku salesforce:authorizations:add auth-user --addon your-addon-name -a your-app-name
185+
```
186+
187+
### 4. Publish Your App
188+
189+
```bash
190+
# Publish the app to Salesforce as an External Service
191+
heroku salesforce:publish api-spec.yaml \
192+
--client-name MyAPI \
193+
--connection-name production-org \
194+
--authorization-connected-app-name MyAppConnectedApp \
195+
--authorization-permission-set-name MyAppPermissions \
196+
--addon your-addon-name
197+
```
198+
199+
### 5. Required Salesforce Permissions
200+
Users need the "Manage Heroku AppLink" permission in Salesforce:
201+
1. Go to Setup → Permission Sets
202+
2. Create a new permission set or edit an existing one
203+
3. Add "Manage Heroku AppLink" system permission
204+
4. Assign the permission set to users
112205

113206
## Additional Resources
114207

0 commit comments

Comments
 (0)