Villages Gallery

Bootstrapped with the Underdog Next JS Gallery

Visit Underdog to learn more.

Villages CWI

The VillagesDAO Clean Water Initiative represents a partnership between Aerial IoT, Cryptochicks NFT Community, and LavaDAO. Our goal is to establish wireless connectivity, earning opportunities, and water monitoring for impacted communities around the globe. Our first SORMN has been deployed near Navi Mumbai, and our teams of women leaders are spearheading operations on the ground. Contribute to our cause by purchasing an NFT or simply donating. Follow us on twitter to learn more.

Quick Start

  • Get setup on Underdog to get your Underdog keys.
  • Get setup on Sphere to get your Sphere keys.
  • Get setup on Stripe to get your Stripe keys.

Rename and configure your .env file.

Rename .env.template to .env and replace the values with your acquired keys. For your front-end, deployments on Vercel will need variables to start with NEXT_PUBLIC_ in order for your UI to call them. Import this .env file to your Vercel Environment Variables in Settings.

  1. Install dependencies
yarn
  1. Run the development server
yarn dev
  1. Open http://localhost:3000

Webhook Setup

You can run the setup script to automatically generate webhooks on both Underdog and Sphere.

yarn run setup

Note: you'll need to have your Underdog API key and Sphere API key, set your network, and set the app URL in your environment variables.

Otherwise, you can use the interface to manually create webhooks.

Underdog

  1. Go to https://app.underdogprotocol.com/webhooks

  2. Click Add Webhook

  3. Set URL to ${APP_URL}/api/underdog/webhooks and select project.create

Sphere

  1. Go to https://spherepay.co/dashboard/developers/webhooks

  2. Click Create Webhook

  3. Set URL to ${APP_URL}/api/sphere/webhooks and select Payment Successful

Environment Variables

Variable Description Example
APP_URL The URL of the app used to redirect after a successful payment on the Sphere checkout page https://gallery.underdogprotocol.com
NEXT_PUBLIC_APP_NAME The name of the app used in the header Underdog Gallery
NEXT_PUBLIC_NETWORK Either MAINNET for Solana mainnet-beta or DEVNET for Solana devnet DEVNET
UNDERDOG_API_KEY Key to authenticate your Underdog requests generated from https://app.underdogprotocol.com/apikeys 1cc491851db99d.aasdfasdf342423524531242
SPHERE_API_KEY Key to authenticate your Sphere requests generated from https://spherepay.co/dashboard/developers/api-keys secret_aasdfasdf342423524531242
SPHERE_WEBHOOK_SECRET Secret to validate webhook requests sent from Sphere secret_123dsafdsafadsf

Deploy on Vercel

Deploy with Vercel