Metaverse spatial fabric map service — A Node.js service that provides capabilities for reading and editing metaverse spatial fabrics. Part of the Open Metaverse Browser ecosystem.
MSF Map Service is a backend service that:
- Exposes REST and Socket.IO APIs for metaverse map operations
- Stores spatial fabric data in MySQL or SQL Server
- Serves a web-based Scene Assembler editor for building 3D scenes from GLB/GLTF models
- Integrates with Metaversal Fabric for multi-user access in a Metaverse Browser (VR/AR)
- Node.js (LTS recommended)
- Database: MySQL or SQL Server
- SSL certificate (Let's Encrypt or existing trusted certificate)
- RP1 CompanyId from RP1 Developer Center (Requires Developer Account registration and creation of a company. Free.)
git clone --recurse-submodules https://github.com/MetaversalCorp/MSF_Map_Svc.git
cd MSF_Map_Svc
npm installThen choose your platform and database:
- Linux + MySQL:
npm run build:linux:mysql - Linux + SQL Server:
npm run build:linux:mssql - Windows + MySQL:
npm run build:win:mysql - Windows + SQL Server:
npm run build:win:mssql
After build, configure dist/settings.json, run npm run install:svc and npm run install:sample in dist/, then npm run dev to test.
These are preliminary instructions with limited testing. See the Open Metaverse Browser Wiki for updates.
-
Clone the repository:
git clone --recurse-submodules https://github.com/MetaversalCorp/MSF_Map_Svc.git cd MSF_Map_Svc -
Install dependencies:
npm install
-
Build for your database:
npm run build:linux:mysql # or npm run build:linux:mssql
-
Change to the
distfolder:cd dist npm install -
Obtain an SSL certificate (e.g., Let's Encrypt with certbot):
sudo apt install -y snapd sudo snap install core && sudo snap refresh core sudo snap install --classic certbot sudo ln -sf /snap/bin/certbot /usr/bin/certbot sudo certbot certonly --standalone -d example.xyz.com sudo ln -sf /etc/letsencrypt/live/example.xyz.com/fullchain.pem ~/MSF_Map_Svc/dist/ssl/server.cert sudo ln -sf /etc/letsencrypt/live/example.xyz.com/privkey.pem ~/MSF_Map_Svc/dist/ssl/server.key
-
Configure
settings.jsonindist/:- MVSF.LAN:
port,SSL.bUseSSL,SSL.key,SSL.cert - MVSF.WAN:
host(public URL),port - MVSF:
key(admin password),sCompanyId(from dev.rp1.com) - SQL.config:
host,port,user,password,database(MySQL) orconnectionString(SQL Server)
- MVSF.LAN:
-
Install server and sample scene:
npm run install:svc npm run install:sample
-
Test:
npm run dev
Expected output:
SQL Server READY/Server running on port 2000
Create /etc/systemd/system/msf-map-svc.service:
[Unit]
Description=MSF Map Service
After=network.target
[Service]
Type=simple
User={YOURUSERNAME}
WorkingDirectory=/home/{YOURUSERNAME}/MSF_Map_Svc/dist
Environment=NODE_INTERNALPORT=2000
ExecStart=/usr/bin/node server.js
Restart=on-failure
[Install]
WantedBy=multi-user.targetThen:
sudo systemctl daemon-reload
sudo systemctl enable msf-map-svc
sudo systemctl start msf-map-svcSee the Open Metaverse Browser Wiki for full details.
-
Clone and install:
git clone --recurse-submodules https://github.com/MetaversalCorp/MSF_Map_Svc.git cd MSF_Map_Svc npm install -
Build:
npm run build:win:mysql # or npm run build:win:mssql
-
cd distandnpm install -
Obtain an SSL certificate — Use win-acme with Let's Encrypt, or place existing PEM cert/key in
dist/ssl/. -
Configure
settings.json— Set LAN, WAN, key,sCompanyId, and database config. -
Install:
npm run install:svc npm run install:sample
-
Test:
npm run dev
npm install node-windowsCreate service.js:
var Service = require('node-windows').Service;
var svc = new Service({
name: 'Metaverse Map Service',
description: 'Provides capabilities for reading and editing metaverse spatial fabrics.',
script: '.\\server.js'
});
svc.on('install', function() { svc.start(); });
svc.install();Run node service.js, then configure Log On As in Windows Services.
This guide uses Hostinger and Ubuntu; the process is similar for other VPS providers.
- Sign up at hostinger.com
- VPS → Get Now → Choose location
- Choose Ubuntu (24.04 LTS recommended)
- Set root password (or add SSH key)
- Choose plan (KVM1 is sufficient)
ssh root@YOUR_VPS_IP
sudo apt update && sudo apt upgrade -y
sudo apt install nodejs npm -y
node -v && npm -vsudo apt install mysql-server
sudo systemctl status mysql
sudo mysql_secure_installationCreate a database user:
sudo mysqlCREATE USER 'map'@'localhost' IDENTIFIED BY '{PASSWORD}';
GRANT ALL PRIVILEGES ON *.* TO 'map'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;Follow the Linux installation steps above, using the MySQL user and password you created.
MSF_Map_Svc/
├── svc/ # Server core
│ ├── mapbase.js # Base server class, auth, MVSF wiring
│ ├── utils.js # SQL helpers (RunQuery, RunQuery2, InitSQL, EventQueue)
│ ├── handler.json # Handler modules and protocol config (REST, SocketIO)
│ ├── Handlers/ # Request handlers
│ │ ├── RMBase.js # Base handler, subscribe/unsubscribe
│ │ ├── RMRoot.js # Root objects
│ │ ├── RMCObject.js # Container objects
│ │ ├── RMPObject.js # Placeholder objects
│ │ └── RMTObject.js # Transform objects
│ └── config/
│ ├── MySQL/ # MySQL server, install, sample
│ ├── SQL_Server/ # SQL Server server, install
│ └── Railway/ # Railway deployment config
├── db/ # Database schema and procedures
│ ├── MySQL/ # MySQL tables, functions, procedures
│ └── SQL_Server/ # SQL Server equivalent
├── sa/ # Scene Assembler (web editor)
│ └── site/ # Static web app (Three.js, Bootstrap, CodeMirror)
└── dist/ # Output of build (created by npm run build:*)
| Component | Purpose |
|---|---|
| @metaversalcorp/mvsf | Metaversal Fabric framework (REST, Socket.IO) |
| @metaversalcorp/mvsql_mysql / mvsql_mssql | Database adapters |
| Handlers (RMBase, RMRoot, RMCObject, RMPObject, RMTObject) | Map object CRUD and events |
| Scene Assembler (sa/) | Web-based 3D scene editor; see sa/README.md |
| Script | Description |
|---|---|
build:linux:mysql |
Linux + MySQL |
build:linux:mssql |
Linux + SQL Server |
build:win:mysql |
Windows + MySQL |
build:win:mssql |
Windows + SQL Server |
build:railway |
Railway deployment (MySQL) |
Contributions are welcome. The project is licensed under Apache-2.0.
-
Architecture
- Server:
svc/— Node.js + MVSF; handlers extendMVHANDLER - Database:
db/MySQL/anddb/SQL_Server/— tables, functions, stored procedures - Frontend:
sa/site/— Scene Assembler; see sa/README.md and sa/site/js/README.md
- Server:
-
Adding features
- Handlers: Add or extend handlers in
svc/Handlers/; register inhandler.json - Database: Add procedures in
db/MySQL/Procedures/ordb/SQL_Server/Procedures/; update_Createscripts - Scene Assembler: Extend
sa-*.jsmodules; keep config insa-config.js
- Handlers: Add or extend handlers in
-
Testing
- Run
npm run devindist/after setup - Serve Scene Assembler with
npx serve sa/site -p 8080orpython3 -m http.server 8080insa/site
- Run
-
Code style
- Preserve existing patterns and license headers
- Use
userDataon Three.js objects for app metadata - Avoid hardcoding; use
settings.jsonandsa-config.js
-
Reporting issues
- Open an issue on GitHub
- For installation problems, the project maintains a Discord community
Apache-2.0. See LICENSE.