DEV Community

Daniel Ioni
Daniel Ioni

Posted on

๐Ÿš€ MyZubster: Complete Technical Guide to Install, Run & Contribute

๐Ÿš€ MyZubster: Complete Technical Guide to Install, Run & Contribute

A step-by-step guide to setting up your own decentralized freelance marketplace with Monero payments
A step-by-step guide to setting up your own decentralized freelance marketplace with Monero payments
๐Ÿ“Œ What is MyZubster?

MyZubster is an open-source ecosystem for peer-to-peer service marketplaces powered by Monero (XMR). It allows anyone to create a freelance marketplace where:

Buyers and sellers connect directly

Payments are made in Monero โ€“ private and untraceable

Funds are secured through multi-signature escrow

Communications are end-to-end encrypted

Users can remain anonymous with Tor/Orbot integration
Enter fullscreen mode Exit fullscreen mode

๐Ÿงฉ Architecture Overview

MyZubster is built with three core components:
text

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ MyZubster Ecosystem โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Gateway โ”‚โ—„โ”€โ”€โ–บโ”‚ Marketplace โ”‚โ—„โ”€โ”€โ–บโ”‚ App โ”‚ โ”‚
โ”‚ โ”‚ (Monero) โ”‚ โ”‚ (Backend) โ”‚ โ”‚ (Mobile) โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ–ผ โ–ผ โ–ผ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Blockchain โ”‚ โ”‚ Database โ”‚ โ”‚ Users โ”‚ โ”‚
โ”‚ โ”‚ (Monero) โ”‚ โ”‚ (SQLite) โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Component Role Tech Stack
Gateway Monero payment engine Node.js, Express, MongoDB, monero-javascript
Marketplace Backend API Node.js, Express, Sequelize, SQLite, JWT
App Mobile client React Native, Expo, PGP, Tor/Orbot
๐Ÿ› ๏ธ Prerequisites

Before you start, make sure you have:
Requirement Version Notes
Node.js v18 or higher node -v to check
npm v9 or higher npm -v to check
Git Latest git --version to check
Docker Latest (optional) For containerized deployment
Windows WSL2 recommended For Linux commands
Mac/Linux Native Works out of the box
๐Ÿš€ Installation Guide
1๏ธโƒฃ Clone the Repository
bash

git clone https://github.com/DanielIoni-creator/myzubster.git
cd myzubster

This will download all three components into a single folder.
2๏ธโƒฃ Install Dependencies
๐Ÿ“ฆ Gateway
bash

cd gateway
npm install
cd ..

๐Ÿ“ฆ Marketplace
bash

cd marketplace
npm install
cd ..

๐Ÿ“ฆ App (optional)
bash

cd app
npm install
cd ..

3๏ธโƒฃ Configure Environment Variables

Each component needs a .env file. Copy the examples:
Gateway
bash

cp gateway/.env.example gateway/.env

Edit gateway/.env:
env

PORT=3000
NODE_ENV=development
MONERO_RPC_URL=http://localhost:18081
MONERO_RPC_USERNAME=
MONERO_RPC_PASSWORD=
MONGODB_URI=mongodb://localhost:27017/myzubster
JWT_SECRET=your_gateway_jwt_secret
WEBHOOK_URL=http://localhost:4000/webhook/order-update
WEBHOOK_SECRET=your_webhook_secret
LOG_LEVEL=info

Marketplace
bash

cp marketplace/.env.example marketplace/.env

Edit marketplace/.env:
env

PORT=4000
NODE_ENV=development
DATABASE_URL=sqlite:./database.sqlite
JWT_SECRET=your_marketplace_jwt_secret
MYZUBSTER_API_URL=http://localhost:3000/api
MYZUBSTER_API_TOKEN=your_admin_token
WEBHOOK_SECRET=your_webhook_secret
COMMISSION_PERCENTAGE=2.0

App
bash

cp app/.env.example app/.env

Edit app/.env:
env

API_URL=http://localhost:4000/api
GOOGLE_MAPS_API_KEY=your_google_maps_key
MONERO_NETWORK=stagenet

โš ๏ธ Important: Never commit .env files to GitHub. They are already in .gitignore.
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”ง Running MyZubster
Option A: Running Components Separately
1๏ธโƒฃ Start MongoDB (for Gateway)

