Dextra targets **DeFi, NFT, and general Solana workflows** by pairing large language models with **function calling** and **Solana Agent Kit**–style tooling. Authentication and embedded wallets are handled via **Privy**; chain reads and enhanced RPC flows use **Helius** where configured.
Dextra
The intelligent copilot for Solana.
Dextra is a production-oriented web application that combines conversational AI with embedded wallets and Solana-native tooling. Users interact through natural language while the system orchestrates authenticated actions, portfolio insight, and integrations with major Solana services—all behind a modern, responsive interface.
Table of contents
- Overview
- Capabilities
- Architecture
- Prerequisites
- Getting started
- Environment configuration
- Database
- Docker development
- Available scripts
- Repository layout
- Additional documentation
Overview
Dextra targets DeFi, NFT, and general Solana workflows by pairing large language models with function calling and Solana Agent Kit–style tooling. Authentication and embedded wallets are handled via Privy; chain reads and enhanced RPC flows use Helius where configured. Persistent user data (conversations, wallets metadata, saved prompts, subscriptions, and related entities) lives in PostgreSQL and is accessed through Prisma.
The product emphasizes:
- Safety and clarity: Server-side orchestration and validated inputs (for example via Zod and next-safe-action patterns).
- Operational completeness: Optional integrations (charts, messaging, Discord/Telegram) are gated behind API keys so core chat and wallet flows can run with a minimal secret set.
- Developer experience: TypeScript throughout, pnpm as the package manager, and optional Docker Compose for a reproducible local stack including Postgres and Prisma Studio.
Capabilities
| Area | Description | |------|-------------| | Conversational agent | Natural-language interface tuned for Solana concepts; tool execution for swaps, portfolio queries, NFT/market data, and more depending on enabled integrations. | | Embedded wallet | Integrated wallet experience via Privy, with support for delegated signing flows where configured (PRIVYSIGNINGKEY). | | Smart tooling | Advanced tool orchestration using the Vercel AI SDK, optional Mem0 for memory-related provider usage, and Solana-oriented libraries (@solana/web3.js, spl-token, solana-agent-kit). | | Integrations | Jupiter, Magic Eden, Birdeye, Dexscreener, Defined.fi, Dialect, and others— surfaced through dedicated modules under src/ai and src/lib/solana. | | Portfolio & analytics | Portfolio-oriented APIs and UI components backed by Helius and optional CoinGecko/Birdeye keys for richer charts and market data. | | Saved prompts & memories | User-specific saved prompts and conversation persistence modeled in Prisma (SavedPrompt, Conversation, etc.). | | Modern UI | Next.js App Router, React 19, Tailwind CSS, Radix UI, and shadcn/ui-style components—responsive layout, dark mode via next-themes, animations where appropriate (Framer Motion). |
Architecture
- Framework: Next.js 15 (App Router).
- Language: TypeScript.
- UI: React 19, Tailwind CSS 3, Radix primitives, Lucide / Remix icon sets.
- Auth & wallets: Privy (
@privy-io/react-auth,@privy-io/server-auth). - AI:
aipackage with@ai-sdk/openaiand@ai-sdk/anthropic; compatible with OpenAI-compatible gateways (e.g. OpenRouter) via base URL and model name env vars. - Data: PostgreSQL + Prisma ORM (
DATABASEURL/DIRECTURL). - Solana:
@solana/web3.js,@solana/spl-token, Helius SDK, solana-agent-kit (Git dependency pinned inpackage.json). - Hosting notes: Scripts reference Vercel build conventions (
vercel-build); Vercel Analytics and Speed Insights are included as dependencies.
src/app/(user); server actions in src/server/actions and API routes under src/app/api coordinate persistence, Privy-verified operations, and AI/tool calls; Solana-specific helpers live under src/lib/solana and src/ai.
Prerequisites
- Node.js (LTS recommended; align with Next.js 15 expectations).
- pnpm — the repo declares
packageManagerinpackage.json(pinnedpnpmversion). - PostgreSQL — required for Prisma (local install or Docker Compose stack below).
- Accounts and API keys for Privy, Helius, and at least one LLM provider (OpenAI-compatible or Anthropic).
- Additional keys for ImgBB, Jina, CoinGecko, Birdeye, Telegram, Discord—see Environment configuration.
Getting started
1. Install dependencies
pnpm install
2. Configure environment
Copy .env.example to .env and fill in values. See Environment configuration and LOCAL_DEV.md for field-by-field guidance.
3. Generate Prisma client and apply schema
Ensure DATABASEURL (and DIRECTURL if used) point at your Postgres instance, then:
pnpm run generate
pnpm npx prisma migrate deploy
For an empty local database during active development, your team may use pnpm run db:reset with caution (destructive reset—see script in package.json).
4. Run the development server
pnpm run dev
By default this starts Next.js with Turbopack on port 8080 (see package.json dev script).
Environment configuration
Canonical templates: .env.example lists variables expected by the app; LOCALDEV.md explains setup for dextra.sh–style local development, including recommended providers (Privy, OpenRouter / Anthropic / OpenAI, ImgBB, Jina, Helius).
Typically required for core flows
| Variable | Purpose | |----------|---------| | NEXTPUBLICPRIVYAPPID | Privy client application ID | | PRIVYAPPSECRET | Privy server secret | | WALLETENCRYPTIONKEY | Encrypts sensitive wallet material server-side (generate a strong secret—see LOCAL_DEV.md) | | DATABASEURL / DIRECTURL | PostgreSQL connection strings for Prisma | | HELIUSAPIKEY | Backend Helius usage (e.g. smart transaction flows) | | NEXTPUBLICHELIUSRPCURL | Public RPC endpoint exposed to the client | | LLM — either OpenAI-compatible stack (OPENAIAPIKEY, optional OPENAIBASEURL, OPENAIMODELNAME) or ANTHROPICAPIKEY | Powers the assistant |
Public UI toggles (examples from .env.example): maintenance mode, subscription/trial lamports, tool disable lists—adjust per deployment.
Optional integrations: CoinGecko (CGAPIKEY, CGBASEURL), Birdeye (BIRDEYEAPIKEY), Telegram, Discord, ImgBB, Jina, Privy signing key for delegated actions, cron secret, etc.
Never commit real .env files. Rotate keys if they are exposed.
Database
- ORM: Prisma 6 (
schema.prismaat repository root). - Models include
User,Wallet,Conversation,SavedPrompt,Subscription, automation-related entities, and more—seeprisma/schema.prismafor the authoritative schema.
Docker development
The repository ships Docker Compose (docker-compose.yml) that runs:
dextra-app— application container (app on host port 3000 in Compose; differs from nativepnpm devport 8080).dextra-db— PostgreSQL 15 with health checks.dextra-studio—pnpm npx prisma studioon host port 5555.
pnpm run dev:up-build
Start existing images
pnpm run dev:up
Compose wires DATABASEURL / DIRECTURL to the internal Postgres service. Ensure .env includes POSTGRESUSER and POSTGRESPASSWORD as documented in LOCAL_DEV.md.
If dependencies or cached layers cause stale behavior after package changes, LOCAL_DEV.md documents pruning containers, volumes, and build cache.
Available scripts
| Script | Description | |--------|-------------| | pnpm run dev | Next.js dev server with Turbopack on port 8080 | | pnpm run build | Production build | | pnpm run start | Start production server on port 8080 | | pnpm run lint | ESLint (Next.js config) | | pnpm run format | Prettier write | | pnpm run format:check | Prettier check | | pnpm run generate | prisma generate | | pnpm run migrate | prisma migrate deploy | | pnpm run db:reset | Regenerate client, reset migrations, push schema — destructive | | pnpm run vercel-build | Memory-tuned build pipeline including prisma generate then next build | | pnpm run dev:up / dev:up-build | Docker Compose helpers |
Repository layout
| Path | Role | |------|------| | src/app/ | App Router routes, layouts, API routes | | src/components/ | Shared UI (including ui/ primitives) | | src/server/actions/ | Server actions (business logic, orchestration) | | src/server/db/ | Database query helpers | | src/lib/ | Shared utilities, Solana helpers, Prisma client wrapper | | src/ai/ | AI tool definitions and Solana/generic integrations | | prisma/ | Schema and migrations |
Additional documentation
- LOCAL_DEV.md — Privy onboarding, secret generation, Docker troubleshooting, first-user
earlyAccessflag via Prisma Studio. - .env.example — Environment variable checklist.
Version
Application version is declared in package.json (currently 0.3.1).