A modern, full-stack web application starter kit that integrates Privy Server wallet authentication with Solana Agent Kit for building secure and scalable web3 applications.

Features

Privy Authentication

Server-side authentication using @privy-io/server-auth for secure user management

Solana Integration

Built-in Solana wallet and token management using solana-agent-kit

Next.js 15

Built on the latest Next.js framework with App Router for optimal performance

Database Integration

Uses Drizzle ORM with PostgreSQL for type-safe database operations

Modern UI

Styled with Tailwind CSS and Radix UI components for a polished look

Rich Text Editing

Includes CodeMirror and ProseMirror integration for enhanced editing

Type Safety

Full TypeScript support throughout the entire codebase

Testing

Configured with Playwright for comprehensive end-to-end testing

Prerequisites

  • Node.js 18+
  • pnpm 9.12.3+
  • PostgreSQL database

Getting Started

1

Create a new project using gitpick

npx gitpick sendaifun/solana-agent-kit/examples/misc/privy-server-wallet-agent -b v2
cd privy-server-wallet-agent
2

Install dependencies

pnpm install
3

Set up environment variables

Create a .env file with the following variables:

# Database
DATABASE_URL=your_postgres_connection_string

# Privy
PRIVY_APP_ID=your_privy_app_id
PRIVY_APP_SECRET=your_privy_app_secret

# Solana
NEXT_PUBLIC_RPC_URL=your_solana_rpc_url

# Optional: OpenAI for AI features
OPENAI_API_KEY=your_openai_api_key
4

Initialize the database

pnpm db:generate
pnpm db:migrate
5

Start the development server

pnpm dev

Your application will be available at http://localhost:3000

Available Scripts

CommandDescription
pnpm devStart development server
pnpm buildBuild for production
pnpm startStart production server
pnpm lintRun linting
pnpm formatFormat code
pnpm testRun Playwright tests

Database Commands

CommandDescription
pnpm db:generateGenerate database schemas
pnpm db:migrateRun database migrations
pnpm db:studioOpen Drizzle Studio
pnpm db:pushPush schema changes
pnpm db:checkCheck schema changes

Project Structure

├── app/           # Next.js app directory
│   ├── api/       # API routes
│   ├── (auth)/    # Authentication routes
│   └── dashboard/ # User dashboard
├── components/    # React components
│   ├── ui/        # UI components
│   ├── forms/     # Form components
│   └── wallet/    # Wallet components
├── lib/           # Utility functions and libraries
│   ├── db/        # Database configuration
│   ├── auth/      # Auth utilities
│   └── solana/    # Solana utilities
├── hooks/         # Custom React hooks
├── public/        # Static assets
├── tests/         # Playwright tests
└── artifacts/     # Build artifacts

Key Integrations

Privy Authentication

This starter uses Privy for authentication, providing:

  • Social login (Google, Twitter, etc.)
  • Email and phone authentication
  • Wallet-based authentication
  • Server-side session management

Solana Agent Kit Integration

The starter comes with Solana Agent Kit pre-configured, allowing users to:

  • View token balances
  • Send and receive tokens
  • Interact with Solana programs
  • Use AI-powered blockchain interactions

Database Setup

This starter uses Drizzle ORM with PostgreSQL. The schema is defined in lib/db/schema.ts:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the terms of the license included in the LICENSE file.