Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -1,127 +1,114 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
## Features
|
6 |
|
7 |
-
-
|
8 |
-
-
|
9 |
-
-
|
10 |
-
-
|
11 |
-
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
frontend_gradio/
|
19 |
-
βββ config/ # Configuration management
|
20 |
-
βββ api/ # Backend API client
|
21 |
-
βββ components/ # UI formatting components
|
22 |
-
βββ utils/ # Utility functions
|
23 |
-
βββ app.py # Main application
|
24 |
-
βββ .env # Environment variables (not in repo)
|
25 |
-
```
|
26 |
-
|
27 |
-
## Setup Instructions
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
|
33 |
-
1. Copy the example environment file:
|
34 |
```bash
|
35 |
-
|
36 |
-
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
42 |
|
43 |
-
#
|
|
|
|
|
|
|
|
|
44 |
GRADIO_SERVER_PORT=7860
|
45 |
-
GRADIO_SHARE=false
|
46 |
DEBUG=false
|
47 |
```
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
```bash
|
55 |
-
python -m venv venv
|
56 |
-
source venv/bin/activate # On Windows: venv\Scripts\activate
|
57 |
-
```
|
58 |
-
|
59 |
-
2. Install dependencies:
|
60 |
-
```bash
|
61 |
-
pip install -r requirements.txt
|
62 |
-
```
|
63 |
-
|
64 |
-
### 3. Running the Application
|
65 |
-
|
66 |
-
```bash
|
67 |
-
python app.py
|
68 |
-
```
|
69 |
-
|
70 |
-
The application will start on `http://localhost:7860` (or the port specified in your `.env` file).
|
71 |
-
|
72 |
-
## Configuration
|
73 |
-
|
74 |
-
All configuration is managed through environment variables in the `.env` file:
|
75 |
-
|
76 |
-
- **API_BASE_URL** (REQUIRED): Backend API URL
|
77 |
-
- **GRADIO_SERVER_NAME**: Server hostname (default: 0.0.0.0)
|
78 |
-
- **GRADIO_SERVER_PORT**: Server port (default: 7860)
|
79 |
-
- **GRADIO_SHARE**: Enable Gradio sharing (default: false)
|
80 |
-
- **DEBUG**: Enable debug mode (default: false)
|
81 |
-
|
82 |
-
See `.env.example` for a complete list of available configuration options.
|
83 |
|
84 |
-
##
|
85 |
|
86 |
-
|
|
|
|
|
87 |
|
88 |
-
|
89 |
-
ERROR: Required environment variable 'API_BASE_URL' not found in .env file!
|
90 |
-
Please add 'API_BASE_URL=<your-backend-url>' to your .env file
|
91 |
-
```
|
92 |
-
|
93 |
-
## Security
|
94 |
|
95 |
-
|
96 |
-
-
|
97 |
-
-
|
98 |
-
-
|
|
|
|
|
99 |
|
100 |
-
##
|
101 |
|
102 |
-
The
|
103 |
-
-
|
104 |
-
-
|
105 |
-
- Add utility functions in `utils/`
|
106 |
-
- Modify configuration in `config/`
|
107 |
|
108 |
-
##
|
109 |
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
-
|
113 |
-
2. Configure proper security settings
|
114 |
-
3. Use a production WSGI server instead of the development server
|
115 |
-
4. Set `DEBUG=false` in your environment
|
116 |
|
117 |
-
|
|
|
|
|
|
|
|
|
118 |
|
119 |
-
|
120 |
-
- Ensure your `API_BASE_URL` in `.env` is correct
|
121 |
-
- Check if the backend service is running
|
122 |
-
- Verify network connectivity to the backend
|
123 |
|
124 |
-
|
125 |
-
- Make sure `.env` file exists in the project root
|
126 |
-
- Verify all required variables are set
|
127 |
-
- Check for typos in variable names
|
|
|
1 |
+
---
|
2 |
+
title: DGaze News Verification
|
3 |
+
emoji: π
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: purple
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: "4.0.0"
|
8 |
+
app_file: spaces_app.py
|
9 |
+
pinned: false
|
10 |
+
license: mit
|
11 |
+
short_description: AI-powered news verification system with free demo
|
12 |
+
---
|
13 |
+
|
14 |
+
# DGaze - Advanced News Verification System
|
15 |
+
|
16 |
+
An advanced AI-powered news verification system with authentication that helps identify potentially misleading or false information.
|
17 |
|
18 |
## Features
|
19 |
|
20 |
+
- **π Authentication**: Secure Auth0 integration with trial and full access modes
|
21 |
+
- **π Free Trial**: 2 free verifications for unauthenticated users
|
22 |
+
- **π Real-time Analysis**: Instant verification of news articles and URLs
|
23 |
+
- **π Credibility Scoring**: Detailed credibility scores for news content
|
24 |
+
- **π Source Verification**: Check the reliability of news sources
|
25 |
+
- **π± Multiple Interfaces**: Trial, login, and authenticated user interfaces
|
26 |
+
- **π¨ Beautiful UI**: Professional gradient design with responsive layout
|
27 |
+
|
28 |
+
## How to Use
|
29 |
+
|
30 |
+
### Free Trial (No Login Required)
|
31 |
+
1. Visit the **trial interface** at `/trial`
|
32 |
+
2. **Paste news text** or **URL** in the input box
|
33 |
+
3. **Click "Verify News"** to analyze the content
|
34 |
+
4. **Get detailed results** including credibility score and analysis
|
35 |
+
5. Enjoy **2 free verifications** per session
|
36 |
+
|
37 |
+
### Full Access (With Login)
|
38 |
+
1. **Click "Sign In"** to authenticate via Auth0
|
39 |
+
2. Get **unlimited verifications**
|
40 |
+
3. Access to **premium features**
|
41 |
+
4. **Session persistence** across visits
|
42 |
|
43 |
+
## Configuration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
This Space requires the following environment variables to be set in the Space settings:
|
46 |
|
47 |
+
### Required Environment Variables
|
48 |
|
|
|
49 |
```bash
|
50 |
+
# Backend API Configuration (REQUIRED)
|
51 |
+
API_BASE_URL=your-backend-api-url
|
52 |
|
53 |
+
# Auth0 Configuration (REQUIRED for authentication)
|
54 |
+
AUTH0_DOMAIN=your-auth0-domain
|
55 |
+
AUTH0_CLIENT_ID=your-auth0-client-id
|
56 |
+
AUTH0_CLIENT_SECRET=your-auth0-client-secret
|
57 |
+
AUTH0_AUDIENCE=your-auth0-audience
|
58 |
|
59 |
+
# Security
|
60 |
+
SECRET_KEY=your-session-secret-key
|
61 |
+
|
62 |
+
# Optional: App Configuration
|
63 |
+
GRADIO_SERVER_NAME=0.0.0.0
|
64 |
GRADIO_SERVER_PORT=7860
|
|
|
65 |
DEBUG=false
|
66 |
```
|
67 |
|
68 |
+
### Setting Environment Variables
|
69 |
+
1. Go to your **Space Settings**
|
70 |
+
2. Find **"Repository secrets"** or **"Variables and secrets"**
|
71 |
+
3. Add each variable with **"Private"** visibility for sensitive data
|
72 |
+
4. **Restart the Space** after adding variables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
+
## Try the Examples
|
75 |
|
76 |
+
We've included sample news articles to demonstrate the verification capabilities:
|
77 |
+
- Suspicious breakthrough claims with questionable sources
|
78 |
+
- Real news with proper sourcing and verification
|
79 |
|
80 |
+
## Architecture
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
+
This application uses:
|
83 |
+
- **FastAPI**: Backend API framework with Auth0 integration
|
84 |
+
- **Gradio**: Interactive web interface with multiple mounted apps
|
85 |
+
- **Auth0**: Secure authentication and user management
|
86 |
+
- **Session Management**: Trial tracking and user state management
|
87 |
+
- **Modular Design**: Clean separation of concerns with api/, config/, and components/ modules
|
88 |
|
89 |
+
## API Integration
|
90 |
|
91 |
+
The app connects to a backend API for news verification. Make sure your backend API supports:
|
92 |
+
- `POST /api/verify` - Main verification endpoint
|
93 |
+
- `GET /api/health` - Health check endpoint
|
|
|
|
|
94 |
|
95 |
+
## Local Development
|
96 |
|
97 |
+
To run locally:
|
98 |
+
1. Clone this repository
|
99 |
+
2. Install dependencies: `pip install -r requirements.txt`
|
100 |
+
3. Set up your `.env` file with the required variables
|
101 |
+
4. Run: `python app.py`
|
102 |
+
5. Access at `http://localhost:3000`
|
103 |
|
104 |
+
## Built With
|
|
|
|
|
|
|
105 |
|
106 |
+
- **Gradio**: Interactive web interface
|
107 |
+
- **FastAPI**: Modern, fast web framework
|
108 |
+
- **Auth0**: Authentication platform
|
109 |
+
- **Python**: Backend processing
|
110 |
+
- **Hugging Face Spaces**: Hosting platform
|
111 |
|
112 |
+
---
|
|
|
|
|
|
|
113 |
|
114 |
+
*Built with β€οΈ for fighting misinformation and promoting media literacy*
|
|
|
|
|
|