# Node2Mint

> Self-hosted AI marketplace, token billing engine, and OpenAI-compatible API gateway with atomic balances, provider failover, and affiliate commissions.

Node2Mint is an open-source, MIT-licensed full-stack platform published on GitHub by yanstd888. It combines a digital goods marketplace, a token billing engine, and an OpenAI-compatible API gateway that can be self-hosted with Docker Compose. The stack uses Next.js 15, Go 1.22, PostgreSQL 16, Redis 7, and Caddy 2.

## What It Is

Node2Mint is a platform for operators who resell AI model access or sell digital products such as prompts, models, datasets, and subscription access packs. A Go gateway exposes REST endpoints and an OpenAI-compatible `/v1/chat/completions` route that forwards requests to upstream providers. A Next.js frontend supplies the storefront, seller dashboard, AI playground/chat, and admin consoles.

## Billing and Gateway Workflow

Users register, receive signup token grants, and create API keys that are shown once and stored as SHA-256 hashes. Requests are metered against model input/output rates, with cached prompt discount calculations, and balances are changed inside database transactions using row-level locking. Chat completions route through active upstream providers with health checks and circuit breaker fallback, and Redis enforces per-IP and per-account rate limits.

## Marketplace, Payments, and Affiliates

Buyer funds are held in escrow until confirmation releases payout to the seller's store wallet. The platform supports order cancellation and refunds, seller product publishing, dispute handling, and withdrawal requests that admins approve or reject with audit logs. Payment options include Stripe, DOKU, manual QRIS/bank transfer, and optional TRC-20 USDT. Referral token grants and configurable affiliate commissions are included, along with IP hashing and duplicate signup checks. Telegram alerts cover orders and disputes.

## Setup Path

The README describes copying the example environment files, starting PostgreSQL, Redis, the Go gateway, and Uptime Kuma with Docker Compose, and running the Next.js frontend with npm. A smoke-test script checks the money and order flows, and a production compose file with a Caddyfile is provided. The UI ships with English and Bahasa Indonesia localization.

## Features
- OpenAI-compatible /v1/chat/completions gateway
- Provider failover with health checks and circuit breaker
- Atomic token and money balances with row-level locking
- Dynamic token metering with cached prompt discounts
- Redis-backed rate limiting
- Hashed API keys shown once
- Digital product marketplace with seller stores
- Escrow settlement, refunds, and withdrawals
- Referral and affiliate commission system
- Stripe, DOKU, QRIS/bank transfer, and USDT TRC-20 payments
- Telegram notification gateway
- Admin console with audit logs
- English and Bahasa Indonesia localization
- Docker Compose deployment

## Integrations
OpenAI, Anthropic, Stripe, DOKU, Telegram, Cloudflare Turnstile, Cloudflare Tunnel, PostgreSQL, Redis, Caddy, Uptime Kuma

## Platforms
WEB, API, CLI

## Pricing
Open Source

## Links
- Website: https://github.com/yanstd888/node2mint
- Repository: https://github.com/yanstd888/node2mint
- EveryDev.ai: https://www.everydev.ai/tools/node2mint
