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.
backend/: The FastAPI backend application.frontend/: The React frontend application.
- Python 3.8+
- Node.js 14+ and npm
-
Navigate to the backend directory:
cd backend -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Run the backend server:
uvicorn main:app --reload
The API will be available at
http://localhost:8000.
-
Navigate to the frontend directory:
cd frontend -
Install the dependencies:
npm install
-
Run the frontend development server:
npm start
The application will open in your browser at
http://localhost:3000.
- Start both the backend and frontend servers.
- The frontend will load and show an empty list of queues.
- 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"] }
- Refresh the frontend. The new queue should appear.
- Use the orchestrator service (manually, for now) to populate the queue.
- To simulate the orchestrator, you can add a temporary endpoint to
main.pyto trigger it or run it from a Python shell. - Alternatively, use the
enqueueendpoint directly.
- To simulate the orchestrator, you can add a temporary endpoint to
- Click on the queue in the UI to start reviewing items.