Skip to content

avinxshKD/CyFuture-AI

Repository files navigation

CyFuture AI - Blockchain-Secured AI Accountant

Blockchain-secured AI accounting platform. Handles invoice OCR, GST reconciliation, and immutable audit trails on Solana.

Next.js React TypeScript Solana Tailwind CSS

What it does

  • Extracts invoice data (numbers, dates, line items, GST info) from images using Google Gemini
  • Stores document hashes on Solana for tamper-proof verification
  • Pins original documents to IPFS via Pinata
  • Reconciles GST across invoices automatically
  • Provides a dashboard with financial analytics

Tech stack

Layer Tools
Framework Next.js 14 (App Router), React 19, TypeScript 5
Blockchain Solana Web3.js, Wallet Adapter (Phantom, Backpack)
AI/OCR Google Gemini (vision model), custom extraction pipeline
Storage IPFS/Pinata, localStorage for client state
Styling Tailwind CSS 4, Radix UI, Framer Motion

Getting started

Prerequisites

  • Node.js 18+
  • A Solana wallet (Phantom or Backpack)
  • Google Gemini API key (get one here)
  • Pinata JWT token (sign up)

Setup

git clone https://github.com/avinxshKD/Cyfuture-Ai.git
cd Cyfuture-Ai
npm install --legacy-peer-deps

Create .env.local:

NEXT_PUBLIC_GEMINI_API_KEY_1=your_gemini_key
NEXT_PUBLIC_GEMINI_API_KEY_2=optional_secondary_key
NEXT_PUBLIC_GEMINI_MODEL=gemini-flash-latest

NEXT_PUBLIC_PINATA_JWT=your_pinata_jwt
NEXT_PUBLIC_IPFS_GATEWAY=https://gateway.pinata.cloud/ipfs

NEXT_PUBLIC_SOLANA_NETWORK=devnet
npm run dev

Open http://localhost:3000.

Project structure

app/                  → Next.js pages (dashboard, OCR, GST, invoices, etc.)
components/           → React components (50+, organized by feature)
  ui/                 → Reusable primitives (button, dialog, tabs, etc.)
  cyfuture/           → Platform-specific components
  home/               → Landing page sections
contexts/             → Auth and storage contexts
hooks/                → useIpfs, useSolanaAction, useSpeechRecognition, etc.
lib/                  → Gemini client, OCR service, utilities

How it works

Upload image → Gemini OCR → Extract invoice data → User reviews/edits
                                                         ↓
                                              ┌──────────┴──────────┐
                                              ↓                     ↓
                                        IPFS (document)    Solana (metadata hash)
                                              ↓                     ↓
                                        Content hash  ←──── Tx signature
  1. User uploads an invoice image (JPG/PNG/WebP)
  2. Gemini vision model extracts structured data
  3. User reviews and corrects if needed
  4. Document gets pinned to IPFS, metadata hash recorded on Solana
  5. Both links are permanently verifiable

API key notes

Gemini: Free tier gives 60 requests/min. Adding a second key enables automatic rotation to avoid rate limits.

Pinata: When creating the API key, enable pinFileToIPFS and pinJSONToIPFS scopes at minimum. See IPFS_FIX_GUIDE.md if you run into 403 errors.

Building for production

npm run build
npm start

For Docker deployment, see the Dockerfile in the repo root. Note: it may need updating for the current Next.js setup — check comments inside.

Contributing

  1. Fork the repo
  2. Create a branch (git checkout -b feature/your-feature)
  3. Commit and push
  4. Open a PR

Keep commits focused. Follow the existing code style. Run npm run lint before pushing.

License

MIT


GitHub: @avinxshKD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages