| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Lora is a sample AI chatbot application which lets users choose from a number of models and charges them on a per-token basis. It demonstrates a few features:
For the sake of demonstration, the per-token prices you'll use today will be more than 100x higher than usual. This is to ensure that you'll be able to get some real numbers without having to run too many test prompts.
Author's Note 1: This application is built toward the 2025-02-24.acacia API version, but the more recent 2025-03-31.basil has introduced breaking changes which impact this integration. In particular, the attributes of a Checkout Session have changed. The accounts we've created for you are configured to use 2025-02-24.acacia, and if you're logged into the account, the API reference will show you that version. However, if you plug in API keys from an account on the latest version, this integration won't work.
Author's Note 2: There is a minimal OpenAI integration included in this application. If you have an OpenAI account, you can plug in your own API keys to get real LLM responses rather than lorem ipsum. You can also explore OpenRouter.ai, which uses the OpenAI integration shape but lets you plug in other models, some of which are free.
You can find every place which needs updates by searching for TODO, but here's a summary:
The commands below were written for a bash terminal on a Unix system. If you're on Windows, we recommend working with Ubuntu on WSL, but the commands should also run in PowerShell.
mkdir -p ~/stripe
cd ~/stripeIf you're unfamiliar with cloning repositories, we have instructions below for whether or not you have an SSH key.
My GitHub account has an SSH keygit clone git@github.com:stripe-certification/billing_node_react_ilt.git
cd billing_node_react_iltYou can quickly clone the repo by using the GitHub CLI. You can install it via:
gh auth login
gh repo clone stripe-certification/billing_node_react_ilt
cd billing_node_react_iltYou can install the Stripe CLI with brew by running:
brew install stripe/stripe-cli/stripe.
If you're on a Windows machine or don't have brew, check here for other installation commands.
We'll use Node v22.15.0 on this application. You can set it up with nodenv by running:
nodenv install 22.15.0
nodenv local 22.15.0If you don't already have nodenv installed, then you can do so with their easy installation package: npx @nodenv/nodenv-installer.
The client and server run separately in this project, so we recommend opening two terminals side-by-side.
In the first terminal, install the server dependencies:
cd ./code/server
npm installIn the second terminal, install the client dependencies:
cd ./code/client
npm installYou'll need to set up the environment variables on both sides of the project.
The Lora billing model depends on 4 products, 3 of which are metered. All of them have both monthly and recurring prices. You should have created these resources on your account earlier today, but if you haven't yet, then you'll find the instructions and commands for doing so in the Companion App's M4-1.
Visit the Customer Portal Settings page in your Stripe Dashboard to configure the billing portal.
There's a minimal smoke test written in Playwright to ensure that the application still starts once the Stripe integration has been redacted. Run it with the following commands:
npm install export PLAYWRIGHT_BROWSERS_PATH=0 npx playwright install --with-deps chromium npx playwright test
Note: Playwright installs browsers into a shared system directory by default. The environment variable exported above tells it to install browsers directly into this project folder, which is helpful on corporate devices which only allow binaries to be run from particular directories. If you don't have that constraint, then the variable can be omitted.
| Back | FazBrowse Home | New Git URL |