-
Notifications
You must be signed in to change notification settings - Fork 10
Add contributing guide with LLM quick start instructions #302
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
Changes from 1 commit
e855f38
fa2d2d7
5c37c4e
02253af
05a342c
3424c08
00d7492
4277681
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,120 @@ | ||||||||||||
| # Contributing to Freighter Backend (V1) | ||||||||||||
|
|
||||||||||||
| TypeScript backend service powering the Freighter wallet. Provides indexing, | ||||||||||||
| subscriptions, feature flags, notifications, token balances, and pricing data. | ||||||||||||
|
|
||||||||||||
| For the Stellar organization's general contribution guidelines, see the | ||||||||||||
| [Stellar Contribution Guide](https://github.com/stellar/.github/blob/master/CONTRIBUTING.md). | ||||||||||||
|
|
||||||||||||
| ## Prerequisites | ||||||||||||
|
|
||||||||||||
| | Tool | Version | Install | | ||||||||||||
| | ------ | --------- | ------------------------------------------------------------ | | ||||||||||||
| | Node.js | >= 25.3.0 | [nodejs.org](https://nodejs.org) or `nvm install 25` | | ||||||||||||
| | Yarn | >= 1.22.5 | `npm install --global yarn` | | ||||||||||||
| | Docker | Latest | [docker.com](https://docs.docker.com/get-docker/) (for Redis) | | ||||||||||||
|
|
||||||||||||
| ## Getting Started | ||||||||||||
|
|
||||||||||||
| ### Quick Setup with an LLM | ||||||||||||
|
|
||||||||||||
| If you use an LLM-powered coding assistant, you can automate the setup. The repo | ||||||||||||
| includes a quick start guide ([`LLM-QUICK-START.md`](LLM-QUICK-START.md)) that | ||||||||||||
| checks your environment, installs missing tools, configures `.env`, and verifies | ||||||||||||
| the build. | ||||||||||||
|
|
||||||||||||
| Point your LLM assistant at `LLM-QUICK-START.md` and ask it to follow the steps. | ||||||||||||
|
|
||||||||||||
| If you don't use an LLM assistant, follow the manual setup below. | ||||||||||||
|
|
||||||||||||
| ### Manual Setup | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| git clone https://github.com/stellar/freighter-backend.git | ||||||||||||
| cd freighter-backend | ||||||||||||
| cp .env-EXAMPLE .env # Then fill in values (see below) | ||||||||||||
| yarn install | ||||||||||||
| yarn start # Dev mode (uses in-memory store, no Redis needed) | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| For production mode (requires Redis): | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| docker compose up -d # Starts Redis Stack on port 6379 | ||||||||||||
| yarn build:prod | ||||||||||||
| node build/index.js | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| ### Environment Variables | ||||||||||||
|
|
||||||||||||
| Copy `.env-EXAMPLE` to `.env`. For local development with `yarn start`, most | ||||||||||||
| variables can be left as `not-set` — the app uses an in-memory store by default. | ||||||||||||
|
||||||||||||
| variables can be left as `not-set` — the app uses an in-memory store by default. | |
| variables can remain `not-set` because the app uses an in-memory store by | |
| default. **Exception:** `FREIGHTER_TRUST_PROXY_RANGE` must be left empty or set | |
| to a valid proxy-addr range such as `127.0.0.1/32` for local dev; do not leave | |
| it as the literal string `not-set`. |
Copilot
AI
Apr 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HOSTNAME is described as the server hostname, but in the current code it’s used as the Redis host (and passed into Redis-backed workers). Consider renaming the description to something like “Redis hostname”/“Redis host” to avoid contributors setting this incorrectly.
| | `HOSTNAME` | Server hostname | `localhost` | | |
| | `HOSTNAME` | Redis hostname | `localhost` | |
Copilot
AI
Apr 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COINBASE_API_KEY/SECRET doesn’t match the actual env var names in .env-EXAMPLE / config (COINBASE_API_KEY and COINBASE_API_SECRET). Please update the docs to list the exact variable names so contributors can copy/paste them correctly.
| | `COINBASE_API_KEY/SECRET` | Pricing data | Leave as `not-set` for local dev | | |
| | `COINBASE_API_KEY` / `COINBASE_API_SECRET` | Pricing data | Leave as `not-set` for local dev | |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,97 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| # Freighter Backend V1 — LLM Quick Start | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Evaluate the contributor's machine against all prerequisites for | ||||||||||||||||||||||||||||||||||||||||||||||||
| freighter-backend (TypeScript/Fastify), install what's missing, and run the | ||||||||||||||||||||||||||||||||||||||||||||||||
| initial setup. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| ## Step 1: Check all prerequisites | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Run every check and collect results. Report all at once. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||||||||||
| # Node.js >= 25.3.0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| node --version 2>&1 || which node | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Yarn | ||||||||||||||||||||||||||||||||||||||||||||||||
| yarn --version 2>&1 || which yarn | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Docker (needed for Redis in production mode) | ||||||||||||||||||||||||||||||||||||||||||||||||
| docker --version 2>&1 || which docker | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Docker Compose | ||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose version 2>&1 || which docker-compose | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose version 2>&1 || which docker-compose | |
| docker compose version 2>&1 || docker-compose --version 2>&1 |
Copilot
AI
Apr 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup flow implies cp .env-EXAMPLE .env is sufficient, but the app currently hard-requires additional env keys that are not present in .env-EXAMPLE (notably FREIGHTER_RPC_PUBNET_URL and FREIGHTER_TRUST_PROXY_RANGE via src/config.ts’s ENV_KEYS check). Following these instructions will fail with an invalid/missing env error unless those keys are added. Please either (a) update this guide to explicitly add/set those missing variables, or (b) update .env-EXAMPLE (ideally in this PR) so copy/paste setup works as documented.
| For local development with `yarn start`, most values can stay as `not-set` — the | |
| app uses an in-memory store. Set these for basic operation: | |
| | Variable | Value for local dev | | |
| | --------------------- | ------------------------- | | |
| | `MODE` | `development` | | |
| | `HOSTNAME` | `localhost` | | |
| | `REDIS_PORT` | `6379` | | |
| | `REDIS_CONNECTION_NAME` | `freighter-dev` | | |
| Copying `.env-EXAMPLE` is only the starting point. Before the app will boot, | |
| make sure all required environment variables are set in `.env`. | |
| For local development with `yarn start`, most values can stay as `not-set` — the | |
| app uses an in-memory store. Set these for basic operation: | |
| | Variable | Value for local dev | | |
| | ------------------------------ | ------------------------------------ | | |
| | `MODE` | `development` | | |
| | `HOSTNAME` | `localhost` | | |
| | `REDIS_PORT` | `6379` | | |
| | `REDIS_CONNECTION_NAME` | `freighter-dev` | | |
| | `FREIGHTER_RPC_PUBNET_URL` | Your pubnet RPC URL | | |
| | `FREIGHTER_TRUST_PROXY_RANGE` | `127.0.0.1/32` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker compose up -d+cp .env-EXAMPLE .envis described as a working starting point, but the runtime env validation currently requires additional keys that are not present in.env-EXAMPLE(e.g.FREIGHTER_RPC_PUBNET_URLandFREIGHTER_TRUST_PROXY_RANGEinsrc/config.ts). As written, a fresh clone will error on startup unless the contributor adds those variables. Please document the missing required variables here (or update.env-EXAMPLEin the same PR) so the manual setup is actually runnable.