A Next.js application powering the public litecoin.com/projects and litecoin.com/donate pages, plus supporting API routes for projects + donations.
- Webflow Integration: Fetch and display projects from Webflow CMS
- TGB (The Giving Block) Integration: Handle fiat and crypto donations
- Project Pages: Browse and view individual project details
- Donation Flow: Complete donation process with TGB API
├── app/
│ ├── api/
│ │ ├── webflow/ # Webflow API routes
│ │ ├── tgb/ # The Giving Block API routes
│ │ └── cache/ # Cache management
│ ├── projects/ # Project pages
│ └── donate/ # Donation page
├── services/
│ ├── webflow/ # Webflow service layer
│ └── tgb/ # TGB service layer
├── types/ # TypeScript type definitions
├── lib/ # Shared libraries (KV, Prisma)
└── utils/ # Utility functions
-
Install dependencies (Note: Requires Node.js 20.19+ or 22.12+ for Prisma)
npm install
-
Set up environment variables
- Create a
.envfile (this repo expects.envat runtime, as shown innext buildoutput). - Provide:
- Webflow API token / collection IDs
- The Giving Block credentials
- KV credentials (if used)
DATABASE_URL(points at the legacy production DB if you want exact parity)
- Create a
-
Set up Prisma (after upgrading Node.js)
npx prisma generate
-
Run the development server
npm run dev
This list reflects the routes produced by next build (App Router).
GET /api/webflow/projects- Get all published projectsGET /api/webflow/projects/[slug]- Get project by slug
- Legacy-parity donation endpoints (used by the donation UI)
POST /api/createFiatDonationPledgePOST /api/chargeFiatDonationPledgePOST /api/createDepositAddressPOST /api/createStockDonationPledgePOST /api/submitStockDonationPOST /api/signStockDonation
- TGB proxy endpoints
POST /api/tgb/donations/fiatPOST /api/tgb/donations/crypto
GET /api/statsGET /api/getInfoTGB?slug=...GET /api/getWidgetSnippetGET /api/matching-donors-by-project?slug=...GET /api/contributors
These correspond to the public site routes:
/projects→litecoin.com/projects(project list + donation modal)/projects/[slug]→litecoin.com/projects/:slug(project detail + donation modal)/donate→litecoin.com/donate(donation page)/projects/submit(project submission form)/projects/submitted(submission confirmation)
This app expects env vars compatible with the existing (legacy) production DB and TGB.
-
Database
DATABASE_URL: must point at the existing live DB (same one used by the old project).- The current Prisma client (
litecoin-fund/lib/prisma.ts) reads onlyDATABASE_URL. - Do not run
prisma migrateagainst the live DB.
- The current Prisma client (
-
The Giving Block
GIVING_BLOCK_LOGINGIVING_BLOCK_PASSWORD
-
Schema expectations (legacy parity)
- Token caching uses the legacy
tokenstable with columns:access_token,refresh_token,expires_at,refreshed_at
- Donation persistence uses the legacy
donationstable (andwebhook_eventswhen webhook parity is implemented).
- Token caching uses the legacy
This project requires Node.js 20.19+ or 22.12+ for Prisma support. If you're on an older version, you can still develop the frontend and API routes, but Prisma functionality will be disabled until you upgrade.