Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Anyone - whether an SF-based AI researcher or a crypto-native builder - can brin
[![Run on Repl.it](https://replit.com/badge/github/sendaifun/solana-agent-kit)](https://replit.com/@sendaifun/Solana-Agent-Kit)
> Replit template created by [Arpit Singh](https://github.com/The-x-35)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FSMSDAO%2Fsolana-agent-kit&project-name=solana-agent-kit-dashboard&repository-name=solana-agent-kit)
> Full dashboard with wallet authentication and admin panels

## 🔧 Core Blockchain Features

- **Token Operations**
Expand Down Expand Up @@ -104,6 +107,46 @@ Anyone - whether an SF-based AI researcher or a crypto-native builder - can brin
## 📃 Documentation
You can view the full documentation of the kit at [docs.sendai.fun](https://docs.sendai.fun/v0/introduction)

## 🌐 Web Dashboard

Solana Agent Kit now includes a full-featured web dashboard with:

- **🚀 Deployable on Vercel** - One-click deployment support
- **📊 Full Dashboard** - Portfolio tracking, transaction history, and analytics
- **👥 Admin Panels** - User management with role-based access control (RBAC)
- **🔐 Smart Wallet Authentication** - Secure login with Phantom, Solflare, Torus, and Ledger
- **🌐 Multi-Network Support** - Preset public RPCs for Mainnet, Testnet, and Devnet

### Quick Deploy

Deploy the dashboard to Vercel in one click:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FSMSDAO%2Fsolana-agent-kit&project-name=solana-agent-kit-dashboard&repository-name=solana-agent-kit)

Or run locally:

```bash
cd web-dashboard
npm install
npm run dev
```

Visit [http://localhost:3000](http://localhost:3000) and connect your Solana wallet to get started.

For detailed documentation, see [web-dashboard/README.md](web-dashboard/README.md).

### Preset Public RPCs

The dashboard includes preset public RPC endpoints for easy deployment:

- **Mainnet**: `https://api.mainnet-beta.solana.com`
- **Testnet**: `https://api.testnet.solana.com`
- **Devnet**: `https://api.devnet.solana.com`

These can be customized via environment variables for production deployments with premium RPC providers.

## 📃 SDK Documentation

## 📦 Installation

```bash
Expand Down
15 changes: 15 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": 2,
"builds": [
{
"src": "web-dashboard/package.json",
"use": "@vercel/next"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "web-dashboard/$1"
}
]
Comment on lines +2 to +14
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vercel.json configuration at the repository root uses the legacy 'builds' and 'routes' configuration format. For Next.js projects, Vercel automatically detects and deploys them without needing these configurations. Additionally, this configuration would attempt to deploy the entire repository as a Next.js project, which may not be the intended behavior. If the web-dashboard is meant to be deployed separately, consider removing this file or updating it to use the 'monorepo' configuration approach, or moving it into the web-dashboard directory.

Suggested change
"version": 2,
"builds": [
{
"src": "web-dashboard/package.json",
"use": "@vercel/next"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "web-dashboard/$1"
}
]
"version": 2

Copilot uses AI. Check for mistakes.
}
24 changes: 24 additions & 0 deletions web-dashboard/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Environment Variables for Solana Remix AI Dashboard

# NextAuth Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-here-generate-with-openssl-rand-base64-32

# Solana RPC URLs - Preset Public RPCs (defaults are provided)
# You can override these with premium RPC providers for production
NEXT_PUBLIC_SOLANA_MAINNET_RPC=https://api.mainnet-beta.solana.com
NEXT_PUBLIC_SOLANA_TESTNET_RPC=https://api.testnet.solana.com
NEXT_PUBLIC_SOLANA_DEVNET_RPC=https://api.devnet.solana.com

# Default Network (mainnet, testnet, devnet)
NEXT_PUBLIC_DEFAULT_NETWORK=mainnet

# Admin Configuration (Legacy - now using email authentication)
# Add comma-separated list of admin wallet addresses (no spaces)
# Example: NEXT_PUBLIC_ADMIN_WALLETS=wallet1,wallet2,wallet3
NEXT_PUBLIC_ADMIN_WALLETS=
Comment on lines +16 to +19
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable NEXT_PUBLIC_ADMIN_WALLETS is marked as 'Legacy' but there's no corresponding code in the application that uses it. This could be confusing for users setting up the dashboard. Consider either removing this configuration entirely or clarifying in the comments that it's not currently used and admin access is now controlled through email authentication in the NextAuth configuration.

Suggested change
# Admin Configuration (Legacy - now using email authentication)
# Add comma-separated list of admin wallet addresses (no spaces)
# Example: NEXT_PUBLIC_ADMIN_WALLETS=wallet1,wallet2,wallet3
NEXT_PUBLIC_ADMIN_WALLETS=
# Admin Configuration (Deprecated - not currently used)
# NOTE: Admin access is now controlled via email authentication in the NextAuth configuration.
# This variable is kept only for backward compatibility/documentation and is not read by the app.
# If you previously relied on wallet-based admin access, migrate to email-based admin auth instead.
# Example (no longer used): NEXT_PUBLIC_ADMIN_WALLETS=wallet1,wallet2,wallet3
# NEXT_PUBLIC_ADMIN_WALLETS=

Copilot uses AI. Check for mistakes.

# Optional: For enhanced features
OPENAI_API_KEY=
HELIUS_API_KEY=
COINGECKO_API_KEY=
3 changes: 3 additions & 0 deletions web-dashboard/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
34 changes: 34 additions & 0 deletions web-dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dependencies
/node_modules
/.pnp
.pnp.js

# Testing
/coverage

# Next.js
/.next/
/out/

# Production
/build

# Misc
.DS_Store
*.pem

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Local env files
.env*.local
.env

# Vercel
.vercel

# TypeScript
*.tsbuildinfo
next-env.d.ts
248 changes: 248 additions & 0 deletions web-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
# Solana Remix AI Dashboard

A full-featured dashboard for Solana Remix AI with wallet authentication, email-secured admin panels, and role-based access control.

## Features

- 🚀 **Deployable on Vercel** - Ready for one-click deployment
- 📊 **Full Dashboard** - View portfolio, transactions, and analytics
- 👥 **Admin Panels** - User and role management with RBAC
- 🔐 **Dual Authentication** - Smart wallet login for users, secure email login for admins
- 🌐 **Multi-Network Support** - Mainnet, Testnet, and Devnet RPCs

## Quick Start

### Prerequisites

- Node.js >= 18
- npm or pnpm

### Installation

1. Clone the repository:
```bash
git clone https://github.com/SMSDAO/solana-agent-kit.git
cd solana-agent-kit/web-dashboard
```

2. Install dependencies:
```bash
npm install
# or
pnpm install
```

3. Set up environment variables:
```bash
cp .env.example .env.local
```

Edit `.env.local` and configure:
- `NEXTAUTH_URL` - Your application URL (e.g., http://localhost:3000)
- `NEXTAUTH_SECRET` - Generate with: `openssl rand -base64 32`
- Optional: Custom RPC URLs for better performance

4. Run the development server:
```bash
npm run dev
# or
pnpm dev
```

5. Open [http://localhost:3000](http://localhost:3000) in your browser.

## Admin Access

### Email Authentication

The admin panel is secured with email/password authentication using NextAuth.js.

**Demo Credentials:**
- Email: `admin@aiagentkit.com`
- Password: `admin123`

**Access the admin panel at:** [http://localhost:3000/admin](http://localhost:3000/admin)

### Adding Admin Users

To add more admin users, edit the `ADMIN_USERS` array in:
```
app/api/auth/[...nextauth]/route.ts
```

For production, replace the hardcoded users with a database lookup.

## Deployment on Vercel

### Method 1: One-Click Deploy

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FSMSDAO%2Fsolana-agent-kit&project-name=solana-agent-kit-dashboard&repository-name=solana-agent-kit)

### Method 2: Manual Deploy

1. Install Vercel CLI:
```bash
npm i -g vercel
```

2. Deploy:
```bash
cd web-dashboard
vercel
```

3. Follow the prompts to complete deployment.

### Method 3: GitHub Integration

1. Push your code to GitHub
2. Go to [vercel.com](https://vercel.com)
3. Click "New Project"
4. Import your GitHub repository
5. Set root directory to `web-dashboard`
6. Configure environment variables:
- `NEXTAUTH_URL` - Your production URL
- `NEXTAUTH_SECRET` - Generate with: `openssl rand -base64 32`
- `NEXT_PUBLIC_SOLANA_MAINNET_RPC`
- `NEXT_PUBLIC_SOLANA_TESTNET_RPC`
- `NEXT_PUBLIC_SOLANA_DEVNET_RPC`
- `NEXT_PUBLIC_DEFAULT_NETWORK`
7. Click "Deploy"

## Environment Variables

### Required Variables

- `NEXTAUTH_URL` - Application URL (e.g., https://yourdomain.vercel.app)
- `NEXTAUTH_SECRET` - Secret key for session encryption
- `NEXT_PUBLIC_DEFAULT_NETWORK` - Default network (mainnet, testnet, or devnet)

### Preset Public RPCs

The dashboard comes with preset public RPC endpoints:

- **Mainnet**: `https://api.mainnet-beta.solana.com`
- **Testnet**: `https://api.testnet.solana.com`
- **Devnet**: `https://api.devnet.solana.com`

### Optional Variables

For production deployments, consider using premium RPC providers:

```env
# Helius
NEXT_PUBLIC_SOLANA_MAINNET_RPC=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY

# QuickNode
NEXT_PUBLIC_SOLANA_MAINNET_RPC=https://YOUR_ENDPOINT.solana-mainnet.quiknode.pro/YOUR_KEY/

# Alchemy
NEXT_PUBLIC_SOLANA_MAINNET_RPC=https://solana-mainnet.g.alchemy.com/v2/YOUR_KEY
```

## Admin Configuration

To set up admin access:

1. Connect your wallet to get your public key
2. Add your wallet address to `NEXT_PUBLIC_ADMIN_WALLETS` in Vercel:
```
NEXT_PUBLIC_ADMIN_WALLETS=YOUR_WALLET_ADDRESS_1,YOUR_WALLET_ADDRESS_2
```
3. Redeploy or restart your development server
Comment on lines +143 to +152
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation mentions wallet address configuration for admin access using NEXT_PUBLIC_ADMIN_WALLETS, but the actual implementation uses email/password authentication via NextAuth. This is inconsistent with the current implementation. This section should be updated to reflect the email-based admin authentication system, or removed entirely since it's not applicable to the current implementation.

Copilot uses AI. Check for mistakes.

## Features Overview

### Dashboard
- Real-time SOL balance and portfolio value
- Token holdings with price information
- Transaction history
- Quick actions (Send, Swap, Stake, NFTs)

### Admin Panel
- **User Management**: View and manage all users
- **Role Management**: Create and configure roles with custom permissions
- **Activity Log**: Monitor all system activities and user actions

### Role-Based Access Control (RBAC)

Three default roles:
- **Admin**: Full system access
- **Moderator**: Limited management capabilities
- **User**: Basic dashboard access

Permissions can be customized per role:
- Manage Users
- Manage Roles
- View Analytics
- Manage Settings
- View Dashboard

## Development

### Project Structure

```
web-dashboard/
├── app/
│ ├── dashboard/ # Dashboard page
│ ├── admin/ # Admin panel
│ ├── layout.tsx # Root layout
│ └── page.tsx # Landing page
├── components/
│ ├── WalletProvider.tsx
│ ├── DashboardStats.tsx
│ ├── UserManagement.tsx
│ ├── RoleManager.tsx
│ └── ...
├── lib/ # Utility functions
└── public/ # Static assets
```

### Tech Stack

- **Framework**: Next.js 14 (App Router)
- **Styling**: Tailwind CSS
- **Wallet Integration**: Solana Wallet Adapter
- **Blockchain**: Solana Web3.js

## Security Considerations

1. **Admin Access**: Always use environment variables for admin wallet addresses
2. **RPC Endpoints**: Use authenticated RPCs in production
3. **Wallet Connection**: Users must approve all transactions
4. **Session Management**: Implement proper session handling in production

## Troubleshooting

### Wallet Connection Issues

If you encounter wallet connection problems:
1. Ensure you have a compatible wallet installed (Phantom, Solflare, etc.)
2. Check that you're on the correct network
3. Try refreshing the page and reconnecting

### Build Errors

If you encounter build errors:
```bash
# Clear Next.js cache
rm -rf .next

# Reinstall dependencies
rm -rf node_modules
npm install

# Rebuild
npm run build
```

## Support

For issues and questions:
- GitHub Issues: [https://github.com/SMSDAO/solana-agent-kit/issues](https://github.com/SMSDAO/solana-agent-kit/issues)
- Documentation: [https://docs.sendai.fun](https://docs.sendai.fun)

## License

Apache-2.0 License - see [LICENSE](../LICENSE) file for details
Loading
Loading