Skip to content

Emmy123222/Stellar-MarketPay-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

384 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ Stellar MarketPay

A decentralised freelance marketplace powered by Stellar blockchain and Soroban smart contracts.

License: MIT PRs Welcome Stellar Soroban Backend Coverage

Stellar MarketPay is an open-source decentralised freelance marketplace where clients post jobs, freelancers apply, and payments are secured in Soroban smart contract escrow β€” released automatically when work is approved. No middlemen. No payment delays. No platform fees eating your earnings..


✨ Features (v1)

  • πŸ”— Wallet Connect β€” Freighter browser wallet integration
  • πŸ“‹ Post Jobs β€” Clients post jobs with XLM budget locked in escrow
  • πŸ™‹ Apply & Bid β€” Freelancers apply with proposals
  • πŸ”’ Escrow Payments β€” Funds held in Soroban contract until work approved
  • βœ… Release & Complete β€” Client approves β†’ funds released to freelancer instantly
  • πŸ“œ Job History β€” Track all your jobs and earnings on-chain

πŸ—‚ Project Structure

stellar-marketpay/
β”œβ”€β”€ frontend/          # Next.js + React + Tailwind CSS
β”œβ”€β”€ backend/           # Node.js + Express API
β”œβ”€β”€ contracts/         # Stellar Soroban smart contracts (Rust)
β”œβ”€β”€ docs/              # Architecture & API documentation
β”œβ”€β”€ scripts/           # Deployment & utility scripts
β”œβ”€β”€ .github/           # CI/CD workflows & issue templates
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ ROADMAP.md
└── LICENSE

πŸš€ Quick Start

Prerequisites

Tool Version
Node.js β‰₯ 18.x
npm Latest
Rust + Cargo β‰₯ 1.74 (for contracts)
Freighter Wallet Browser extension

1. Clone

git clone https://github.com/your-org/stellar-marketpay.git
cd stellar-marketpay

2. One-command setup

chmod +x scripts/setup-dev.sh
./scripts/setup-dev.sh

3. Start Frontend

cd frontend
npm run dev
# β†’ http://localhost:3000

4. Start Backend

cd backend
npm run dev
# β†’ http://localhost:4000

πŸ”‘ Environment Variables

See docs/environment-variables.md for the full list of backend and frontend variables, validation rules, and examples.

Deploy the Soroban escrow contract with docs/contract-deployment.md.

Frontend (frontend/.env.local)

NEXT_PUBLIC_API_URL=http://localhost:4000
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
NEXT_PUBLIC_CONTRACT_ID=CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
NEXT_PUBLIC_USE_CONTRACT_MOCK=false

Backend (backend/.env)

PORT=4000
DATABASE_URL=postgresql://stellarwork:stellarwork_dev@localhost:5432/stellarwork
JWT_SECRET=replace-with-a-long-random-secret
STELLAR_NETWORK=testnet
HORIZON_URL=https://horizon-testnet.stellar.org
CONTRACT_ID=CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ALLOWED_ORIGINS=http://localhost:3000

πŸ§ͺ Offline Development with Contract Mock

For frontend development without a deployed Soroban contract:

  1. Enable mock mode in frontend/.env.local:

    NEXT_PUBLIC_USE_CONTRACT_MOCK=true
  2. Start the frontend:

    cd frontend
    npm run dev
  3. What works offline:

    • βœ… Job creation with escrow locking
    • βœ… Start work, release escrow, refund escrow
    • βœ… Query escrow status and records
    • βœ… All contract calls logged to browser console
    • βœ… Realistic delays and error simulation
    • βœ… No Freighter signing required
    • βœ… No network calls to Stellar/Soroban
  4. Check the console: All mock contract calls are logged with [CONTRACT MOCK] prefix for debugging.

  5. Switch back to real contract: Set NEXT_PUBLIC_USE_CONTRACT_MOCK=false and provide a valid NEXT_PUBLIC_CONTRACT_ID.


πŸ§ͺ Get Testnet XLM

  1. Install Freighter Wallet
  2. Switch to Testnet in Freighter settings
  3. Visit Stellar Friendbot with your public key
  4. Receive 10,000 test XLM instantly

Testing

Suite Command Notes
Frontend unit snapshots cd frontend && npm test Jest + React Testing Library
Update snapshots cd frontend && npm run test:update-snapshots Regenerate when UI changes are intentional
Backend unit + coverage cd backend && npm test HTML report in backend/coverage/
E2E (Playwright) cd frontend && npm run test:e2e Includes full client/freelancer marketplace flow

Deploy or upgrade the Soroban escrow contract using docs/contract-deployment.md.


🀝 Contributing

See CONTRIBUTING.md to get started. All skill levels welcome!

πŸ—Ί Roadmap

See ROADMAP.md for planned features.

πŸ“„ License

MIT β€” see LICENSE

About

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors