-
Notifications
You must be signed in to change notification settings - Fork 12
docs: Improve and expand project documentation #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DarianM
merged 17 commits into
interledger:main
from
p-retrover:docs/improve-env-vars-guide
Oct 16, 2025
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fe584b0
docs: improve environment variable documentation
p-retrover b0fb7db
Merge branch 'main' into docs/improve-env-vars-guide
p-retrover bf38fdb
Update frontend/README.md
p-retrover 4c37165
docs: address suggestions on documentation PR
p-retrover c23cdbb
Merge branch 'docs/improve-env-vars-guide' of https://github.com/p-re…
p-retrover 3253ee9
docs: improve environment variables guide
p-retrover 1823f9c
Merge branch 'main' into docs/improve-env-vars-guide
p-retrover 57a8ddc
Update docs/env-vars.md
p-retrover 0e3f6c7
Update docs/env-vars.md
p-retrover 44f04b9
Update docs/env-vars.md
p-retrover f0d9b80
Update docs/env-vars.md
p-retrover 25f24ac
Update frontend/README.md
p-retrover 36081ae
Update docs/env-vars.md
p-retrover 4fb8c6b
Update docs/env-vars.md
p-retrover 0c9124b
format
DarianM a56d306
Properly formated the docs using prettier
p-retrover 65b80d9
Merge remote-tracking branch 'origin/docs/improve-env-vars-guide' int…
p-retrover File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Publisher Tools - API | ||
|
|
||
| This package contains the Hono-based API server that powers the Publisher Tools. It runs on Cloudflare Workers and is responsible for fetching tool configurations, handling Open Payments, and managing probabilistic revenue sharing. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| The API exposes endpoints related to the following functionalities: | ||
|
|
||
| * **Tool Configuration:** Handles fetching the configuration for the monetization tools (see `src/routes/get-config.ts`). | ||
| * **Payments:** Manages the Open Payments flow (see `src/routes/payment.ts`). | ||
| * **Probabilistic Revshare:** Handles logic related to probabilistic revenue sharing (see `src/routes/probabilistic-revshare.ts`). | ||
|
|
||
| ## Development | ||
|
|
||
| To run the API server for local development, you can use the `dev` script from the project root: | ||
|
|
||
| ```sh | ||
| pnpm -C api dev | ||
| ``` | ||
|
|
||
| This will start the Cloudflare Wrangler development server, which automatically reloads on file changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Publisher Tools - CDN | ||
|
|
||
| This package is responsible for building and delivering the final, browser-ready JavaScript assets (the banner and widget scripts) that publishers embed on their websites. | ||
|
|
||
| It takes the raw source code from the `@tools/components` package, bundles it using `esbuild`, and prepares it for delivery via the Cloudflare CDN. | ||
|
|
||
| ## Build Process | ||
|
|
||
| The core of this package is the custom build script located at `build.js`. This script uses `esbuild` to compile the TypeScript source from `src/` and the components from the `components` package into distributable files. | ||
|
|
||
| The main entry points for the build are: | ||
| * `src/banner.ts` | ||
| * `src/widget.ts` | ||
|
|
||
| The output is placed in the `dist/` directory. | ||
|
|
||
| ## Assets | ||
|
|
||
| This package also manages static assets required by the components, such as fonts. The build process ensures that these assets are correctly referenced and made available through the CDN. Fonts are located in the `src/assets/fonts` directory. | ||
|
|
||
| ## Development | ||
|
|
||
| To build the assets and run a local development server that simulates the CDN, use the `dev` script from the project root. This will watch for file changes in both the `cdn` and `components` packages and automatically rebuild. | ||
|
|
||
| ```sh | ||
| pnpm -C cdn dev | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Publisher Tools - Components | ||
|
|
||
| This package contains the core, embeddable web components for the Publisher Tools, built using the [Lit](https://lit.dev/) library. These components are intended to be placed on publishers' websites. | ||
|
|
||
| ## Core Components | ||
|
|
||
| * **Banner:** A notification banner that can be displayed on a publisher's site. The source is located in `src/banner.ts`. | ||
| * **Widget:** The interactive monetization widget. Its source code is in the `src/widget/` directory. | ||
|
|
||
| ## Build Process | ||
|
|
||
| This package contains the raw source code for the web components but does not have its own build process. | ||
|
|
||
| The components are imported and bundled by the **`cdn`** package, which is responsible for compiling them into a browser-ready format. They are also used by the **`frontend`** package for demonstration purposes. | ||
|
|
||
| Please see the `cdn` package for more details on the build and delivery process. | ||
|
|
||
| ## Development | ||
|
|
||
| The only available script is for type checking, which can be run from the project root: | ||
|
|
||
| ```sh | ||
| pnpm -C components typecheck | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Publisher Tools - Frontend | ||
|
|
||
| This package contains the Remix frontend application for the Publisher Tools, providing a user-friendly dashboard for publishers to configure and manage monetization on their websites. | ||
|
|
||
| ## Core Features | ||
|
|
||
| The dashboard allows users to customize and generate code for the following tools: | ||
|
|
||
| * **Index (`/`):** The main landing page that offers an overview of the available monetization tools. | ||
| * **Banner (`/banner`):** A tool to create a customizable notification banner that can be displayed on a publisher's website, often used to inform users about monetization or request consent. | ||
| * **Widget (`/widget`):** A configuration page for the monetization widget, which provides users with a clear and interactive way to make payments or donations. | ||
| * **Link Tag (`/link-tag`):** A simple tool for generating a monetized `<link>` tag, which can be embedded in a website to enable Web Monetization. | ||
| * **Probabilistic Revshare (`/prob-revshare`):** A UI for setting up probabilistic revenue sharing, allowing publishers to distribute incoming payments among multiple recipients based on assigned weights. | ||
| * **Payment Confirmation (`/payment-confirmation`):** A dedicated page to display the status of a payment to the user. Embedded tools may redirect users to this page after a payment is completed or fails. | ||
|
|
||
| The application also includes API routes (e.g., `api.config.$type.ts`) that are handled by the Remix server to manage configuration and other backend tasks. | ||
|
|
||
| ## Development | ||
|
|
||
| To run the frontend application for local development, use the `dev` script from the project root: | ||
|
|
||
| ```sh | ||
| pnpm -C frontend dev | ||
| ``` | ||
|
|
||
| This will start the Remix development server, typically available at `http://localhost:3000`. | ||
|
p-retrover marked this conversation as resolved.
Outdated
p-retrover marked this conversation as resolved.
Outdated
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.