Stellar Tags is a payment platform that combines a Soroban smart contract, a Node.js server, and a React dashboard. It is structured as a small mono-repo so each piece can be developed and deployed independently while still working together as a single product.
payment-dashboard/- React + Vite frontend dashboard.stellar-payment-platform/- Node.js server for API and business logic.payment_router/- Rust/Soroban contract.
- Desired specific username
- Fast transfer
- Secured payment flows
The following diagram maps exactly how data flows between the user, Vercel, Railway, and the Stellar network.
[ User / Browser ]
|
| (Vite App hosted on Vercel)
v
[ payment-dashboard ]
(src/App.jsx: Wallet connections & UI)
|
| HTTP API Calls (via VITE_API_BASE)
v
[ stellar-payment-platform ] <---> [ PostgreSQL Database ]
(server.js: Server router on Railway) (via Prisma ORM: User/payment layout)
|
| Stellar Network / RPC
v
[ payment_router ]
(src/lib.rs: Soroban smart contract routing logic)
Data Flow:
- User accesses the
payment-dashboardand connects their Stellar wallet. - The dashboard queries the
stellar-payment-platformserver for user registrations and payment routing information. - The server interacts with its PostgreSQL database (via the Prisma ORM) to resolve usernames to addresses using the endpoints documented below.
- When a payment is initiated, it's routed through the
payment_routerSoroban contract on the Stellar network.
.
├── payment-dashboard/
│ ├── .env # Frontend environment variables
│ └── src/
│ └── App.jsx # Wallet connections and React UI
├── payment_router/
│ └── src/
│ └── lib.rs # Soroban smart contract logic
└── stellar-payment-platform/
├── server.js # Server router (Express API endpoints)
└── prisma/
└── schema.prisma # Prisma schema for the PostgreSQL database
These steps are split by module so you can run only what you need.
cd payment-dashboard
npm install
npm run devThe server uses PostgreSQL as its database, accessed through the Prisma ORM. You need a running Postgres instance (local install, Docker, or a hosted provider) before starting the server.
cd stellar-payment-platform
npm install
# 1. Create your local env file and point DATABASE_URL at your Postgres DB
cp .env.example .env
# then edit .env (see "Database setup" below)
# 2. Apply the schema to your database
npm run prisma:migrate
# 3. Start the server
npm run devThe connection string lives in stellar-payment-platform/.env as DATABASE_URL.
Copy .env.example to .env and set it to your own Postgres database:
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public"For a typical local install that becomes, for example:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/stellar_tags?schema=public"The quickest way to get a local database is Docker:
docker run --name stellar-postgres -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=stellar_tags -p 5432:5432 -d postgres:16Useful Prisma commands (run from stellar-payment-platform/):
| Command | Description |
|---|---|
npm run prisma:migrate |
Create/apply migrations against your dev database |
npm run prisma:deploy |
Apply existing migrations (CI / production) |
npm run prisma:generate |
Regenerate the Prisma Client after schema changes |
npm run prisma:studio |
Open Prisma Studio to browse the data |
.envis gitignored — never commit real credentials. Each contributor keeps their own localDATABASE_URL.
cd payment_router
cargo build# frontend
cd payment-dashboard
npm test
# server
cd ../stellar-payment-platform
npm test
# contract
cd ../payment_router
cargo testTo ensure a seamless local developer installation requiring zero guesswork, please configure the following environment variables in their respective directories:
VITE_API_BASE- The base URL where the frontend expects the Node.js server API to be running (e.g.,http://localhost:5000).
DATABASE_URL- (Required) PostgreSQL connection string used by Prisma (see Database setup).PORT- (Optional) The port for the Node.js server to listen on. Defaults to5000.HORIZON_NETWORK- (Optional) Stellar network for the payment listener:testnet(default) orpublic.STELLAR_TAG_DOMAIN- (Optional) Extra origin to add to the CORS allow-list.
The Node.js server (stellar-payment-platform/server.js) exposes the following endpoints for username and payment lookups:
Resolves a given username tag to a Stellar address.
- Query Parameter:
q(string) - The username tag to lookup (e.g.,alice*localhost). - Returns: A JSON object with
stellar_address,account_id,memo_type, andmemo. - Status Codes:
200 OK: Address found.400 Bad Request: Missingqparameter.404 Not Found: Name tag not found.500 Internal Server Error: Database lookup failed.
Registers a new username and associates it with a Stellar address.
- Body Parameters (JSON):
username(string) - The desired username.address(string) - The user's Stellar address.
- Returns: A JSON object with registration details
{ ok: true, username, address }. - Status Codes:
200 OK: Registration successful.400 Bad Request: Missingusernameoraddress.409 Conflict: Address or username already registered.500 Internal Server Error: Database lookup or insertion failed.
Resolves a given Stellar address to its registered username.
- Query Parameter:
address(string) - The Stellar address to lookup. - Returns: A JSON object with
usernameandaddress. - Status Codes:
200 OK: Username found.400 Bad Request: Missingaddressparameter.404 Not Found: Username not found for this address.500 Internal Server Error: Database lookup failed.
A simple health check endpoint.
- Returns:
{ status: 'ok' } - Status Codes:
200 OK.
- The React dashboard runs on
http://localhost:3000in dev (Vite) and provides the UI. - The dashboard calls the Node.js API at
http://localhost:5000viaVITE_API_BASEand a/apiproxy. - The Soroban contract handles on-chain payment routing logic.
See LICENSE.