Skip to main content
SolBid uses a monorepo architecture with three main components: a Solana program written in Rust, a Next.js frontend application, and a WebSocket server for real-time updates. This guide will walk you through setting up your local development environment.

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js (v18 or higher)
  • pnpm (package manager)
  • Rust and Cargo (for Solana program development)
  • Solana CLI (v2.0 or higher)
  • PostgreSQL (v14 or higher)
  • Redis (for WebSocket server job queue)
  • Git
SolBid enforces pnpm as the package manager. The preinstall script will prevent installations with npm or yarn.

Clone the repository

1

Clone the repo

Clone the SolBid monorepo to your local machine:
git clone <repository-url>
cd solbid
2

Install dependencies

Install dependencies for all components:
# Install Next.js app dependencies
cd next-app
pnpm install

# Install WebSocket server dependencies
cd ../ws
pnpm install

# Build Rust program
cd ../programs
cargo build-bpf
The Next.js app runs a postinstall script that automatically generates the Prisma client.

Set up the Solana program

The Solana program is located in the programs/ directory and uses native Solana development (not Anchor).
1

Build the program

Build the Solana program:
cd programs
cargo build-bpf
2

Run tests

Run the program tests:
cargo test
3

Deploy to local validator

Start a local Solana validator and deploy:
# In a separate terminal
solana-test-validator

# Deploy the program
solana program deploy target/deploy/programs.so
Make sure your Solana CLI is configured to use the localnet cluster:
solana config set --url localhost

Set up the Next.js app

The Next.js application is located in the next-app/ directory.
1

Configure environment

Create a .env file in the next-app/ directory. See the Environment variables page for required variables.
2

Set up database

Run Prisma migrations to set up your PostgreSQL database:
cd next-app
npx prisma migrate dev
See the Database page for more details.
3

Seed the database

Initialize the database with seed data:
pnpm run seed
4

Start development server

Start the Next.js development server:
pnpm run dev
The app will be available at http://localhost:3000

Set up the WebSocket server

The WebSocket server is located in the ws/ directory and handles real-time game updates.
1

Configure environment

Create a .env file in the ws/ directory with the required variables:
PORT=8080
NEXT_PUBLIC_SECRET=your-jwt-secret
2

Start Redis

Ensure Redis is running locally:
redis-server
3

Start development server

Start the WebSocket server:
cd ws
pnpm run dev
The server will be available at http://localhost:8080

Running all components

For full local development, you need to run all three components simultaneously:
solana-test-validator

Build for production

To create production builds:
cd next-app
pnpm run build
pnpm run start
The build script automatically generates the Prisma client before building.
cd ws
pnpm run build
pnpm run start
The build script compiles TypeScript to JavaScript in the dist/ directory.
cd programs
cargo build-bpf --release

Troubleshooting

If you encounter Prisma client errors, regenerate the client:
cd next-app
npx prisma generate
SolBid requires pnpm. If you see installation errors, make sure you’re using pnpm:
npm install -g pnpm
pnpm install
Ensure you have the correct Solana version installed:
solana --version
# Should be 2.0.13 or compatible

Next steps

Build docs developers (and LLMs) love