> For the complete documentation index, see [llms.txt](https://crowdfunding-ugmbcc.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://crowdfunding-ugmbcc.gitbook.io/docs/how-to-run/quick-start.md).

# Quick Start

Get the entire CrowdFUNding platform running locally in under 10 minutes! This guide provides the fastest path to a working development environment.

### Prerequisites Checklist

Before starting, ensure you have the following installed:

* [ ] **Node.js** v18+ (`node --version`)
* [ ] **npm** or **yarn**
* [ ] **Foundry** (`forge --version`) - only needed if deploying new contracts
* [ ] **PostgreSQL** running locally or a cloud database URL

### Architecture Overview

Before diving in, here's a quick overview of how the components connect:

{% @mermaid/diagram content="flowchart LR
FE\["Frontend:3000"] --> BE\["Backend:3300"]
BE --> Indexer\["Indexer:42069"]
Indexer --> BC\["Base Sepolia"]
FE --> BC" %}

### Quick Setup (4 Steps)

#### Step 1: Clone the Repositories

Each component is an independent repository. Clone them into your workspace:

```bash
# Clone each repository
git clone https://github.com/CrowdFUNding-Base/indexer.git
git clone https://github.com/CrowdFUNding-Base/FE.git
git clone https://github.com/CrowdFUNding-Base/BE.git
git clone https://github.com/CrowdFUNding-Base/SC.git
```

#### Step 2: Start the Indexer

The indexer needs to run first as the backend depends on it for data.

```bash
cd indexer

# Install dependencies
npm install

# Create environment file
echo "PONDER_RPC_URL_1=https://sepolia.base.org" > .env.local

# Start indexer
npm run dev
```

**Indexer running at:** `http://localhost:42069`

#### Step 3: Start the Backend

Open a **new terminal** for the backend:

```bash
cd BE

# Install dependencies
npm install

# Create environment file
cat > .env << EOF
PORT=3300
NODE_ENV=development
DATABASE_URL=postgresql://user:password@localhost:5432/crowdfunding
SESSION_SECRET=your-secret-key-here
JWT_SECRET=your-jwt-secret-here
FRONTEND_URL=http://localhost:3000
PONDER_URL=http://localhost:42069
RPC_URL=https://sepolia.base.org
EOF

# Setup database tables
npm run db:setup

# Start server
npm start
```

**Backend running at:** `http://localhost:3300`

#### Step 4: Start the Frontend

Open another **new terminal** for the frontend:

```bash
cd FE

# Install dependencies
yarn install

# Create environment file
cat > .env.local << EOF
NEXT_PUBLIC_WALLET_CONNECT_ID=your_walletconnect_id
NEXT_PUBLIC_CAMPAIGN_ADDRESS=0x44e87aa98d721Dbcf368690bF5aAb1F3dD944dA9
NEXT_PUBLIC_BADGE_ADDRESS=0xaE32Df9Fb677aE68C5A1F956761a42e269Ebdc99
NEXT_PUBLIC_IDRX_ADDRESS=0x387551ac55Bb6949d44715D07880f8c6260934B6
NEXT_PUBLIC_USDC_ADDRESS=0x1b929eB40670aA4e0D757d45cA9aea2311a25a97
NEXT_PUBLIC_API_URL=http://localhost:3300
EOF

# Start development server
yarn dev
```

**Frontend running at:** `http://localhost:3000`

***

### Service URLs Summary

<table><thead><tr><th width="209">Service</th><th>URL</th><th>Purpose</th></tr></thead><tbody><tr><td><strong>Frontend</strong></td><td>http://localhost:3000</td><td>User interface</td></tr><tr><td><strong>Backend</strong></td><td>http://localhost:3300</td><td>REST API</td></tr><tr><td><strong>Indexer</strong></td><td>http://localhost:42069</td><td>GraphQL + REST</td></tr><tr><td><strong>Indexer GraphQL</strong></td><td>http://localhost:42069/graphql</td><td>GraphQL playground</td></tr></tbody></table>

***

### Verify Everything is Working

#### 1. Check Indexer Health

```bash
curl http://localhost:42069/health
```

Expected response:

```json
{"status":"ok"}
```

#### 2. Check Backend Health

```bash
curl http://localhost:3300/api/sync/status
```

Expected response:

```json
{"syncing":true,"lastSync":"2024-01-30T12:00:00.000Z"}
```

#### 3. Check Campaign Data

```bash
curl http://localhost:3300/crowdfunding/vaults
```

Expected response:

```json
{"success":true,"data":[...]}
```

#### 4. Open Frontend

Visit <http://localhost:3000> in your browser. You should see the CrowdFUNding landing page!

***

### Smart Contract Addresses

The following contracts are already deployed on Base Sepolia and ready to use:

<table><thead><tr><th width="192.8887939453125">Contract</th><th>Address</th></tr></thead><tbody><tr><td><strong>Campaign</strong></td><td><a href="https://sepolia.basescan.org/address/0x17fb0DD846d2299F525ca0d0402C607C580e80c8">0x17fb0DD846d2299F525ca0d0402C607C580e80c8</a></td></tr><tr><td><strong>Badge</strong></td><td><a href="https://sepolia.basescan.org/address/0x8bdfD4C3f8e108687ABA5d9ebD9aFFe355545471">0x8bdfD4C3f8e108687ABA5d9ebD9aFFe355545471</a></td></tr><tr><td><strong>Mock IDRX</strong></td><td><a href="https://sepolia.basescan.org/address/0x46d84937891D4618f2D70Db4794DFe9cFb628E46">0x46d84937891D4618f2D70Db4794DFe9cFb628E46</a></td></tr><tr><td><strong>Mock USDC</strong></td><td><a href="https://sepolia.basescan.org/address/0x2D34d56F3E1f64FFa297f88E7828Ec0EC7d825f6">0x2D34d56F3E1f64FFa297f88E7828Ec0EC7d825f6</a></td></tr><tr><td><strong>MockSwap</strong></td><td><a href="https://sepolia.basescan.org/address/0xd3D4F196434E8EDCc897F47b36E1234BB514f5BA">0xd3D4F196434E8EDCc897F47b36E1234BB514f5BA</a></td></tr></tbody></table>

***

### Running All Services (Script)

Create a `start-all.sh` script for convenience:

```bash
#!/bin/bash

echo "Starting CrowdFUNding Platform..."

# Start Indexer
echo "Starting Indexer..."
cd indexer && npm run dev &
sleep 5

# Start Backend
echo "Starting Backend..."
cd ../BE && npm start &
sleep 3

# Start Frontend
echo "Starting Frontend..."
cd ../FE && yarn dev

# Cleanup on exit
trap "pkill -f 'ponder|node'" EXIT
```

Run it:

```bash
chmod +x start-all.sh
./start-all.sh
```

***

### Common Issues & Quick Fixes

#### Port Already in Use

Find and kill the process using the port:

```bash
# Find process
lsof -i :3000  # or 3300, 42069

# Kill process
kill -9 <PID>
```

#### Database Connection Failed

Verify PostgreSQL is running:

```bash
pg_isready
```

Or use a cloud database like [Neon](https://neon.tech) or [Supabase](https://supabase.com).

#### Wallet Connection Failed

Ensure you have a valid WalletConnect Project ID:

1. Go to [WalletConnect Cloud](https://cloud.walletconnect.com)
2. Create a new project
3. Copy the Project ID to `NEXT_PUBLIC_WALLET_CONNECT_ID`

#### No Campaigns Showing

1. Wait 30 seconds for backend auto-sync
2. Check indexer logs for errors
3. Verify contract addresses match the deployed contracts

***

### Next Steps

After getting the platform running:

1. **Connect your wallet** at <http://localhost:3000>
2. **Get test ETH** from Base Sepolia faucet
3. **Create a test campaign**
4. **Make a test donation**
5. **Explore the codebase** using the detailed guides
