AuthiChain is a blockchain product authentication platform combining AI-powered classification (GPT-4 Vision) with blockchain verification. Products get TrueMark IDs, on-chain NFT certificates, and can be verified publicly.
Live: https://authichain.com
- Keep diffs scoped to the requested feature; avoid unrelated refactors.
- Never commit secrets or real credentials; use environment variables and
.env.example. - Run
npm run lintandnpm run buildbefore finishing any app changes. - For UI changes, keep accessibility and mobile responsiveness intact.
- Purple/green gradient theme with dark mode support (next-themes).
- Server components by default;
"use client"only for interactive elements. - UI built with Radix UI primitives + Tailwind CSS 3 + class-variance-authority.
- Animations via Framer Motion.
- Forms use react-hook-form + zod validation.
- SSR auth via
@supabase/ssrmiddleware pattern. - Server-side:
createClient()from Supabase server utils. - Client-side:
createBrowserClient().
- 10 migration files in
supabase/migrations/. - Tables: products, certifications, subscriptions, leads, referrals, brands, supply chain, QRON credits.
- Drizzle ORM configured via
drizzle.config.tsfor type-safe queries. - Direct PostgreSQL via
pgpackage also available.
contracts/AuthiChainNFT.sol— ERC-721 NFT certificate contract (OpenZeppelin).- Hardhat for compilation and deployment.
- Target networks: VeChain (MainNet/TestNet), Polygon (Mainnet/Amoy testnet).
- Deploy:
npm run contract:deploy:polygonorcontract:deploy:testnet.
- OpenAI GPT-4 Vision API for product image classification.
- Fal.ai for generating AI artwork for NFT certificates.
- Subscription plans: Starter ($299/mo) and Pro ($799/mo), with annual discounts.
- Webhook at
/api/stripe/webhook. - Price IDs configured via
NEXT_PUBLIC_STRIPE_PRICE_*env vars.
5 workers in workers/:
license-issuer— License key generation/validationqron-provenance— QRON provenance chain verificationscan-validate— QR scan validationtelegram— Telegram bot integrationverify-worker— Product verification endpoint
- Airtable — CRM/lead management
- Make.com — Welcome email automation webhook
- Thirdweb — NFT minting SDK (Base / Base Sepolia)
- Resend — Transactional email
- Create
app/api/<route>/route.ts. - For authenticated routes: use Supabase server client +
getUser(). - Return
NextResponse.json().
# Compile
npm run contract:compile
# Deploy to testnet
DEPLOYER_PRIVATE_KEY=... npm run contract:deploy:polygon_amoy
# Deploy to mainnet
DEPLOYER_PRIVATE_KEY=... npm run contract:deploy:polygon- Create directory under
workers/<name>/. - Add
wrangler.tomlwith bindings. - Deploy via
wrangler deploy.
app/— Next.js pages and API routes (30+ routes)components/— Radix UI-based React componentscontracts/— Solidity smart contractslib/— Shared utilitieshooks/— React custom hooksserver/— Server-side logicworkers/— Cloudflare Workers (5 workers)supabase/migrations/— Database schema (10 migrations)scripts/— Deployment and utility scriptshardhat.config.ts— Blockchain network configurationdrizzle.config.ts— ORM database configuration