π€ 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.
Top comments (1)
The use of MongoDB models, such as the
TokenandTokenHoldingmodels, provides a clear structure for managing token-related data, and the inclusion of fields likereputationScorein theUsermodel suggests a robust system for evaluating user trustworthiness. I appreciate the implementation of thecreatePaymentfunction in the Monero Service, which creates a new subaddress for each order and saves the transaction details. However, I'd like to discuss the potential benefits of adding additional error handling mechanisms to thecheckPaymentfunction to account for scenarios where the transaction is not found or the RPC request fails. What considerations were taken into account when designing the dispute resolution mechanism in the Escrow Service, particularly with regards to the use of AI-driven decision making?