Getting Started

A quick guide to setting up your environment, running the project locally, and making your first trade.

1. Local Setup

Prerequisites

  • Node.js (v18+)
  • pnpm (Recommended package manager)
  • Docker (for Supabase emulation)
  • A Solana wallet (e.g., Phantom)

Installation

Clone the repository and install dependencies:

bash code
git clone https://github.com/kalshchain/kalshchain.git
cd kalshchain
pnpm install

Environment Variables

Create a .env.local file and populate it with your Supabase credentials:

bash code
NEXT_PUBLIC_SUPABASE_URL=YOUR_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
# Optional: Solana RPC Endpoint
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com

2. Run the Project

Start the development server and Supabase services.

Start Supabase

Using the Supabase CLI (if installed) or Docker:

bash code
# Start all Supabase services locally
supabase start

After starting, update your .env.local with the local Supabase URLs provided in the terminal output.

Run Next.js

bash code
pnpm run dev

The application will be accessible at http://localhost:3000.

3. Make Your First Trade

  1. Connect Wallet: Click the "Connect Wallet" button and select your Solana wallet (e.g., Phantom).
  2. Find a Market: Navigate to the Explore page and select any active market.
  3. Trade: Use the trading panel to choose 'BUY' or 'SELL', select 'YES' or 'NO' outcome, and enter a quantity.
  4. Confirm: Review the trade details and approve the transaction in your wallet.

Congratulations! You've successfully initiated your first decentralized prediction market trade on KalshChain.

What's Next?