A simple application to translate English into Yoda Speak.
It's designed to show how to use the Doppler Universal Secrets Manager for securely and easily fetching app config and secrets for local and production environments using the Doppler CLI and either a system installation of Node.js, Docker, or Docker Compose (Kubernetes coming soon).
New to Doppler? Check out our documentation to get started with your own applications, or clone this repo and follow-along.
NOTE: The Yoda translation API used by the app is limited to 5 requests per hour unless you register to purchase an API key.
The commands and scripts to run tha application will work on macOS and Linux variants but not Windows. If you wish to get this working on Windows, either use WSL or create an issue if you'd like to see native Windows support via PowerShell.
Requirements:
- Doppler CLI
- Node 14+
- Docker
- Docker Compose
If on macOS, you can install the Doppler CLI by running:
brew install dopplerhq/cli/doppler node
The following environment variables are required and you can use the below defaults. Also see [sample.env
- Install Doppler
- From a terminal, run:
doppler login
- Once logged in, open a new browser window and sign in to Doppler
- In the Doppler Web UI, create a workspace
Once authenticated, run the following command to create the yodaspeak
project in Doppler and populate the required secrets with default values:
make doppler-project-setup
Run npm start
to install all app dependencies.
Then use doppler run
to call the npm start
command, which will inject our secrets as environment variables:
doppler run -- npm start
NOTE: For HTTPS, create the
TLS_CERT
,TLS_KEY
, andTLS_PORT
secrets
You can use Docker in production using a Doppler service token to provide read-only access to a specific production config, or run the container locally local code mounted into the container and the development dependencies installed.
To use Docker in production, run:
# Requires `DOPPLER_TOKEN` to be exported
make docker
For local development, run:
make docker-dev
There are also commands for using Docker Compose.
To use Docker Compose in production, run:
make docker-compose
For local development, run:
make docker-compose-dev
This is mainly for the Doppler team to test the Heroku integration but you can deploy this to your own Heroku account/team, by overriding the default values in Heroku.Makefile
for:
TEAM
APP
DOMAIN
Creating and deploying a site also consists of setting initial default values for config vars in order for the app to deploy successfully.
Then once the app has deployed, open the Doppler dashboard and enable the Heroku integration for the relevant environment.
To create and deploy to production using default values (works for Doppler team only)
make create -f Heroku.Makefile
To create and deploy to your own custom account:
make create -f Heroku.Makefile TEAM=your-team APP=your-yodaspeak-app-name DOMAIN=your-domain.yodaspeak.com
NOTE: This is a work in progress and feedback is greatly appreciated!
You can quickly and easily run YodaSpeak on repl.it by following the below steps once your environment has booted up:
- Create a Service Token and expose it using the
DOPPLER_TOKEN
environment variable - Install and configure all required dependencies by running:
# You'll need to paste your Doppler Service Token when prompted
. ./bin/replit-setup.sh
Once setup, you can then start the server by clicking the Run button, or manually by running:
./bin/replit-start.sh
Create a GitHub issue, including your OS and Node version, and we'll help you out!