Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ ESLint
ESlint
EcmaScript
Eine
ElastiCache
ElasticSearch
ElasticsearchDefinition
ElasticsearchEntityAggregator
Expand Down Expand Up @@ -611,6 +612,7 @@ OAuth
OPENSEARCH
ORM
ORMs
OSS
OTEL
OTLP
ObjectField
Expand Down Expand Up @@ -857,6 +859,7 @@ Sendfile
SeoUrlRoute
SeoUrlTemplate
SerializedField
Serverless
SetNullOnDelete
ShippingCountryRule
ShippingMethodPriceCollector
Expand Down Expand Up @@ -994,6 +997,7 @@ UpdatedBy
UpdatedByField
UpperCamelCase
Upserting
Upstash
Upsun
UrlAware
UrlStorer
Expand All @@ -1006,6 +1010,7 @@ VARCHAR
VCL
VCS
VM
VPC
VSCode
Validator
Valkey
Expand Down Expand Up @@ -1773,6 +1778,7 @@ seperate
seperated
serializable
serializer
serverless
setFlags
setLocaleToEnGb
setProductFixtureVisibility
Expand Down
41 changes: 41 additions & 0 deletions products/sales-agent/best-practices/app-deployment/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,47 @@ In this chapter, you will learn how to deploy the frontend source code to [AWS A
- Register an AWS account.
- Clone the frontend source code and push it to your Git repository (for example, GitHub).

## Setup Redis with Amazon ElastiCache

AWS Amplify does not include Redis by default. To use Redis for caching, you need to set up [Amazon ElastiCache](https://aws.amazon.com/elasticache/) or use an external Redis provider.

### Option 1: Amazon ElastiCache

Amazon ElastiCache is a fully managed in-memory data store service compatible with Redis.

1. Navigate to the [ElastiCache Console](https://console.aws.amazon.com/elasticache/).
2. Click "Create" and select "Redis OSS" as the cluster engine.
3. Configure your cluster settings (node type, number of replicas, etc.).
4. Configure security groups to allow access from your Amplify application.
5. Once created, note the **Primary Endpoint** for your Redis connection.

::: warning
ElastiCache runs within a VPC. Connecting from AWS Amplify (which runs outside VPC by default) requires additional configuration such as VPC peering or using a public endpoint. For serverless applications, consider using Option 2.
:::

### Option 2: Serverless Redis providers

For easier integration with serverless deployments like AWS Amplify, consider using:

- [Upstash](https://upstash.com/) - Serverless Redis with REST API support, ideal for edge/serverless environments.
- [Redis Cloud](https://redis.com/cloud/overview/) - Managed Redis with public endpoints.

These providers offer public endpoints that work seamlessly with AWS Amplify without VPC configuration.

### Configure Redis environment variables

After setting up Redis (ElastiCache or a serverless provider), configure these environment variables in AWS Amplify:

```bash
REDIS_CACHE=true
REDIS_HOST=your-redis-endpoint.cache.amazonaws.com # Or your provider's endpoint
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password
REDIS_TLS=true # Recommended for production
```

Add these variables in the AWS Amplify Console under "Environment variables" in your app settings, or include them in your `.env.template` file.

## Deploy

- Login to the AWS Amplify Hosting Console.
Expand Down
36 changes: 36 additions & 0 deletions products/sales-agent/best-practices/app-deployment/cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,42 @@ In this chapter you will learn how to deploy the frontend source code to [Cloudf
- Register a Cloudflare account.
- Clone the frontend source code and push to your GitHub repository.

## Setup Redis with Upstash

Cloudflare Pages/Workers do not include a built-in Redis service. [Upstash](https://upstash.com/) is the recommended serverless Redis provider that integrates natively with Cloudflare.

### Create an Upstash Redis database

1. Sign up at [Upstash Console](https://console.upstash.com/).
2. Click "Create Database" and select a region close to your users.
3. Once created, navigate to the database details page.
4. Copy the connection details:
- **REDIS_HOST**: The endpoint URL (e.g., `xxx.upstash.io`)
- **REDIS_PORT**: Usually `6379` or the TLS port `6380`
- **REDIS_PASSWORD**: The password from the database details
- **REDIS_TLS**: Set to `true` for secure connections

### Configure environment variables

Add these Redis environment variables to your `.env` file:

```bash
REDIS_CACHE=true
REDIS_HOST=your-database.upstash.io
REDIS_PORT=6379
REDIS_PASSWORD=your_upstash_password
REDIS_TLS=true
```

### Cloudflare integration (optional)

You can also set up the Upstash integration directly in Cloudflare:

1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com/) → Workers & Pages → Your project.
2. Navigate to Settings → Integrations.
3. Find and add the Upstash integration.
4. Follow the prompts to connect your Upstash account.

## Deploy from a local machine

- Due to this [issue](https://github.com/nuxt/nuxt/issues/28248), just make sure your `.npmrc` file has the following content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,73 @@

- **Frontend Application**: Clone the frontend source code and push to your GitHub repository.

## Setup Redis

Redis is required for caching. You can either install Redis locally on your Ubuntu server or use a managed Redis service.

### Option 1: Install Redis locally

Install Redis using the package manager:

```bash
sudo apt update
sudo apt install redis-server
```

Configure Redis for production by editing the configuration file:

```bash
sudo nano /etc/redis/redis.conf
```

Key settings to consider:

- Set `supervised systemd` to integrate with systemd.
- Configure `bind` to restrict access (e.g., `bind 127.0.0.1` for local only).
- Set a password with `requirepass your_secure_password`.

Enable and start the Redis service:

```bash
sudo systemctl enable redis-server
sudo systemctl start redis-server
```

Verify Redis is running:

```bash
# If you configured a password with requirepass
redis-cli -a your_secure_password ping

Check warning on line 65 in products/sales-agent/best-practices/app-deployment/hosted-with-ubuntu-server.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] products/sales-agent/best-practices/app-deployment/hosted-with-ubuntu-server.md#L65

A determiner cannot be combined with a possessive pronoun. Did you mean simply “a” or “your”? (A_MY[136]) Suggestions: `a`, `your` Rule: https://community.languagetool.org/rule/show/A_MY?lang=en-US&subId=136 Category: COLLOCATIONS
Raw output
products/sales-agent/best-practices/app-deployment/hosted-with-ubuntu-server.md:65:11: A determiner cannot be combined with a possessive pronoun. Did you mean simply “a” or “your”? (A_MY[136])
 Suggestions: `a`, `your`
 Rule: https://community.languagetool.org/rule/show/A_MY?lang=en-US&subId=136
 Category: COLLOCATIONS

# If no password is set
redis-cli ping
```

You should see `PONG` as a response.

### Option 2: Use a managed Redis service

Alternatively, you can use managed Redis services such as:

- [Upstash](https://upstash.com/) - Serverless Redis with pay-per-request pricing.
- [Redis Cloud](https://redis.com/cloud/overview/) - Managed Redis by Redis Ltd.

These services provide connection details (host, port, password) that you configure in your `.env` file.

### Configure Redis environment variables

Add these Redis environment variables to your `.env` file:

```bash
REDIS_CACHE=true
REDIS_HOST=127.0.0.1 # For local installation, or your managed service endpoint
REDIS_PORT=6379
REDIS_PASSWORD=your_secure_password # If configured with requirepass
REDIS_TLS=false # Set to true for managed services that require TLS
```

For managed Redis services like Upstash, use the connection details provided by the service (host, port, password, and set `REDIS_TLS=true` for secure connections).

## Build code

- Please follow instructions here to [set up all necessary things and build the code](../../installation.md#setup-app-server)
Expand Down