OrangeCat - Bitcoin Fundraising Platform
A modern platform for creating and managing Bitcoin funding pages with transparency features.
Current Status: 🛡️ SECURITY HARDENED - All critical vulnerabilities fixed | 📊 Test Coverage Needed - Currently 4.9% (Target: 80%)
🚀 Quick Start (No More Port Issues!)
IMPORTANT: Always use these commands instead of npm run dev to avoid port conflicts:
For Git Bash (Recommended):
npm run fresh:start
For Windows Command Prompt:
scripts\dev.bat
For VS Code Users:
- Press
Ctrl+Shift+P - Type "Tasks: Run Task"
- Select "🚀 Start Dev (Clean)"
📦 Available Scripts
| Command | Description |
|---|---|
npm run fresh:start |
USE THIS - Kills existing Node processes, clears cache, starts dev cleanly |
npm run dev:clean |
Alternative clean start using bash script |
npm run kill:node |
Kill all Node.js processes (frees up ports) |
npm run clear:cache |
Clear Next.js and npm cache |
npm run dev |
Standard dev (may cause port conflicts) |
npm test |
Run test suite (103 tests, 4.9% coverage) |
npm test -- --coverage |
Run tests with detailed coverage report |
🛡️ Security Status
✅ SECURE - All critical vulnerabilities have been fixed:
- ✅ File upload authorization bypass - FIXED
- ✅ Console.log data exposure - FIXED
- ✅ Celebrity impersonation prevention - FIXED
- ✅ Auth state inconsistencies - FIXED
Security Test Coverage: 69 comprehensive security tests passing
🧪 Testing Status
📊 Test Coverage: 4.9% (Need 80% for production)
- Total Tests: 103 tests across 8 test suites
- Security Tests: 69 tests (excellent coverage)
- Component Tests: Minimal (major gap)
- Integration Tests: None (critical gap)
Test Commands:
npm test # Run all tests
npm test -- --coverage # Get coverage report
npm test -- --watch # Watch mode for development
🛠️ Troubleshooting Port Issues
If you ever get "Port XXXX is in use" errors:
Quick Fix:
npm run kill:node
npm run fresh:start
Manual Fix:
# Kill all Node processes
powershell "Stop-Process -Name node -Force -ErrorAction SilentlyContinue"
# Clear cache
rm -rf .next
npm cache clean --force
# Start fresh
npm run dev
🎯 Development Best Practices
- Always use
npm run fresh:startinstead ofnpm run dev - Close terminals properly - don't just close the window while dev server is running
- Use VS Code tasks for one-click development
- Clear cache regularly if you experience build issues
- Run tests before committing -
npm test
🔧 VS Code Setup
The project includes VS Code tasks for easy development:
- 🚀 Start Dev (Clean) - Default build task (Ctrl+Shift+P → "Tasks: Run Build Task")
- 🧹 Kill All Node Processes - Emergency port cleanup
- 🗑️ Clear Cache - Clear build cache
- 🧪 Run Tests - Execute test suite
📁 Project Structure
src/
├── app/ # Next.js app router pages
│ ├── profile/ # Profile management pages
│ ├── funding/ # Funding page routes
│ ├── dashboard/ # Dashboard pages
│ ├── api/ # API routes
│ │ └── __tests__/ # API security tests (69 tests)
│ └── __tests__/ # Page tests
├── components/ # React components
│ ├── auth/ # Authentication components
│ ├── funding/ # Funding page components
│ ├── layout/ # Layout components
│ ├── profile/ # Profile components
│ └── ui/ # Reusable UI components
├── hooks/ # Custom React hooks
│ ├── useAuth.ts # Authentication hook (21 tests)
│ └── __tests__/ # Hook tests
├── services/ # External services integration
│ ├── supabase/ # Supabase client and helpers
│ └── transparency.ts # Transparency scoring service
├── stores/ # State management
│ ├── campaignStore.ts # Campaign state (Zustand)
│ └── __tests__/ # Store tests
├── utils/ # Utility functions
│ ├── validation.ts # Input validation (security hardened)
│ └── verification.ts # Celebrity impersonation prevention
└── types/ # TypeScript type definitions
docs/ # Comprehensive documentation
├── security/ # Security documentation
├── architecture/ # System architecture docs
├── forward-looking/ # TODO and roadmap
└── development/ # Development guides
config/ # Configuration files
├── dashboard.ts # Dashboard configuration
└── navigation.ts # Navigation configuration
scripts/ # Development scripts
├── dev.sh # Unix/Git Bash clean start
└── dev.bat # Windows batch clean start
🚀 Tesla-Grade Draft System
This project includes a sophisticated draft management system with:
- Real-time synchronization with conflict resolution
- Event-sourced architecture for complete audit trail
- Offline-first design with automatic sync
- Beautiful real-time UI with status indicators
Tech Stack
- Frontend: Next.js 14, React, TypeScript
- Styling: Tailwind CSS with centralized theme system
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth (security hardened)
- Bitcoin Integration: Mempool API
- State Management: Zustand (auth & campaigns)
- Testing: Jest, React Testing Library
- Security: Multi-layer validation, celebrity impersonation prevention
Features
✅ Production Ready
- User authentication and profile management
- Bitcoin funding page creation
- Real-time transaction tracking
- Transparency scoring system
- Responsive design
- Comprehensive security system
- Celebrity impersonation prevention
- File upload security
- Bitcoin address validation
🔬 Experimental
- Lightning Network integration
- Advanced analytics dashboard
- Campaign sharing system
Recent Security Improvements
Major Security Fixes (June 2025)
- File Upload Security: Fixed authorization bypass, added malicious file detection
- Celebrity Protection: Comprehensive impersonation prevention system
- Authentication: Enhanced auth state management and validation
- Console Security: Removed production data exposure
Security Test Coverage
- 25 celebrity impersonation prevention tests
- 21 authentication tests
- 9 file upload security tests
- 8 profile security tests
- 6 funding security tests
Development Priorities
🚨 CRITICAL: Test Coverage (Current Focus)
Status: 4.9% coverage (Target: 80%) Priority: Essential before production deployment Timeline: 2-3 weeks
Next Priorities (After Testing)
- TypeScript
anytypes cleanup (200+ instances) - Architecture refactoring (split large files)
- Performance optimization
Getting Started
- Clone the repository
- Install dependencies:
npm install - Set up environment variables:
cp .env.example .env.local - Start the development server:
npm run fresh:start - Run tests to verify setup:
npm test
Development Commands
npm run fresh:start- Recommended: Clean development startnpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm test- Run comprehensive test suitenpm test -- --coverage- Generate coverage reportnpm run type-check- TypeScript validation
Contributing
- Fork the repository
- Create your feature branch
- Write tests for new functionality
- Ensure all tests pass:
npm test - Commit your changes
- Push to the branch
- Create a Pull Request
Note: All PRs must include tests and maintain >80% coverage for new code.
Security
This platform handles Bitcoin transactions and takes security seriously:
- All critical vulnerabilities have been fixed
- Comprehensive security test suite (69 tests)
- Regular security audits
- See
docs/security/for detailed security documentation
Report security issues to: [security contact information]
License
This project is licensed under the MIT License - see the LICENSE file for details.
💡 Pro Tips
- Never run multiple
npm run devinstances - usenpm run fresh:startinstead - Use VS Code tasks for the best development experience
- Run tests regularly -
npm testcatches issues early - Check coverage -
npm test -- --coverageshows what needs testing - Clear cache if you experience weird build behaviors
Happy coding! 🎉