Backend server for the BerryPay wallet — handles push notifications, exchange rates, wallet banners, and third-party data aggregation.
Built with NestJS + Redis.
- FCM Push Notifications — Encrypted data-only notifications for incoming Nano transactions
- Exchange Rates — XNO prices across 155+ fiat and crypto currencies
- Wallet Banners — Admin-managed promotional banners served to the app
- WeNano Businesses — Cached directory of businesses accepting Nano
- Representatives — Nano representative health monitoring and scoring
npm install
cp .env.example .env # configure your environment
npm run start:devRequires a running Redis instance.
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3000 |
REDIS_URL |
Redis connection URL | redis://localhost:6379 |
NANO_WS_URL |
Nano node WebSocket URL | ws://localhost:8081/ws |
GOOGLE_APPLICATION_CREDENTIALS |
Path to Firebase service account JSON | — |
API_KEY |
Secret key for admin endpoints | — |
ENABLE_RATES |
Enable currency rate fetching | false |
FOREX_API_KEY |
API key for forexrateapi.com | — |
WENANO_API_KEY |
API key for api.wenano.net | — |
RATE_* |
Rate limiting configuration | See .env |
All routes are prefixed with /api/v1.
| Method | Path | Description |
|---|---|---|
| GET | /banners |
Wallet banners sorted by position |
| GET | /rates |
XNO exchange rates |
| GET | /rates/currencies |
Supported currency list |
| GET | /wenano/businesses |
Nano-accepting businesses |
| GET | /representatives |
Representative list with scores |
| GET | /representatives/poor |
Underperforming representatives |
| Method | Path | Description |
|---|---|---|
| PUT | /fcm/active |
Register/update device token and active account |
| Method | Path | Description |
|---|---|---|
| POST | /fcm/test |
Send test notification to a token or account |
| POST | /fcm/broadcast |
Broadcast notification to all devices |
| POST | /fcm/debug-token |
Debug a specific FCM token |
| GET | /fcm/tokens |
List all registered tokens and accounts |
| DELETE | /fcm/tokens/:token |
Remove a specific FCM token |
| POST | /banners |
Create or update a banner |
| DELETE | /banners/:id |
Delete a banner |
Admin endpoints accept the API key via:
X-API-KeyheaderAuthorization: Bearer <key>header?api_key=<key>query parameter
MIT