๐ค Technical Guide for AI โ Full Project Recovery (MyZubster)
๐ค Technical Guide for AI โ Full Project Recovery (MyZubster) This guide is designed exclusively for an Artificial Intelligence to read, understand, and resume the entire MyZubster project from any point, and provide acc
๐ค Technical Guide for AI โ Full Project Recovery (MyZubster)
This guide is designed exclusively for an Artificial Intelligence to read, understand, and resume the entire MyZubster project from any point, and provide accurate technical assistance.
๐ Purpose of This Guide
The AI must use this guide as an internal search engine and persistent memory to:
Understand the complete system architecture.
Resume work from where it was interrupted.
Provide precise technical answers with commands and code.
Suggest next steps based on the current state.
๐๏ธ 1. System Overview (Data Structure)
MongoDB Models (Backend)
javascript
// models/User.js
{
username: String,
email: String,
password: String (bcrypt),
reputationScore: Number,
completedTrades: Number,
rating: Number,
role: ['user', 'admin', 'issuer']
}
// models/Token.js
{
name: String,
symbol: String (unique),
totalSupply: Number,
assetValue: Number,
tokenPrice: Number,
assetType: ['realestate', 'equity', 'art', 'commodity', 'debt', 'revenue'],
issuer: ObjectId(User),
status: ['draft', 'active', 'closed']
}
// models/TokenHolding.js
{
user: ObjectId(User),
token: ObjectId(Token),
amount: Number,
lockedAmount: Number
}
// models/OrderBook.js
{
token: ObjectId(Token),
seller: ObjectId(User),
amount: Number,
price: Number,
totalPrice: Number,
status: ['open', 'filled', 'cancelled', 'expired'],
moneroTxid: String
}
// models/MoneroTransaction.js
{
orderId: ObjectId(OrderBook),
buyerId: ObjectId(User),
subaddress: String,
amount: Number,
amountPaid: Number,
moneroTxid: String,
status: ['pending', 'confirmed', 'expired', 'failed'],
confirmations: Number
}
// models/Escrow.js
{
orderId: ObjectId(OrderBook),
buyerId: ObjectId(User),
sellerId: ObjectId(User),
amount: Number,
currency: ['XMR', 'token'],
status: ['pending', 'held', 'released', 'disputed', 'refunded', 'escalated'],
aiDecision: Object,
expiresAt: Date
}
// models/NFT.js (Tari)
{
tokenId: String,
name: String,
description: String,
imageUrl: String,
owner: ObjectId(User),
value: Number,
metadata: Object,
transferHistory: Array
}
โ๏ธ 2. Core Services
2.1 โ Monero Service (moneroService.js)
javascript
const MONERO_RPC_URL = 'http://localhost:18083/json_rpc';
async function createPayment(orderId, buyerId, amount) {
const subaddress = await createSubaddress(0, Order ${orderId});
const transaction = new MoneroTransaction({
orderId, buyerId, subaddress, amount, status: 'pending'
});
await transaction.save();
return { transactionId: transaction._id, address: subaddress };
}
async function checkPayment(transactionId) {
const transfers = await rpcRequest('get_transfers', { in: true });
// Find matching transaction
}
2.2 โ Escrow Service (disputeService.js)
javascript
async function resolveDisputeWithAI(escrowId) {
const escrow = await Escrow.findById(escrowId)
.populate('buyerId', 'username reputationScore')
.populate('sellerId', 'username reputationScore');
const prompt = You are a mediator...;
const decision = await deepseekService.askDeepSeek(prompt);
// Apply decision
}
2.3 โ Tari Service (tariService.js)
javascript
const TARI_WALLET_RPC = 'http://localhost:12820/json_rpc';
async function mintNFT(name, description, owner, metadata) {
return tariWalletRequest('mint_nft', { name, description, owner, metadata });
}
async function createEscrow(amount, buyer, seller, arbiter) {
return tariWalletRequest('create_multisig_escrow', {
amount, buyer, seller, arbiter, timeout: 604800
});
}
๐ 3. API Endpoints Summary
Method Endpoint Description
POST /api/auth/register Register user
POST /api/auth/login Login (JWT)
POST /api/tokens Create token
GET /api/tokens/holdings User holdings
POST /api/marketplace/sell Create sell order
POST /api/marketplace/buy/:id Buy order
GET /api/marketplace/orders/:tokenId List orders
POST /api/payments Create Monero payment
GET /api/payments/:id Payment status
POST /api/escrow Create escrow
POST /api/escrow/:id/dispute Open dispute
POST /api/tari/nft/mint Mint NFT on Tari
POST /api/tari/escrow Create Tari escrow
POST /api/ai/ask Query DeepSeek AI
GET /api/health Health check
๐ฅ๏ธ 4. System Commands (Reference)
4.1 โ Gateway
bash
systemctl status myzubster-gateway
systemctl restart myzubster-gateway
journalctl -u myzubster-gateway -n 50 --no-pager
4.2 โ Frontend (Build & Deploy)
bash
cd ~/myzubster-frontend
npm run build
cp -r dist/* /var/www/myzubster-frontend/
chown -R www-data:www-data /var/www/myzubster-frontend
systemctl reload nginx
4.3 โ Nginx
bash
nginx -t
systemctl reload nginx
tail -20 /var/log/nginx/error.log
4.4 โ Monero
bash
Wallet RPC
cd ~/monero
./monero-wallet-rpc --rpc-bind-port 18083 --daemon-address node.moneroworld.com:38081 --wallet-file ./myzubster_wallet --password 'Myzubster2026@!!' --disable-rpc-login --trusted-daemon --stagenet
Test RPC
curl -X POST http://localhost:18083/json_rpc -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":"0","method":"get_balance"}'
4.5 โ Tari
bash
Node
nohup ~/tari/target/release/minotari_node --network testnet --base-path ~/tari-data > ~/tari_node.log 2>&1 &
Wallet
nohup ~/tari/target/release/minotari_console_wallet --network testnet --password myzubster --wallet-file ~/tari-wallet > ~/tari_wallet.log 2>&1 &
Test RPC
curl -X POST http://localhost:12820/json_rpc -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":"0","method":"get_balance"}'
4.6 โ Security Bot (Kali Linux)
python
/root/security_bot.py
def scan_gateway():
return subprocess.run(['nmap', '-p', '3000,80,443', 'localhost'], capture_output=True, text=True).stdout
def ask_deepseek(prompt):
resp = requests.post(f"{MYZUBSTER_API}/ai/ask", json={"prompt": prompt}, headers={'Authorization': f'Bearer {TOKEN}'})
return resp.json().get('response')
๐ง 5. Troubleshooting (Quick Diagnostics)
5.1 โ Gateway not responding
bash
curl http://localhost:3000/api/health
journalctl -u myzubster-gateway -n 30 --no-pager
cd ~/MyZubsterGateway && node server.js
5.2 โ Frontend not loading
bash
ls -la /var/www/myzubster-frontend/
curl -I https://myzubster.com
tail -20 /var/log/nginx/error.log
5.3 โ Monero RPC not responding
bash
ps aux | grep monero-wallet-rpc
curl -X POST http://localhost:18083/json_rpc -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":"0","method":"get_balance"}'
5.4 โ Tari not responding
bash
ps aux | grep minotari
curl -X POST http://localhost:12820/json_rpc -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":"0","method":"get_balance"}'
5.5 โ Ports in use
bash
netstat -tlnp | grep -E ":80|:443|:3000|:18083|:12820"
lsof -i :80
๐ 6. Log Files (Locations)
Service Log File
Gateway journalctl -u myzubster-gateway
Nginx /var/log/nginx/error.log, /var/log/nginx/access.log
Monero Node ~/monero/monerod.log (or journalctl -u monerod)
Monero Wallet RPC ~/monero/monero-wallet-rpc.log
Tari Node ~/tari_node.log
Tari Wallet ~/tari_wallet.log
Security Bot /var/log/security_bot.log
MongoDB /var/log/mongodb/mongod.log
๐งฉ 7. Frontend Structure (React/Vite)
text
src/
โโโ pages/
โ โโโ Login.jsx
โ โโโ Register.jsx
โ โโโ Dashboard.jsx
โ โโโ Marketplace.jsx
โโโ components/
โ โโโ ProtectedRoute.jsx
โโโ contexts/
โ โโโ AuthContext.jsx
โโโ utils/
โ โโโ axiosConfig.js
โโโ App.jsx
๐ 8. Environment Variables (.env)
env
PORT=3000
MONGODB_URI=mongodb://localhost:27017/myzubster
JWT_SECRET=supersecretkey
MONERO_WALLET_RPC_URL=http://localhost:18083/json_rpc
MONERO_DAEMON_RPC_URL=http://localhost:18081/json_rpc
MONERO_NETWORK=stagenet
TARI_RPC_URL=http://localhost:12810/json_rpc
TARI_WALLET_RPC=http://localhost:12820/json_rpc
TARI_NETWORK=testnet
FRONTEND_URL=https://myzubster.com
๐ 9. Roadmap (Next Steps)
Priority Task Status
High Test marketplace from browser ๐ด To do
High Test Monero payment (endโtoโend) ๐ด To do
High Verify security bot (cron job) ๐ด To do
Medium Migrate Tor onion service to new VPS ๐ก In progress
Medium Integrate NFTs into marketplace ๐ก To do
Low Admin Dashboard ๐ข Future
๐ฌ 10. AI Response Format
When responding using this guide, the AI must:
Reference the section.
Provide the exact command/code.
Suggest the next logical step.
Ask the user for confirmation.
Example AI response:
text
๐ Section 4.1 โ Gateway Management
๐ป Command: systemctl restart myzubster-gateway
๐ง Next Step: After restart, run:
curl http://localhost:3000/api/health
๐ค Question: Would you like to proceed with testing the marketplace?
This guide is a living document. The AI should update it with new findings, commands, and configurations as the project evolves.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.