Prerequisites
Before setting up SFLUV locally, ensure you have the following installed:Required Software
- Go 1.24+ - Backend server language
- Node.js 18+ - Frontend and Ponder indexer
- pnpm - Package manager for frontend/Ponder
- PostgreSQL 14+ - Database (3 separate databases required)
- Foundry (anvil, cast) - For local blockchain testing
Optional Tools
- psql - PostgreSQL command-line client
- git - Version control
Project Structure
Database Setup
SFLUV requires three PostgreSQL databases:- app - Users, roles, workflows, votes, credentials
- bot - Faucet events, redemption codes, W9 submissions
- ponder - Indexed blockchain transfers and approval events
Create Databases
Installation
1. Clone the Repository
2. Backend Setup
3. Frontend Setup
4. Ponder Setup
Running Services
Development Mode (All Services)
Run each service in a separate terminal:Terminal 1: Backend
http://localhost:8080
Terminal 2: Frontend
http://localhost:3000
Terminal 3: Ponder (Blockchain Indexer)
http://localhost:42069
Ponder should not be changed - it’s a stable blockchain indexer that listens to ERC20 events and POSTs to
/ponder/callback.Running Tests
Backend Tests
Frontend Type-Check
Frontend Linting
Local HTTPS Setup (Optional)
For testing features requiring HTTPS (like wallet connections):- Generate local certificates:
- Configure backend
.env:
- Backend will serve on both HTTP (8080) and HTTPS (8443)
Verifying Setup
Check Backend
Check Frontend
Visithttp://localhost:3000 - you should see the merchant map landing page.
Check Ponder
Common Issues
Port Already in Use
Database Connection Errors
- Verify PostgreSQL is running:
pg_isready - Check database credentials in
.env - Ensure all three databases exist
Go Module Issues
Node Module Issues
Next Steps
Environment Variables
Configure backend, frontend, and Ponder environment variables
Database Schema
Learn about the three database schemas
Backend Architecture
Understand the Go backend structure
Frontend Architecture
Explore the Next.js frontend