Prerequisites
Required tools: - Node.js 18+ and pnpm - Foundry (for contracts) - Redis
(for backend caching) - Docker (optional, for indexer)
Clone the Repository
git clone https://github.com/your-org/pulend.git
cd pulend
Setup Components
Smart Contracts
cd contracts
forge install
forge build
Deploy to Story testnet:forge script script/Deploy.s.sol --rpc-url $STORY_TESTNET_RPC --broadcast
Backend
cd backend pnpm install cp .env.example .env # Edit .env with your
RPC_URL and REDIS settings pnpm dev ``` The API runs on
`http://localhost:3001`.
</Step>
<Step title="Frontend">
```bash cd frontend pnpm install cp .env.example .env # Edit .env with
contract addresses pnpm dev ``` Open `http://localhost:3000` in your browser.
</Step>
<Step title="Indexer (Optional)">
```bash
cd indexer
yarn install
yarn codegen
yarn build
docker-compose up -d # Start local Graph node
yarn deploy-local
Environment Variables
Backend .env
PORT=3001
RPC_URL=https://rpc.testnet.story.foundation
REDIS_HOST=localhost
REDIS_PORT=6379
PRICE_CACHE_TTL=60
Frontend .env
NEXT_PUBLIC_LENDING_POOL_ADDRESS=0x...
NEXT_PUBLIC_COLLATERAL_IP_ADDRESS=0x...
NEXT_PUBLIC_BACKEND_URL=http://localhost:3001
Next Steps