Repository navigation
Installation and Setup
This page covers installation requirements, standard package managers (npm/pnpm/yarn/bun), local Git submodule installation, the Rust-style Submodule Resolver, and standalone local hosting for @m3rcena/eco.
-
Node.js:
>= 22.0.0(LTS 22, 24, 26). -
Discord.js:
^14.28.1 -
Rust Canvas:
@napi-rs/canvas(Used for debit card rendering and stock candlestick sparklines)
If you prefer standard package management via npm registry:
# npm
npm install @m3rcena/eco @napi-rs/canvas discord.js
# pnpm
pnpm add @m3rcena/eco @napi-rs/canvas discord.js
# yarn
yarn add @m3rcena/eco @napi-rs/canvas discord.js
# bun
bun add @m3rcena/eco @napi-rs/canvas discord.jsIf you prefer vendoring and hosting @m3rcena/eco locally via Git submodules rather than installing from the npm registry, @m3rcena/eco features a Rust/Cargo-inspired Submodule Resolver.
git submodule add https://github.com/M3rcena/m3rcena-eco.git submodules/m3rcena-eco
git submodule update --init --recursiveAdd this single line at the top of your entrypoint:
import "@m3rcena/eco/register";Or pass it as a flag when executing Node / TSX:
# TSX
tsx -r @m3rcena/eco/register src/index.ts
# Node.js
node --import @m3rcena/eco/register dist/index.js-
Local-First Discovery: Automatically checks
./submodules/m3rcena-eco,./vendor/m3rcena-eco,./packages/m3rcena-eco,./libs/m3rcena-eco. -
Transparent Interception: Patches module resolution so
import { EcoManager } from '@m3rcena/eco'redirects seamlessly to your local submodule without changing your code. -
NPM Fallback: If the local submodule is absent, it falls back to standard
node_modules/@m3rcena/eco. -
Source vs Build: In TypeScript environments (
tsx,ts-node), it automatically loads TypeScript sources directly.
For instant IDE autocompletion directly from the local submodule sources:
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"paths": {
"@m3rcena/eco": [
"./submodules/m3rcena-eco/src",
"./submodules/m3rcena-eco/dist/index.mjs",
"./submodules/m3rcena-eco"
]
}
}
}π‘ Tip: You can generate the exact paths object dynamically in Node:
import { generateTsConfigPaths } from "@m3rcena/eco/resolver"; console.log(generateTsConfigPaths());
{
"submodulesDir": "./submodules",
"preferSource": true,
"packages": {
"@m3rcena/eco": "./submodules/m3rcena-eco"
}
}Or via environment variable:
export M3RCENA_ECO_PATH="./submodules/m3rcena-eco"@m3rcena/eco can be hosted as an independent local economy microservice!
Inside the submodule directory:
cd submodules/m3rcena-eco
npm install
npm run hostThis starts the Eco Engine REST & Canvas Service on http://localhost:4002:
-
GET /health: Health status, SQLite database path, and uptime. -
GET /account/:userId: Full balance and FICO credit score dossier. -
GET /cards/debit/:userId: Generates personalized high-res debit card PNG. -
GET /stocks: Real-time stock exchange prices and 24h delta. -
GET /leaderboard: Top net worth rankings. -
POST /eco/*: Bridge REST actions.
GitHub: M3rcena/m3rcena-eco β’ NPM: @m3rcena/eco
- Bank Vaults & Compound Interest
- FICO Credit Scoring (300-850)
- Bank Loans & Debt
- Municipal Utility Bills
- Progressive Wealth Taxes & Evasion
- Interactive Blackjack Table
- Slot Machine (50x Mega Jackpot)
- European Roulette
- Crash Multiplier Simulator
- Coinflip & Dice
- Simulated Stock & Crypto Exchange
- Multiplayer Syndicate Heists
- Companion Pets & Foraging
- Mystery Loot Crates
- Dashboard Bridge Integration
- Weky Minigames Integration
- Complete REST API Reference
- Scoped Audio Cues Table