Using Docker:
bash

docker run -d -p 27017:27017 --name mongodb mongo:6

Or install MongoDB locally: MongoDB Installation Guide
2๏ธโƒฃ Start the Gateway

Terminal 1:
bash

cd gateway
npm run dev

Expected output:
text

๐Ÿš€ Server avviato sulla porta 3000
โœ… Connesso a MongoDB
๐Ÿ“ฆ Database: mongodb://localhost:27017/myzubster

3๏ธโƒฃ Start the Marketplace

Terminal 2:
bash

cd marketplace
npm run dev

Expected output:
text

๐Ÿš€ Marketplace avviato su http://localhost:4000
โœ… Connessione database stabilita
๐Ÿ“ฆ Database sincronizzato

4๏ธโƒฃ Start the App (React Native/Expo)

Terminal 3:
bash

cd app
npm start

or

expo start

Scan the QR code with the Expo Go app on your phone, or press a to run on Android emulator.
Option B: Using Docker Compose (All Services)
bash

From the root directory

docker-compose up -d

This starts:

MongoDB (port 27017)

Gateway (port 3000)

Marketplace (port 4000)

App (port 19000)
Enter fullscreen mode Exit fullscreen mode

Verify all services are running:
bash

docker-compose ps

๐Ÿงช Testing the Flow

Once all services are running, you can test the full flow.
1๏ธโƒฃ Health Checks
bash

Gateway

curl -s http://localhost:3000/api/health

Marketplace

curl -s http://localhost:4000/api/health

Expected response:
json

{"status":"OK","message":"MyZubster Gateway is running!"}
{"status":"ok","service":"Marketplace API"}

2๏ธโƒฃ Register a Buyer
bash

curl -X POST http://localhost:4000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"buyer@test.com","password":"test123","username":"buyer","name":"Buyer Test"}'

3๏ธโƒฃ Register a Seller
bash

curl -X POST http://localhost:4000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"seller@test.com","password":"test123","username":"seller","name":"Seller Test"}'

4๏ธโƒฃ Promote Seller to Seller Role
bash

SQLite command

sqlite3 marketplace/database.sqlite "UPDATE Users SET role = 'seller' WHERE email = 'seller@test.com';"

5๏ธโƒฃ Login as Buyer
bash

