This repository contains the source code for the official Counterparty website (counterparty.io). Counterparty is a peer-to-peer financial platform and distributed, open-source Internet protocol built on the Bitcoin blockchain.
- Astro: Static site generator
- TinaCMS: Git-backed headless CMS for Markdown content
- Tailwind CSS: Styling
- TypeScript & React: Interactive components
/
├── public/
│ ├── images/ # Logos and assets (explorers, featured-collections, marketplaces, wallets, news)
│ └── uploads/ # Blog/news media uploads
├── src/
│ ├── components/
│ │ ├── home/ # Homepage sections (Header, WhatIsCounterparty, Wallets, Explorers, Collections, Marketplaces, LatestNews, Contribute)
│ │ ├── BlockCountdown.tsx
│ │ ├── CommonStyles.astro
│ │ ├── Footer.astro
│ │ └── Navbar.astro
│ ├── content/
│ │ ├── collections/ # TinaCMS collection schemas (*Collection.ts)
│ │ ├── explorers/ # Individual explorer entries (*.md)
│ │ ├── featured-collections/ # Featured collections list (featured-collections.md)
│ │ ├── header/ # Hero header content
│ │ ├── home/ # Homepage copy (WhatIsCounterparty, Contribute)
│ │ ├── marketplaces/ # Marketplaces list (marketplaces.md)
│ │ ├── news/ # News and development update posts (*.md)
│ │ ├── pages/ # Ordering lists for explorers and wallets
│ │ └── wallets/ # Individual wallet entries (*.md)
│ ├── layouts/
│ └── pages/ # Astro routes (index.astro, news/)
├── tina/
│ └── config.ts # TinaCMS configuration and schema registration
└── package.json
-
Clone the repository:
git clone https://github.com/CounterpartyXCP/Website.git cd Website -
Install dependencies:
npm install
-
Start the local development server (starts both TinaCMS and Astro):
npm run dev
| Command | Action |
|---|---|
npm run dev |
Starts tinacms dev and astro dev (localhost:4321) |
npm run tina |
Starts local TinaCMS GraphQL server (localhost:4001) |
npm run astro build |
Builds production site to ./dist/ (requires Tina running) |
npm run preview |
Previews the production build locally |
npm run astro ... |
Runs Astro CLI commands (astro add, astro check, etc.) |
All site content lives in src/content/ as Markdown with YAML frontmatter and is validated/queried through TinaCMS schemas in src/content/collections/ (registered in tina/config.ts). Adding a frontmatter field to a Markdown file without updating its Tina schema will cause the field to be stripped at render time.
There are three content patterns used in this repository:
Used by Wallets and Explorers. Each item is a separate Markdown file, and display order is controlled by a page list:
- Entry Markdown file:
src/content/<type>/<slug>.md - Ordering list:
src/content/pages/<type>/<type>.md(walletList/explorerList) - Tina schema:
src/content/collections/<type>Collection.ts - Astro component:
src/components/home/<Type>.astro - Images:
public/images/<type>/
To add a new wallet or explorer:
- Create
src/content/<type>/<slug>.mdwith frontmatter matching the collection schema. - Add
<slug>.mdto the list insrc/content/pages/<type>/<type>.md. - Place its logo in
public/images/<type>/.
Used by Collections and Marketplaces. All entries are stored directly as a YAML array inside a single Markdown file (order in the YAML array determines display order):
- Collections:
- Content file:
src/content/featured-collections/featured-collections.md(featuredCollectionList) - Tina schema:
src/content/collections/featuredCollectionsCollection.ts - Astro component:
src/components/home/Collections.astro - Images:
public/images/featured-collections/
- Content file:
- Marketplaces:
- Content file:
src/content/marketplaces/marketplaces.md(marketplaceList) - Tina schema:
src/content/collections/marketplacesCollection.ts - Astro component:
src/components/home/Marketplaces.astro - Images:
public/images/marketplaces/
- Content file:
- Content files:
src/content/news/<slug>.md - Tina schema:
src/content/collections/newsCollection.ts - Routes:
src/pages/news/[...page].astroandsrc/pages/news/[slug].astro
astro build queries the local TinaCMS GraphQL server (localhost:4001), so tinacms dev must be running in the background during the build:
TINA_PUBLIC_IS_LOCAL=true npx tinacms dev &
sleep 5
npx astro build
pkill -f "tinacms dev"There is no separate test suite — npx astro build validates the Tina schemas and content.
- Host:
www.counterparty.io(161.35.121.212, DigitalOcean dropletcounterparty-websiteinnyc1) - Checkout Path:
/var/www/Website - Web Root:
/var/www/Website/dist(served statically by Nginx) - Nginx Config:
/etc/nginx/sites-available/default- Redirects
http://->https://andcounterparty.io->https://www.counterparty.io - Proxies
https://www.counterparty.io/protocol_changes.jsontoraw.githubusercontent.com/CounterpartyXCP/counterparty-core/refs/heads/master/counterparty-core/counterpartycore/protocol_changes.json(with IPv4 resolveripv6=off) - TLS certificates are managed by Certbot (
/etc/letsencrypt/live/counterparty.io/)
- Redirects
After merging changes to master on GitHub:
ssh root@161.35.121.212
export PATH="/root/.nvm/versions/node/v20.18.0/bin:$PATH"
cd /var/www/Website
git pull
TINA_PUBLIC_IS_LOCAL=true npx tinacms dev &
sleep 5
npx astro build
pkill -f "tinacms dev"Since Nginx serves /var/www/Website/dist directly, changes take effect as soon as npx astro build completes (no Nginx reload required unless /etc/nginx/sites-available/default was modified).
The documentation site at docs.counterparty.io is maintained in a separate repository (CounterpartyXCP/Documentation) and hosted on GitHub Pages from its gh-pages branch. To publish documentation updates from a local clone of Documentation:
cd Documentation
git pull origin master
USE_SSH=true npm run deploy- Fork the repository and create a branch (
git checkout -b feature/your-feature-name). - Make your changes and verify the build succeeds with
tinacms dev+npx astro build. - Commit, push to your fork, and open a Pull Request against
master.
This work is licensed under CC BY 4.0.