DEV Community

Daniel Ioni
Daniel Ioni

Posted on

๐Ÿณ MyZubsterGateway: Production-Ready Deployment & New Features


 ๐Ÿณ MyZubsterGateway: Production-Ready Deployment & New Features

We've just completed a major update to the MyZubsterGateway repository, focusing on making the project easier to deploy, more secure, and ready for production use. Here's what changed.
๐Ÿš€ What's New?

  1. Docker Support Added

We've fully containerized the gateway with Docker and Docker Compose. This means you can now deploy the entire gateway stack (including MongoDB) with a single command.

New Files:

Dockerfile โ€“ Multi-stage build optimized for Node.js 20

docker-compose.yml โ€“ Defines and runs the gateway + MongoDB together

.dockerignore โ€“ Excludes sensitive files from the Docker image
Enter fullscreen mode Exit fullscreen mode

Benefits:

โœ… Consistent environment across all deployments

โœ… One-command setup: docker compose up -d

โœ… Simplified scaling and maintenance

โœ… Easy integration with other services (marketplace, AI, Monero)
Enter fullscreen mode Exit fullscreen mode

Example docker-compose.yml snippet:
yaml

services:
mongodb:
image: mongo:7-jammy
# ... config

gateway:
build: .
ports:
- "3000:3000"
environment:
- MONGO_URI=mongodb://${MONGO_USER:-admin}:${MONGO_PASSWORD:-securepassword}@mongodb:27017/myzubster?authSource=admin
# ... config

  1. Environment Configuration

We've completely reworked the environment variable management.

New File: .env.example โ€“ A template with all required variables
Variable Purpose
MONGO_USER / MONGO_PASSWORD MongoDB authentication
MONERO_RPC_URL Monero node endpoint (now supports public nodes)
MONERO_WALLET_ADDRESS / MONERO_WALLET_PASSWORD Monero wallet for payments
JWT_SECRET JWT signing key (MUST be changed)
API_KEY API authentication key
MARKETPLACE_WEBHOOK_URL Webhook endpoint for the marketplace

Security Note: The .env file is excluded from Git via .gitignore to prevent accidental exposure of secrets.

  1. New API Endpoint: /api/users

Added a new route to manage users:
javascript

// routes/users.js
router.get('/', (req, res) => {
res.json({ users: [] });
});

router.post('/', (req, res) => {
// Create a new user
});

This endpoint is now registered in server.js and ready for future expansion.

  1. Updated server.js

The main server file has been cleaned up and restructured:

Removed duplicate declarations

Improved error handling

Better MongoDB connection management

All routes are now properly registered
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“ฆ How to Deploy
Step 1: Clone the Repository
bash

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

Step 2: Configure Environment
bash

cp .env.example .env
nano .env # Add your credentials

Step 3: Start the Gateway
bash

docker compose up -d

Step 4: Verify
bash

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

Expected output: {"status":"ok","timestamp":"..."}

๐Ÿ”ง Monero Integration

The gateway now supports two modes for Monero:

Option 1: Public Node (Default)
env

MONERO_RPC_URL=http://node.moneroworld.com:18081

Option 2: Local Node
env

MONERO_RPC_URL=http://monero:18081

If you want to run a local Monero node:
bash

wget https://downloads.getmonero.org/cli/linux64
tar -xvf linux64
cd monero-x86_64-linux-gnu-*
./monerod --rpc-bind-ip=0.0.0.0 --rpc-bind-port=18081 --restricted-rpc --confirm-external-bind --non-interactive

๐Ÿ” Security Improvements

Non-root user inside the container

Sensitive files excluded from the image via .dockerignore

Environment variables never hard-coded

JWT_SECRET must be generated per deployment

Monero RPC uses authentication
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“Š What Was Removed

โŒ ..env.swp (temporary swap file)

โŒ Obsolete version attribute from docker-compose.yml

โŒ Duplicate code in server.js

โŒ Hard-coded configuration values
Enter fullscreen mode Exit fullscreen mode

๐Ÿ› ๏ธ Development vs Production
Branch Use Case
dev Active development, new features
main Stable, production-ready releases

All changes have been merged from dev into main.
๐Ÿงช Test the New Setup
bash

Health check

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

Users endpoint

curl http://localhost:3000/api/users

Check Docker logs

docker compose logs -f gateway

๐Ÿ“ Conclusion

This update transforms MyZubsterGateway from a standalone Node.js application into a fully containerized, production-ready service. It's now easier to deploy, more secure, and prepared for future growth.

Next Steps:

Connect the marketplace

Deploy the mobile app

Integrate the NFT template for Tari

Enable the security bot
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“Œ Connect with Me

Follow the development of MyZubster and connect with me on social media:
Platform Handle / Link
DEV.to (Blog) @danielioni
GitHub DanielIoni-creator
X (Twitter) @myzubster
TikTok @h4x0r_23
LinkedIn Daniel Ioni
YouTube Coming soon

Stay updated on the journey! ๐Ÿš€
๐Ÿ”— Project Links
Project Repository
MyZubsterGateway DanielIoni-creator/MyZubsterGateway
MyZubster-Marketplace DanielIoni-creator/MyZubster-Marketplace
MyZubster-App DanielIoni-creator/MyZubster-App
Tari NFT Template DanielIoni-creator/tari-nft-template
MyZubster (Ecosystem) DanielIoni-creator/myzubster
๐Ÿ™Œ Contribute

If you'd like to contribute, please:

Fork the repository

Create a feature branch (feat/amazing-feature)

Submit a Pull Request to the dev branch
Enter fullscreen mode Exit fullscreen mode

Built with โค๏ธ for privacy, freedom, and decentralization.

Author: Daniel Ioni
Project: MyZubster โ€“ The Decentralized Marketplace

Top comments (0)