Skip to content

vinaysrao1/tstools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Trust and Safety Tool

This project is a modular and efficient trust and safety tool. It consists of a backend API built with FastAPI and a frontend application built with React.

Project Structure

  • backend/: The FastAPI backend application.
  • frontend/: The React frontend application.

Getting Started

Prerequisites

  • Python 3.8+
  • Node.js 14+ and npm

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Run the backend server:

    uvicorn main:app --reload

    The API will be available at http://localhost:8000.

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install the dependencies:

    npm install
  3. Run the frontend development server:

    npm start

    The application will open in your browser at http://localhost:3000.

How to Use

  1. Start both the backend and frontend servers.
  2. The frontend will load and show an empty list of queues.
  3. Use an API client (like Postman or curl) to create a queue.
    • POST http://localhost:8000/api/queues
    • Body (raw, JSON):
      {
        "id": "image-review-queue",
        "name": "Image Review Queue",
        "description": "A queue for reviewing images.",
        "entity_type": "image",
        "policies": ["nudity", "violence"],
        "languages": ["en"]
      }
  4. Refresh the frontend. The new queue should appear.
  5. Use the orchestrator service (manually, for now) to populate the queue.
    • To simulate the orchestrator, you can add a temporary endpoint to main.py to trigger it or run it from a Python shell.
    • Alternatively, use the enqueue endpoint directly.
  6. Click on the queue in the UI to start reviewing items.

About

Review tools for trust and safety

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors