Skip to content

jbrace02/TruthTerminal.MVP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Truth Terminal MVP

A cyberpunk-styled web application that validates statements and questions using multiple AI models. The Truth Terminal queries GPT-3.5-turbo, Claude-3-haiku, Gemini-pro, and Grok to provide consensus-based responses.

Truth Terminal License

🌟 Features

  • Multi-AI Consensus: Queries 4 different AI models simultaneously
  • Real-time Validation: Get instant "yes", "no", or "unknown" responses
  • Cyberpunk UI: Matrix-style animations with neon teal aesthetics
  • Response Details: View full AI responses in the side panel
  • Alpha Leaks: Curated crypto/blockchain news feed
  • Mobile Responsive: Optimized for all screen sizes
  • In-Memory Ledger: Records all validation attempts with timestamps

🚀 Quick Start

Prerequisites

  • Rust 1.70+ (install from rustup.rs)
  • OpenRouter API key (get from openrouter.ai)
  • X.AI API key (optional, for Grok - get from x.ai)

Installation

  1. Clone the repository

    git clone https://github.com/jbrace02/TruthTerminal.MVP.git
    cd TruthTerminal.MVP
  2. Set up environment variables

    cp .env.example .env
    # Edit .env and add your API keys
  3. Build and run

    cargo build --release
    cargo run
  4. Open in browser

    http://localhost:3030
    

⚙️ Configuration

Environment Variables

Create a .env file in the project root:

OPENROUTER_API_KEY=your_openrouter_api_key_here
X_API_KEY=your_x_api_key_here
PORT=3030

AI Models

The application uses these models via OpenRouter and X.AI:

  • openai/gpt-3.5-turbo
  • anthropic/claude-3-haiku
  • google/gemini-pro
  • x/grok (via X.AI direct API)

🏗️ Architecture

TruthTerminal.MVP/
├── src/
│   └── main.rs          # Rust backend (Warp web server)
├── index.html           # Frontend UI with Matrix animations
├── Cargo.toml           # Rust dependencies
├── .env                 # Environment variables (gitignored)
├── .env.example         # Example environment configuration
└── .gitignore           # Git ignore rules

Technology Stack

Backend:

  • Rust with Tokio async runtime
  • Warp web framework
  • Reqwest for HTTP requests
  • Serde for JSON serialization

Frontend:

  • Vanilla HTML5/CSS3/JavaScript
  • IBM Plex Mono font
  • Canvas API for Matrix animation

🔒 Security

API Key Management

⚠️ IMPORTANT: Never commit API keys to git!

  • API keys are stored in .env (which is gitignored)
  • Use .env.example as a template
  • Rotate keys regularly
  • If a key is exposed, revoke it immediately from the provider's dashboard

Security Best Practices

  1. Revoke any exposed keys immediately
  2. Keep .env in .gitignore
  3. Use environment-specific keys (dev/prod)
  4. Monitor API usage for anomalies
  5. Set up rate limiting on your API keys

🚢 Deployment

Railway / Heroku / Fly.io

  1. Add environment variables in the platform dashboard
  2. Set PORT environment variable (platforms usually provide this)
  3. Deploy from GitHub

Docker (Coming Soon)

# Future implementation

📊 API Endpoints

POST /api/validate

Validates a statement using multiple AI models.

Request:

{
  "statement": "The sky is blue"
}

Response:

{
  "record": {
    "id": "uuid",
    "transaction": {
      "id": "uuid",
      "content": "The sky is blue"
    },
    "consensus": true,
    "details": "...",
    "timestamp": "2025-01-19T12:00:00Z"
  },
  "ai_responses": [
    {
      "agent_name": "openai/gpt-3.5-turbo",
      "is_valid": true,
      "raw_response": "Yes, the sky appears blue..."
    }
  ]
}

🐛 Troubleshooting

Common Issues

"OPENROUTER_API_KEY not set"

  • Ensure .env file exists with valid API key
  • Check that dotenv is loading the file

"Connection timeout"

  • Check your internet connection
  • Verify API keys are valid and have credits
  • Some providers may have rate limits

"Server returned non-JSON response"

  • The backend API might be unavailable
  • Try the demo mode in the frontend

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • OpenRouter for multi-model API access
  • Anthropic Claude, OpenAI, Google, and X.AI for their AI models
  • Matrix movie for the aesthetic inspiration

📞 Contact

Jeremy - jeremy@shoprefit.com

Project Link: https://github.com/jbrace02/TruthTerminal.MVP


⚠️ Security Note: This MVP exposes AI API endpoints. In production, implement proper authentication, rate limiting, and input validation.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published