π― The world's first practical AI+blockchain decision verification system using Claude AI and Hedera Hashgraph Consensus Service (HCS).
This application creates verifiable trails of AI decisions by:
- Processing user queries through Claude AI with structured responses
- Logging decisions to Hedera Consensus Service for immutable verification
- Providing cryptographic proofs of AI response integrity
- Offering a professional dashboard for real-time decision tracking and analytics
- β JWT-based authentication with secure session management
- β User registration and login with password validation
- β Protected API routes with middleware authentication
- β Secure logout with token cleanup
- β Claude AI integration for intelligent decision processing
- β Structured AI responses with metadata tracking
- β Decision hashing using SHA-256 for verification
- β Performance monitoring with processing time tracking
- β Token usage tracking for cost management
- β PostgreSQL database with Prisma ORM
- β User management with profile data
- β Decision storage with complete audit trail
- β Session management for JWT tokens
- β Audit logging for security events
- β Responsive design with TailwindCSS
- β Real-time statistics showing decision metrics
- β AI query interface for live decision processing
- β Decision history with detailed tracking
- β System health monitoring with service status
- β Phase development tracking for project status
- Node.js v18.20.4 (managed via NVM)
- PostgreSQL database (Neon recommended)
- Anthropic API key for Claude AI
- Git for Windows with Bash support
-
Clone and navigate to the project:
οΏ½ash git clone <repository-url> cd ai-hcs-verifiable-decisions -
Install dependencies:
οΏ½ash npm install -
Configure environment variables: `οΏ½ash
cp .env.example .env.local `
Required environment variables: `env
DATABASE_URL="postgresql://username:password@host:5432/database?sslmode=require"
ANTHROPIC_API_KEY="sk-ant-your-api-key"
NEXTAUTH_SECRET="your-secure-random-string-32-chars+" NEXTAUTH_URL="http://localhost:3000" `
-
Set up the database:
οΏ½ash npx prisma generate npx prisma db push -
Start the development server:
οΏ½ash npm run dev -
Visit the application: Open http://localhost:3000 in your browser
ai-hcs-verifiable-decisions/ βββ src/ β βββ app/ # Next.js App Router pages β β βββ api/ # API routes β β β βββ auth/ # Authentication endpoints β β β βββ ai/ # AI processing endpoints β β β βββ decisions/ # Decision management β β β βββ dashboard/ # Dashboard data β β βββ dashboard/ # Dashboard page β β βββ login/ # Login page β β βββ register/ # Registration page β β βββ page.tsx # Home page β βββ lib/ # Core utilities β β βββ auth.ts # Authentication logic β β βββ claude.ts # AI integration β β βββ prisma.ts # Database client β β βββ api-utils.ts # API helpers β βββ types/ # TypeScript definitions βββ prisma/ β βββ schema.prisma # Database schema βββ package.json # Dependencies and scripts βββ tailwind.config.ts # Styling configuration βββ tsconfig.json # TypeScript configuration βββ README.md # This file
- Status: π COMPLETE
- Features: Authentication, AI integration, database, dashboard
- Timeline: Week 1-2
- Validation: All endpoints tested, TypeScript compilation clean
- Status: π READY TO START
- Features: HCS message submission, verification, Mirror Node integration
- Timeline: Week 3-4
- Prerequisites: Hedera testnet account, HCS topic creation
- Status: π PLANNED
- Features: Advanced analytics, real-time verification, reporting
- Timeline: Week 5-6
- Dependencies: Phase 2 completion
This project follows the Master Node.js Development Protocol v6.0 with Windows-specific optimizations:
- File Creation: Git Bash for UTF-8 clean configuration files
- Operations: PowerShell for npm commands and testing
- Testing: PowerShell API testing workflows
- Environment: NVM for Node.js version management
Comprehensive PowerShell testing scripts are available for validating all endpoints:
`powershell
Invoke-RestMethod -Uri "http://localhost:3000/api/auth/login" -Method Post -Body ( | ConvertTo-Json) -ContentType "application/json"
Invoke-RestMethod -Uri "http://localhost:3000/api/ai/query" -Method Post -Body ( | ConvertTo-Json) -ContentType "application/json" -Headers @{Authorization="Bearer "} `
- Frontend: Next.js 15.3.5 with App Router, TypeScript, TailwindCSS
- Backend: Next.js API Routes with JWT authentication
- Database: PostgreSQL with Prisma ORM
- AI Service: Anthropic Claude API
- Blockchain: Hedera Hashgraph (Phase 2)
- Deployment: Vercel-ready (Phase 3)
- Users: Authentication and profile management
- UserSessions: JWT token tracking
- AiDecisions: AI query and response storage with hashes
- AuditLogs: Security and activity tracking
- JWT Authentication: Secure session management
- Password Hashing: bcryptjs with salt rounds
- API Protection: Middleware-based route protection
- Audit Logging: Comprehensive activity tracking
- Input Validation: Request validation and sanitization
- User registration with email validation
- Login with correct credentials
- Dashboard loads with statistics
- AI query processes and returns response
- Decision history displays correctly
- Logout clears session
All API endpoints have been validated using PowerShell testing scripts:
- β POST /api/auth/register - User registration
- β POST /api/auth/login - User authentication
- β GET /api/auth/verify - Token validation
- β POST /api/ai/query - AI decision processing
- β GET /api/decisions - Decision history
- β GET /api/dashboard/overview - Dashboard statistics
- Node.js v18.20.4+
- PostgreSQL database
- Anthropic API access
- Environment variables configured
- Environment variables secured
- Database migrations applied
- TypeScript compilation clean
- Build process successful
- Security headers configured
- Performance optimization applied
This project follows strict development protocols for reliability:
- Phase-based development with clear checkpoints
- Windows-compatible workflows using Git Bash + PowerShell
- TypeScript-first development with strict compilation
- Comprehensive testing before any deployment
- Detailed documentation for reproducibility
This project is part of an AI+blockchain research initiative demonstrating practical applications of verifiable AI decision systems.
π― Phase 1 Status: COMPLETE β
π Next: Phase 2 - Hedera Blockchain Integration
Built with the Master Node.js Development Protocol v6.0 for maximum reliability and Windows compatibility.