BUYER_TOKEN=$(curl -s -X POST http://localhost:4000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"buyer@test.com","password":"test123"}' | jq -r .token)
echo $BUYER_TOKEN

6๏ธโƒฃ Login as Seller
bash

SELLER_TOKEN=$(curl -s -X POST http://localhost:4000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"seller@test.com","password":"test123"}' | jq -r .token)
echo $SELLER_TOKEN

7๏ธโƒฃ Create a Skill (Seller)
bash

SKILL_ID=$(curl -s -X POST http://localhost:4000/api/skills \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SELLER_TOKEN" \
-d '{"title":"React Native Developer","description":"I build mobile apps","price":150,"category":"development"}' | jq -r .id)
echo $SKILL_ID

8๏ธโƒฃ Create an Order (Buyer)
bash

ORDER_ID=$(curl -s -X POST http://localhost:4000/api/orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $BUYER_TOKEN" \
-d "{\"skillId\":$SKILL_ID}" | jq -r .id)
echo $ORDER_ID

9๏ธโƒฃ Check Order Status
bash

curl -X GET http://localhost:4000/api/orders/$ORDER_ID \
-H "Authorization: Bearer $BUYER_TOKEN" | jq

Expected output:
json

{
"id": 1,
"buyerId": 1,
"skillId": 1,
"amount": 150,
"currency": "USD",
"moneroAddress": "8A1B2C3D...",
"moneroAmount": 150,
"status": "pending",
"network": "testnet"
}

๐Ÿ“ก API Endpoints Reference
Public Endpoints
Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login and get JWT token
GET /api/skills List all skills
GET /api/skills/:id Get skill details
Protected Endpoints (Require JWT)
Method Endpoint Description
GET /api/auth/me Get current user profile
POST /api/skills Create new skill
PUT /api/skills/:id Update skill
DELETE /api/skills/:id Delete skill
POST /api/orders Create new order
GET /api/orders/my Get user's orders
GET /api/orders/:id Get order details
PATCH /api/orders/:id/status Update order status
๐Ÿณ Docker Deployment (Production)
1๏ธโƒฃ Build Images
bash

docker-compose build

2๏ธโƒฃ Run Containers
bash

docker-compose up -d

3๏ธโƒฃ Check Logs
bash

docker-compose logs -f

4๏ธโƒฃ Stop Services
bash

docker-compose down

๐Ÿงช Testing
Run All Tests
bash

Gateway

cd gateway && npm test

Marketplace

cd marketplace && npm test

App

cd app && npm test

Run Specific Tests
bash

cd marketplace
npm test -- auth.test.js
npm test -- skills.test.js

๐Ÿ“‚ Project Structure
text

myzubster/
โ”œโ”€โ”€ gateway/
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ models/
โ”‚ โ”‚ โ”œโ”€โ”€ routes/
โ”‚ โ”‚ โ”œโ”€โ”€ services/
โ”‚ โ”‚ โ””โ”€โ”€ utils/
โ”‚ โ”œโ”€โ”€ tests/
โ”‚ โ”œโ”€โ”€ .env.example
โ”‚ โ”œโ”€โ”€ package.json
โ”‚ โ””โ”€โ”€ server.js
โ”œโ”€โ”€ marketplace/
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ models/
โ”‚ โ”‚ โ”œโ”€โ”€ routes/
โ”‚ โ”‚ โ”œโ”€โ”€ middleware/
โ”‚ โ”‚ โ””โ”€โ”€ config/
โ”‚ โ”œโ”€โ”€ tests/
โ”‚ โ”œโ”€โ”€ .env.example
โ”‚ โ”œโ”€โ”€ package.json
โ”‚ โ””โ”€โ”€ server.js
โ”œโ”€โ”€ app/
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ screens/
โ”‚ โ”‚ โ”œโ”€โ”€ components/
โ”‚ โ”‚ โ”œโ”€โ”€ navigation/
โ”‚ โ”‚ โ””โ”€โ”€ services/
โ”‚ โ”œโ”€โ”€ .env.example
โ”‚ โ”œโ”€โ”€ package.json
โ”‚ โ””โ”€โ”€ App.js
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

๐Ÿ› Troubleshooting
Port Already in Use
bash

Find process using port 4000

sudo netstat -tulpn | grep :4000

or

sudo lsof -i :4000

Kill the process

sudo kill -9 [PID]

Database Issues

Reset SQLite database:
bash

rm marketplace/database.sqlite
npm run dev # Will recreate database

Reset MongoDB:
bash

docker stop mongodb
docker rm mongodb
docker run -d -p 27017:27017 --name mongodb mongo:6

JWT Token Invalid

Tokens expire after 7 days. Login again to get a new token:
bash

curl -X POST http://localhost:4000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"buyer@test.com","password":"test123"}'

Gateway Connection Refused

Make sure MongoDB is running:
bash

docker ps | grep mongodb

or

ps aux | grep mongod

๐Ÿค Contributing

We welcome contributions! Here's how:

Fork the repository

Create a branch: git checkout -b feature/your-feature

Make your changes

Run tests: npm test

Commit: git commit -m 'feat: add your feature'

Push: git push origin feature/your-feature

Open a Pull Request
Enter fullscreen mode Exit fullscreen mode

Development Workflow
bash

Clone your fork

git clone https://github.com/your-username/myzubster.git
cd myzubster

Install dependencies

npm install

Start development server

npm run dev

Run tests

npm test

Build for production

npm run build

๐Ÿ“š Resources

Project Repository: github.com/DanielIoni-creator/myzubster

Marketplace: github.com/DanielIoni-creator/MyZubster-Marketplace

Gateway: github.com/DanielIoni-creator/MyZubsterGateway

App: github.com/DanielIoni-creator/MyZubster-App

Author DEV.to: dev.to/danielioni
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“ฌ Contact

Author: Daniel Ioni

GitHub: @DanielIoni-creator

DEV.to: @danielioni
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“„ License

This project is licensed under the MIT License.

Built with โค๏ธ for privacy, freedom, and decentralization.
โญ Star the Project!

If you found this guide helpful, please star the repository on GitHub!

https://img.shields.io/github/stars/DanielIoni-creator/myzubster?style=social

Questions? Comments? Drop them below! ๐Ÿ‘‡

Top comments (0)