DEV Community

Daniel Ioni
Daniel Ioni

Posted on

🤖 MyZubster: AI Technical Quick Reference Guide

🤖 MyZubster: AI Technical Quick Reference Guide

Complete ecosystem overview for AI assistants and developers who need to understand the project fast.
🎯 Project Summary
Aspect Details
Project MyZubster – Decentralized marketplace with Monero payments
Primary Currency Monero (XMR) – Privacy-focused cryptocurrency
Blockchain Monero (mainnet) for payments, Tari (sidechain) for NFTs
Infrastructure Single VPS (Ubuntu 24.04 LTS, Aruba)
Deployment Node.js (port 3002) + Nginx (ports 80/443)
Security JWT authentication, Rate limiting, UFW firewall, Security Bot
🏗️ System Architecture
text

┌─────────────────────────────────────────────────────────────────────────────┐
│ MYZUBSTER ECOSYSTEM │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ FRONTEND (React + Vite) │ │
│ │ - Nginx (Port 443 HTTPS) │ │
│ │ - Serves static files from /var/www/myzubster-frontend/ │ │
│ │ - Proxies /api/* to Gateway │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ GATEWAY (Node.js + Express + MongoDB) │ │
│ │ - Port: 3002 │ │
│ │ - Handles Monero payments (subaddress generation, monitoring) │ │
│ │ - JWT authentication for API endpoints │ │
│ │ - REST API: /api/health, /api/auth/register, /api/auth/login │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ MARKETPLACE (Node.js + Express + SQLite) │ │
│ │ - Port: 4000 │ │
│ │ - REST API: /api/health, /api/users, /api/gateway/status │ │
│ │ - Communicates with Gateway via REST API │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ SECURITY BOT (Python) │ │
│ │ - Runs hourly via cron │ │
│ │ - Scans with nmap, nikto, sqlmap, gobuster │ │
│ │ - Saves JSON reports to /var/log/security_report_*.json │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ MONERO NODE (Public) │ │
│ │ - RPC URL: http://node.moneroworld.com:18081 │ │
│ │ - Network: mainnet │ │
│ └────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

📂 Repository Structure
Repository Purpose Branch URL
MyZubsterGateway Monero payment engine dev link
MyZubster-Marketplace Backend API main link
myzubster-frontend React frontend main link
MyZubster-App React Native mobile app main link
tari-nft-template Rust NFT template main link
my-monero-bounty Micro-bounty system main link
🔑 Key API Endpoints
Gateway (Port 3002)
Endpoint Method Description Auth
/api/health GET Health check ❌
/api/auth/register POST User registration ❌
/api/auth/login POST User login ❌
/api/auth/verify GET Verify JWT token ❌
/api/users GET Get users list ✅
/api/orders GET/POST Order management ✅
/api/payments GET/POST Payment management ✅
/api/admin/stats GET System statistics ✅
/api/dao/proposals GET/POST Governance proposals ✅
Marketplace (Port 4000)
Endpoint Method Description
/api/health GET Health check
/api/gateway/status GET Gateway connection status
/api/users GET/POST User management
🛡️ Security Implementation
1️⃣ JWT Authentication
javascript

// Middleware
const authenticate = (req, res, next) => {
const publicRoutes = ['/api/health', '/api/auth/login', '/api/auth/register'];
if (publicRoutes.includes(req.path)) return next();

const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'Token required' });

try {
const decoded = jwt.verify(token, process.env.JWT_SECRET);
req.user = decoded;
next();
} catch {
res.status(401).json({ error: 'Invalid or expired token' });
}
};

2️⃣ Rate Limiting
javascript

const rateLimit = require('express-rate-limit');

const globalLimiter = rateLimit({
windowMs: 15 * 60 * 1000,
max: 100,
message: 'Too many requests, please try again later'
});

const authLimiter = rateLimit({
windowMs: 15 * 60 * 1000,
max: 5,
message: 'Too many login attempts, please try again later'
});

3️⃣ UFW Firewall
bash

ufw default deny incoming
ufw allow from YOUR_IP to any port 22
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow from YOUR_IP to any port 3001
ufw allow from YOUR_IP to any port 4000

4️⃣ Nginx Security Headers
nginx

add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline';" always;
add_header Permissions-Policy "geolocation=(), microphone=(), camera=(), payment=(), usb=()" always;

🤖 Security Bot
Location
text

~/MyZubsterGateway/security/security_bot.py

Tools Used
Tool Purpose Command
nmap Port scanning nmap -sV --script=default localhost
nikto Web vulnerability nikto -h https://myzubster.com -ssl
sqlmap SQL injection sqlmap -u localhost --batch --level=1 --risk=1
gobuster Directory enumeration gobuster dir -u localhost -w /usr/share/wordlists/dirb/common.txt
Report Location
text

/var/log/security_report_*.json

Cron Job
bash

0 * * * * /usr/bin/python3 /root/MyZubsterGateway/security/security_bot.py >> /var/log/security_bot.log 2>&1

🔧 Quick Commands Reference
Deploy Frontend
bash

cd ~/myzubster-frontend
npm run build
sudo cp -r dist/* /var/www/myzubster-frontend/
sudo chown -R www-data:www-data /var/www/myzubster-frontend/
sudo systemctl reload nginx

Start Gateway
bash

cd ~/MyZubsterGateway
export PORT=3002
nohup node server.js > /var/log/gateway.log 2>&1 &

Start Marketplace
bash

cd ~/MyZubster-Marketplace
node server.js &

Run Security Bot
bash

cd ~/MyZubsterGateway/security
python3 security_bot.py

View Security Report
bash

ls -la /var/log/security_report_.json | tail -1
cat $(ls -t /var/log/security_report_
.json | head -1) | python3 -m json.tool

Check All Services
bash

curl https://myzubster.com/api/health
curl http://localhost:4000/api/health
curl http://localhost:4000/api/gateway/status

🧠 AI Understanding Checklist
✅ Core Concepts

□

MyZubster = Decentralized marketplace + Monero payments
□

Gateway = Payment engine (Node.js + MongoDB)
□

Marketplace = API backend (Node.js + SQLite)
□

Frontend = React/Vite + Nginx
□

Security Bot = Automated scanning + reports
Enter fullscreen mode Exit fullscreen mode

✅ Authentication Flow

User registers → Password hashed (bcrypt) → User saved to MongoDB

User logs in → Password verified → JWT token generated

Protected routes → Token verified → Access granted

Token expires → User must re-authenticate
Enter fullscreen mode Exit fullscreen mode

✅ Integration Points

□

Frontend → Gateway API (HTTPS proxy via Nginx)
□

Gateway ↔ Marketplace REST API
□

Gateway ↔ Monero RPC (node.moneroworld.com)
□

Security Bot → System logs and reports
Enter fullscreen mode Exit fullscreen mode

✅ Security Layers

JWT Authentication – API protection

Rate Limiting – DoS protection

UFW Firewall – Network protection

Nginx Headers – Web security (CSP, HSTS, X-Frame-Options)

Security Bot – Automated vulnerability scanning

HTTPS – Encrypted connections (Let's Encrypt)
Enter fullscreen mode Exit fullscreen mode

🐳 Docker Services
Running Services
bash

sudo docker ps

Service Container Name Port (Host) Port (Container) Status
MongoDB myzubster-mongodb 27018 27017 ✅ Running
Docker Compose Location
text

~/MyZubsterGateway/docker-compose.yml

📊 Status Check Script
bash

echo "=== GATEWAY ==="
curl -s https://myzubster.com/api/health | python3 -m json.tool

echo "=== MARKETPLACE ==="
curl -s http://localhost:4000/api/health | python3 -m json.tool

echo "=== INTEGRATION ==="
curl -s http://localhost:4000/api/gateway/status | python3 -m json.tool

echo "=== LATEST SECURITY REPORT ==="
ls -la /var/log/security_report_*.json | tail -1

📚 GitHub Links
Repository Quick URL
Gateway https://github.com/DanielIoni-creator/MyZubsterGateway
Marketplace https://github.com/DanielIoni-creator/MyZubster-Marketplace
Frontend https://github.com/DanielIoni-creator/myzubster-frontend
App https://github.com/DanielIoni-creator/MyZubster-App
NFT https://github.com/DanielIoni-creator/tari-nft-template
Bounty https://github.com/DanielIoni-creator/my-monero-bounty
🌐 Connect

Blog: DEV.to - Daniel Ioni

X (Twitter): @myzubster

LinkedIn: Daniel Ioni

GitHub: DanielIoni-creator

TikTok: @h4x0r_23
Enter fullscreen mode Exit fullscreen mode

Top comments (0)