Skip to content

Dv-19/ProofPals

Repository files navigation

πŸ›‘οΈ ProofPals

Anonymous Ring-Based Journalist Review System

A secure, privacy-preserving platform for anonymous peer review of journalistic content using advanced cryptographic techniques including ring signatures, blind credentials, and sybil-resistant voting mechanisms.

🌟 Features

πŸ” Privacy & Security

  • Ring Signatures: Complete voter anonymity while maintaining verifiability
  • Blind Credentials: Sybil-resistant authentication without identity exposure
  • Atomic Operations: Race-condition-free voting with Redis-based locking
  • Key Image Linking: Prevents double-voting without revealing voter identity

πŸ“ Content Review Pipeline

  • Multi-stage Review: Submitter β†’ Vetter β†’ Community voting
  • Escalation System: Flagged content routed to human moderators
  • Audit Trail: Immutable logs for complete transparency
  • Real-time Monitoring: Performance metrics and API call tracking

🎯 User Roles

  • Submitters: Upload content for review
  • Voters: Anonymous community-based scoring
  • Admins: System oversight and escalation handling

πŸš€ Quick Start

Prerequisites

  • Python 3.11+ (for local development)
  • Node.js 18+ (for frontend development)
  • PostgreSQL 15+ & Redis 7+ (handled by Docker)

🐳 Docker Deployment (Recommended)

# Clone the repository
git clone https://github.com/Dv-19/ProofPals.git
cd ProofPals

Access Points:

πŸ› οΈ Local Development

Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment
cp env.example .env
# Edit .env with your database credentials

# Initialize database
python init_db.py

# Start development server
python main.py

Frontend Setup

cd proofpals-frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

πŸ“ Project Structure

ProofPals/
β”œβ”€β”€ πŸ”§ backend/                 # FastAPI backend
β”‚   β”œβ”€β”€ main.py                 # Main application entry
β”‚   β”œβ”€β”€ models.py               # Database models
β”‚   β”œβ”€β”€ auth_service.py         # Authentication & credentials
β”‚   β”œβ”€β”€ crypto_service.py       # Ring signature implementation
β”‚   β”œβ”€β”€ token_service.py        # Atomic token management
β”‚   β”œβ”€β”€ vote_service.py         # Voting logic
β”‚   β”œβ”€β”€ escalation_service.py   # Content escalation
β”‚   └── tests/                  # Comprehensive test suite
β”œβ”€β”€ 🎨 proofpals-frontend/      # React + TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/              # Route components
β”‚   β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ services/           # API integration
β”‚   β”‚   └── types/              # TypeScript definitions
β”‚   └── public/                 # Static assets
β”œβ”€β”€ πŸ” pp_clsag_core/          # Rust cryptographic library
β”œβ”€β”€ 🐳 docker-compose.yml      # Multi-service orchestration
└── πŸ“‹ DEPLOYMENT.md           # Deployment guide

πŸ”§ Technology Stack

Backend

  • FastAPI: High-performance Python web framework
  • PostgreSQL: Primary database with ACID compliance
  • Redis: Caching and atomic operations
  • SQLAlchemy: ORM with Alembic migrations
  • Pydantic: Data validation and serialization

Frontend

  • React 18: Modern UI library with hooks
  • TypeScript: Type-safe JavaScript
  • Vite: Fast build tool and dev server
  • TailwindCSS: Utility-first CSS framework
  • Radix UI: Accessible component primitives
  • React Query: Server state management
  • Zustand: Client state management

Cryptography

  • Ring Signatures: Anonymous voting mechanism
  • Blind Signatures: Privacy-preserving credentials
  • Key Images: Double-spending prevention
  • Rust Integration: High-performance crypto operations

πŸ§ͺ Testing

Backend Tests

cd backend

# Run all tests
python -m pytest

# Run specific test categories
python test_integration.py      # Integration tests
python test_concurrency.py      # Concurrency tests
python sybil_attack_test.py     # Security tests

# Performance testing
python performance_metrics.py

Frontend Tests

cd proofpals-frontend

# Unit tests
npm run test

# E2E tests
npm run test:e2e

# Coverage report
npm run test:coverage

πŸ”’ Security Features

Cryptographic Guarantees

  • Anonymity: Ring signatures hide voter identity among group members
  • Unlinkability: Votes cannot be linked to voters
  • Unforgeability: Only authorized users can create valid signatures
  • Double-spend Prevention: Key images prevent multiple votes

System Security

  • Atomic Operations: Redis-based locking prevents race conditions
  • Input Validation: Comprehensive request validation
  • Rate Limiting: API endpoint protection
  • Audit Logging: Complete action traceability

πŸ“Š Monitoring & Analytics

  • Real-time Metrics: API response times, error rates
  • Performance Reports: Automated system health checks
  • Escalation Tracking: Content review pipeline monitoring
  • User Activity: Anonymous usage statistics

🀝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Run tests: Ensure all tests pass
  4. Commit changes: git commit -m 'Add amazing feature'
  5. Push to branch: git push origin feature/amazing-feature
  6. Open Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Add tests for new features
  • Update documentation as needed

πŸ† Acknowledgments

  • Ring Signature Research: Academic cryptography community
  • Open Source Libraries: All the amazing tools that made this possible

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors