A demonstration application for the PubKey Protocol, the social layer on Solana.
The protocol allows users to link verified accounts from multiple identity providers to their profile on Solana.
This demo is a working implementation of PubKey Protocol (currently) on Solana Devnet. It allows users to:
- Create a Profile using a Solana wallet
- Link accounts from multiple identity providers (Discord, GitHub, Google, X/Twitter)
- Connect additional Solana wallets
- Set an avatar, display name, and bio
- Node.js (v20 or later)
- pnpm (v9 or later)
- Docker and Docker Compose (for local development with Postgres)
- Solana CLI tools
- Run
pnpm anchor localnet
in the PubKey Protocol repo.
git clone https://github.com/pubkeyapp/pubkey-protocol-demo.git
cd pubkey-protocol-demo
pnpm install
Copy the example environment file and update it with your settings:
cp .env.example .env
Required environment variables:
COOKIE_SECRET
: Generate a random secret usingopenssl rand -hex 32
DATABASE_URL
: Postgres connection string (default:postgresql://pubkey-protocol-demo:pubkey-protocol-demo@localhost:5432/pubkey-protocol-demo?schema=public
)DOMAIN
: Server domain (uselocalhost
for local development)PORT
: Server port (default: 3000)SOLANA_FEE_PAYER_AUTHORITY
: Fee payer authority keypair (generate usingsolana-keygen
)SOLANA_FEE_PAYER_COMMUNITY
: Fee payer community keypair (generate usingsolana-keygen
)SOLANA_RPC_ENDPOINT
: Solana blockchain RPC endpoint (usehttp://localhost:8899
for local development)
pnpm dev:services
This will start a Postgres database using Docker Compose.
pnpm setup
Make sure you are running the PubKey Protocol localnet.
pnpm dev
The application will be available at http://localhost:5173.
To build the application for production:
pnpm build
To start the production server:
pnpm start
You can build and run the application using Docker:
# Build the Docker image
pnpm docker:build
# Run the Docker container
pnpm docker:run
For local development with Solana, you can run a test validator:
pnpm validator
app/
: Main application codeapi/
: API endpointsfeatures/
: Feature-specific components and logiclib/
: Utility functions and shared codepubkey/
: PubKey protocol integrationui/
: UI components
prisma/
: Database schema and migrations
See LICENSE file for details.