-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add docker-compose for frontend + quickstart docs #177
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
Open
tvinagre
wants to merge
2
commits into
main
Choose a base branch
from
tl/feat-docker-compose-frontend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+115
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,43 @@ | ||
| # Starts Fynd router + swap frontend. | ||
| # | ||
| # Usage: | ||
| # export TYCHO_API_KEY=your-api-key | ||
| # docker compose -f docker-compose.frontend.yml up | ||
| # Open http://localhost:3005 | ||
| # | ||
| # Required env vars (set in .env or export before running): | ||
| # TYCHO_API_KEY — Tycho API key (https://t.me/fynd_portal_bot) | ||
| # | ||
| # Optional env vars: | ||
| # CHAIN — chain name (default: Ethereum) | ||
| # PROTOCOLS — comma-separated protocol list (default: mainnet preset) | ||
| # TYCHO_URL — Tycho WebSocket endpoint (default: tycho-fynd-ethereum.propellerheads.xyz) | ||
| # RUST_LOG — tracing filter (default: fynd=info) | ||
|
|
||
| services: | ||
| fynd-serve: | ||
| image: ghcr.io/propeller-heads/fynd:latest | ||
| entrypoint: ["/usr/local/bin/fynd"] | ||
| command: | ||
| - serve | ||
| - "--chain" | ||
| - "${CHAIN:-Ethereum}" | ||
| - "--protocols" | ||
| - "${PROTOCOLS:-uniswap_v2,uniswap_v3,ekubo_v2,pancakeswap_v3,sushiswap_v2,fluid_v1,pancakeswap_v2}" | ||
| ports: | ||
| - "3000:3000" | ||
| environment: | ||
| - TYCHO_API_KEY=${TYCHO_API_KEY} | ||
| - TYCHO_URL=${TYCHO_URL:-tycho-fynd-ethereum.propellerheads.xyz} | ||
| - RUST_LOG=${RUST_LOG:-fynd=info} | ||
|
|
||
| fynd-frontend: | ||
| image: ghcr.io/propeller-heads/fynd-frontend:latest | ||
| ports: | ||
| - "3005:3005" | ||
| environment: | ||
| - PATHFINDER_BASE_URL=http://fynd-serve:3000 | ||
| - TYCHO_AUTH_TOKEN=${TYCHO_API_KEY} | ||
| - TYCHO_BASE_URL=${TYCHO_BASE_URL:-https://tycho-beta.propellerheads.xyz} | ||
| depends_on: | ||
| - fynd-serve |
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,71 @@ | ||
| --- | ||
| description: Swap via Fynd using the web frontend — no CLI, no private keys. | ||
| icon: browser | ||
| layout: | ||
| width: default | ||
| title: | ||
| visible: true | ||
| description: | ||
| visible: true | ||
| tableOfContents: | ||
| visible: true | ||
| outline: | ||
| visible: true | ||
| pagination: | ||
| visible: true | ||
| metadata: | ||
| visible: true | ||
| tags: | ||
| visible: true | ||
| --- | ||
|
|
||
| # Quickstart (Frontend) | ||
|
|
||
| Run the Fynd swap frontend locally with Docker Compose. Connect your browser wallet (MetaMask, Ledger, etc.) and swap — no private key export required. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| * **Docker** ([install Docker](https://docs.docker.com/get-started/get-docker/)) | ||
| * **Tycho API key** (set as `TYCHO_API_KEY`, [get one here](https://t.me/fynd_portal_bot)) | ||
|
|
||
| ## Step 0 — Start Fynd + Frontend | ||
|
|
||
| ```bash | ||
| export TYCHO_API_KEY=your-api-key | ||
| docker compose -f docker-compose.frontend.yml up | ||
| ``` | ||
|
|
||
| This pulls two images and starts them: | ||
| - **Fynd router** on port 3000 — finds optimal swap routes | ||
| - **Swap frontend** on port 3005 — the web UI you interact with | ||
|
|
||
| ## Step 1 — Connect your wallet | ||
|
|
||
| Open [http://localhost:3005](http://localhost:3005) in your browser. | ||
|
|
||
| Click **Connect Wallet** in the top-right corner and connect your wallet (MetaMask, WalletConnect, Coinbase Wallet, or any injected wallet). | ||
|
|
||
| {% hint style="info" %} | ||
| The router needs ~30 seconds to load market data after starting. The UI will show a loading state until the router is ready — this is normal on first launch. | ||
| {% endhint %} | ||
|
|
||
| ## Step 2 — Swap | ||
|
|
||
| 1. Select the token you want to sell (top input) | ||
| 2. Select the token you want to buy (bottom input) | ||
| 3. Enter the amount to sell | ||
| 4. Click **Get Route** to fetch the best route | ||
| 5. Review the route details (price impact, gas estimate, route visualization) | ||
| 6. Click **Swap** to execute — your wallet will prompt you to sign the transaction | ||
|
|
||
| ## Stopping | ||
|
|
||
| ```bash | ||
| docker compose -f docker-compose.frontend.yml down | ||
| ``` | ||
|
|
||
| ## Next steps | ||
|
|
||
| * [Server configuration](../../guides/server-configuration.md) — customize the router (protocols, timeouts, worker pools) | ||
| * [Quickstart (CLI/SDK)](../quickstart/) — integrate Fynd programmatically with TypeScript or Rust | ||
| * [API reference](../../reference/api.md) — full endpoint documentation | ||
Oops, something went wrong.
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.
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.
This should become the main quickstart IMO