Local Development
Run Atract locally for development.
Prerequisites
Node.js 18+
PostgreSQL 14+
Git
Clone Repository
git clone https://github.com/Atractapp/atractv2.git
cd atractv2/webInstall Dependencies
npm installDatabase Setup
Create database:
createdb atract_devRun migrations:
npx prisma migrate devSeed data (optional):
npx prisma db seedEnvironment Variables
Copy example env file:
cp .env.example .env.localEdit .env.local with your values:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/atract_dev"
# Hyperliquid (testnet)
NEXT_PUBLIC_HL_API_BASE_URL="https://api.hyperliquid-testnet.xyz"
HL_RPC_URL="https://rpc.hyperliquid-testnet.xyz/evm"
HL_AGENT_PRIVATE_KEY="0x..."
ORACLE_PRIVATE_KEY="0x..."
# Auth
SESSION_SECRET="your-random-secret-here"
NEXT_PUBLIC_SITE_URL="http://localhost:3000"See Environment Variables for full list.
Run Development Server
npm run devOpen http://localhost:3000
Run Oracle Service
In a separate terminal:
npm run oracle:startTesting
Run tests:
npm testRun with coverage:
npm run test:coverageBuild for Production
npm run build
npm startTroubleshooting
Database connection fails:
Verify PostgreSQL is running
Check DATABASE_URL format
Ensure database exists
Hyperliquid API errors:
Verify HL_API_BASE_URL
Check agent key is valid
Ensure testnet is accessible
Oracle not updating:
Check ORACLE_PRIVATE_KEY
Verify Hyperliquid RPC connection
Check oracle logs for errors
Related Pages
Last updated