This is a standalone chat and action-draft service for Senna, the Stage0 assistant.
Senna is scoped to Stage0, RISE, RISE Testnet, EVM wallets, launchpad usage, NFT drops, token creation, token locks, airdrops/multisend, domains, dashboards, and public on-chain verification.
POST /api/chatchat endpoint with session persistence.GET /api/chat/healthhealth and corpus-count endpoint.POST /api/images/collectionsandPOST /api/images/tokensfor Stage0 app media/profile uploads.PUT /api/images/collectionsandPUT /api/images/tokensfor profile details without a new image.GET /api/images/collections,GET /api/images/tokens, andGET /api/images/:imageIdfor media lookups.- PostgreSQL schema under
senna. - Docs retrieval over Stage0 GitBook pages, selected RISE docs, and local app facts.
- Rule-based action drafts for:
- create token
- create NFT collection
- create presale
- lock token
- airdrop tokens
- open launchpad/dashboard/routes
- Guest prompt limits and simple rate limiting.
- DeepSeek chat completions.
npm install
cp .env.example .env
npm run db:migrate
npm run docs:sync
npm run devRequired environment:
DATABASE_URL=postgres://...
DEEPSEEK_API_KEY=...{
"sessionId": "optional-uuid",
"mode": "auto",
"walletAddress": "0x...",
"evmAddress": "0x...",
"chainId": 11155931,
"messages": [
{ "role": "user", "content": "Help me create an NFT collection" }
]
}walletAddress and evmAddress are both treated as EVM identities. ss58Address is intentionally not part of Senna because Stage0 uses RISE/EVM flows.
Run migrations with:
npm run db:migrateThis creates:
senna.doc_sourcessenna.doc_chunkssenna.chat_sessionssenna.chat_messagessenna.action_draftssenna.tool_runssenna.rate_limit_windowssenna.collection_imagessenna.token_images
The project image tables also store app-level project profile fields: description, website, X/Twitter, Telegram, and Discord. Actual NFT token metadata remains on-chain via token metadata URIs.
Run:
npm run docs:syncBy default the sync seeds Stage0 GitBook pages, selected RISE docs, and local support files in docs/support/.
Override docs seed URLs with comma-separated values:
STAGE0_DOCS_SEED_URLS=https://stagezerolabs.gitbook.io/stage0/abstract.md,https://docs.risechain.com/docs/builders/testnet-details.mdx- Deploy this as its own API service/repo.
- Set
CHAT_CORS_ORIGINto the Stage0 frontend origin. - Run
npm run build, thennpm start. - Run
npm run db:migrate:prodbefore first production start. - Run
npm run docs:syncafter deploys or docs changes.
Senna must not request or expose seed phrases, private keys, keystores, API keys, env files, or private infrastructure details.
Senna does not execute transactions. It can prepare action drafts and route users to Stage0 pages. The user signs every transaction in their connected EVM wallet.