Installation

Set up CredDAO for local development or production deployment.

System Requirements

RequirementMinimumRecommended
Node.js20.x22.x
npm10.x10.x
Rust1.70+1.75+
Solana CLI1.17+1.18+
Anchor0.29+0.30+
PostgreSQL15.x16.x

Clone the Repository

git clone https://github.com/creddao/creddao.git
cd creddao

Install Dependencies

Install all workspace dependencies:

npm install

Environment Setup

Create environment files for each service:

Frontend

Create frontend/.env.local:

NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_SOLANA_NETWORK=devnet
NEXT_PUBLIC_PROGRAM_ID=CreDDAo111111111111111111111111111111111111

API

Create api/.env:

DATABASE_URL="postgresql://user:password@localhost:5432/creddao"
SOLANA_RPC_URL="https://api.devnet.solana.com"
FRONTEND_URL="http://localhost:3000"
PORT=3001

SDK

The SDK uses environment variables at build time:

SOLANA_NETWORK=devnet
PROGRAM_ID=CreDDAo111111111111111111111111111111111111

Database Setup

Initialize the PostgreSQL database:

cd api
npx prisma generate
npx prisma migrate dev

Build Smart Contracts

Build the Anchor programs:

anchor build
Note:

Building smart contracts requires the Solana toolchain and Anchor CLI to be properly installed. See the Solana documentation for installation instructions.

Deploy to Localnet

Start a local Solana validator:

solana-test-validator

Deploy the programs:

anchor deploy

Start Development Servers

Run all services in development mode:

# Terminal 1: API
cd api && npm run dev
 
# Terminal 2: Frontend
cd frontend && npm run dev
 
# Terminal 3: SDK (watch mode)
cd sdk && npm run dev

Verify Installation

Check that everything is running:

# API health check
curl http://localhost:3001/health
 
# Frontend
open http://localhost:3000

Production Deployment

Frontend (Vercel)

cd frontend
vercel --prod

API (Docker)

docker build -t creddao-api ./api
docker run -p 3001:3001 creddao-api

Smart Contracts (Mainnet)

solana config set --url mainnet-beta
anchor deploy --provider.cluster mainnet
Warning:

Deploying to mainnet requires SOL for rent-exempt accounts and transaction fees. Ensure you have sufficient funds in your deployer wallet.

Troubleshooting

Common Issues

Anchor build fails

Ensure you have the correct Solana CLI version:

solana-install init 1.18.0
anchor --version  # Should show 0.30.x
Database connection errors

Verify PostgreSQL is running and the connection string is correct:

psql -h localhost -U user -d creddao
Wallet adapter not connecting

Clear browser storage and ensure you’re on the correct network:

solana config get
# Should show the network you're using