A Discord bot and web application platform that provides reputation-based access control for Discord servers. FairGate integrates wallet verification with FairScale (a Solana-based reputation system) to enable custom tiered role assignments based on users' financial behavior and reputation scores.
Traditional Discord access control relies on static token holdings, which doesn't reflect user behavior, risk assessment, or reputation. FairGate solves this by enabling Discord servers to gate access and assign roles based on FairScale's reputation scores, creating a more nuanced and fair access control system.
- Wallet Linking - Connect your Solana wallet securely
- Reputation Verification - FairScale reputation scores are fetched automatically
- Automatic Role Assignment - Receive Discord roles based on your FairScore
- Multi-Server Support - One wallet link works across all servers using FairGate
- Read-Only Verification - No wallet transactions or fees required
- Tier Management - Create custom tiers with
/tier add,/tier remove,/tier list - Role Configuration - Assign Discord roles to FairScore thresholds (0-1000)
- Emoji Customization - Add emojis to tier names
- Auto-Setup - Bot automatically creates setup and verification channels on join
- Node.js + Express.js
- TypeScript
- Discord.js
- Prisma ORM + PostgreSQL
- FairScale API Integration
- React 19
- TypeScript
- Vite
- Tailwind CSS
- Solana Wallet Adapter (Phantom, Solflare)
fairthon/
├── backend/
│ ├── src/
│ │ ├── api/ # REST API routes and services
│ │ ├── bot/ # Discord bot commands and events
│ │ ├── config/ # Configuration management
│ │ └── lib/ # Shared libraries (Prisma client)
│ └── prisma/ # Database schema
│
└── ui/
└── src/
├── pages/ # React pages (Home, WalletLink)
└── App.tsx # Main application component
- Node.js (v18+)
- PostgreSQL
- Discord Application (Bot Token & Client ID)
- FairScale API credentials
Create .env files in both backend/ and ui/ directories.
Backend (backend/.env):
PORT=3000
NODE_ENV=development
API_URL=http://localhost:3000
APP_URL=http://localhost:5173
# Discord
DISCORD_TOKEN=your_discord_bot_token
DISCORD_CLIENT_ID=your_discord_client_id
# FairScale
FAIRSCALE_API_URL=https://api.fairscale.io
FAIRSCALE_API_KEY=your_fairscale_api_key
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/fairgate
# Service toggles
START_API=true
START_BOT=trueFrontend (ui/.env):
VITE_API_URL=http://localhost:3000- Clone the repository:
git clone <repository-url>
cd fairthon- Install backend dependencies:
cd backend
npm install- Set up the database:
npx prisma generate
npx prisma db push- Deploy Discord commands:
npm run deploy:commands- Install frontend dependencies:
cd ../ui
npm installBackend:
cd backend
npm run dev # Run both API and bot
npm run dev:api # Run API only
npm run dev:bot # Run bot onlyFrontend:
cd ui
npm run dev # Development server at http://localhost:5173| Command | Description |
|---|---|
/ping |
Check bot latency |
/tier add |
Add a new FairScore tier |
/tier remove |
Remove an existing tier |
/tier list |
View all configured tiers |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check |
| POST | /api/link/ |
Create wallet link |
| GET | /api/link/:userId |
Fetch wallet link |
| GET | /api/verify/:guildId/:userId |
Show verification UI |
| GET | /api/score?wallet=<address> |
Fetch FairScore for wallet |
- Guild - Discord server configuration and metadata
- Tier - FairScore tiers with role mappings
- WalletLink - User wallet to Discord ID associations
MIT