ElectionGuard is an AI-powered web platform designed to detect misinformation and vulnerabilities in election-related articles
JavaScript
0
170 commits
updated May 7, 2026
Top-level .env (next to docker-compose.deploy.yml) — controls the database:
Use the provided .env file in the root directory to fill in values.
cp .env.example .env
backend/.env — controls the application. Copy the example and fill in your values:
cp backend/.env.example backend/.env
Then edit backend/.env:
| Variable | Description |
|---|---|
FIRECRAWL_API_KEY | API key for Firecrawl (article ingestion) |
GNEWS_API_KEY | API key for Gnews (article ingestion) |
JWT_SECRET_KEY | Secret key for authentication — use a long random string |
INGEST_SCHEDULE_SECONDS | How often to fetch new articles in seconds (default: 3600, minimum recommended: 600) |
TARGET_NUM_ARTICLES | Number of articles to fetch per run (default: 10, maximum recommended: 25) |
docker compose -f docker-compose.deploy.yml up -d
On first run, Docker will build the images — this may take several minutes as it downloads the NLP model weights.
docker compose -f docker-compose.deploy.yml ps
All services should show a status of running.
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:3000 | Main web application |
| Backend API | http://localhost:5000 | REST API |
| Flower | http://localhost:5555 | Background task monitor |
docker compose -f docker-compose.deploy.yml down
This stops all containers but preserves the database and model cache. To also delete all stored data:
docker compose -f docker-compose.deploy.yml down -v
docker compose -f docker-compose.deploy.yml down
docker compose -f docker-compose.deploy.yml up -d --build
1. Create backend/.env:
DB_USER=username
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432
DB_NAME=articlesdb
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
GNEWS_API_KEY=your_key_here
FIRECRAWL_API_KEY=your_key_here
JWT_SECRET_KEY=your_secret_here
2. Install dependencies:
cd backend
python -m venv env
source env/bin/activate # Mac/Linux
env\Scripts\activate # Windows
pip install -r requirements.txt
3. Start database and Redis:
docker compose up -d
4. Run the backend (three terminals from backend/ with venv activated):
# Terminal 1 — Flask server
python run.py
# Terminal 2 — Celery worker
celery -A celery_worker.celery_app worker --loglevel=info -Q ingestion,nlp
# Terminal 3 — Celery beat
celery -A celery_worker.celery_app beat --loglevel=info
cd frontend
npm install
npm start
cd backend
celery -A celery_worker.celery_app call app.tasks.ingest.ingest_data
ElectionGuard is an AI-powered web platform designed to detect misinformation and vulnerabilities in election-related articles
JavaScript
0
170 commits
updated May 7, 2026
Top-level .env (next to docker-compose.deploy.yml) — controls the database:
Use the provided .env file in the root directory to fill in values.
cp .env.example .env
backend/.env — controls the application. Copy the example and fill in your values:
cp backend/.env.example backend/.env
Then edit backend/.env:
| Variable | Description |
|---|---|
FIRECRAWL_API_KEY | API key for Firecrawl (article ingestion) |
GNEWS_API_KEY | API key for Gnews (article ingestion) |
JWT_SECRET_KEY | Secret key for authentication — use a long random string |
INGEST_SCHEDULE_SECONDS | How often to fetch new articles in seconds (default: 3600, minimum recommended: 600) |
TARGET_NUM_ARTICLES | Number of articles to fetch per run (default: 10, maximum recommended: 25) |
docker compose -f docker-compose.deploy.yml up -d
On first run, Docker will build the images — this may take several minutes as it downloads the NLP model weights.
docker compose -f docker-compose.deploy.yml ps
All services should show a status of running.
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:3000 | Main web application |
| Backend API | http://localhost:5000 | REST API |
| Flower | http://localhost:5555 | Background task monitor |
docker compose -f docker-compose.deploy.yml down
This stops all containers but preserves the database and model cache. To also delete all stored data:
docker compose -f docker-compose.deploy.yml down -v
docker compose -f docker-compose.deploy.yml down
docker compose -f docker-compose.deploy.yml up -d --build
1. Create backend/.env:
DB_USER=username
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432
DB_NAME=articlesdb
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
GNEWS_API_KEY=your_key_here
FIRECRAWL_API_KEY=your_key_here
JWT_SECRET_KEY=your_secret_here
2. Install dependencies:
cd backend
python -m venv env
source env/bin/activate # Mac/Linux
env\Scripts\activate # Windows
pip install -r requirements.txt
3. Start database and Redis:
docker compose up -d
4. Run the backend (three terminals from backend/ with venv activated):
# Terminal 1 — Flask server
python run.py
# Terminal 2 — Celery worker
celery -A celery_worker.celery_app worker --loglevel=info -Q ingestion,nlp
# Terminal 3 — Celery beat
celery -A celery_worker.celery_app beat --loglevel=info
cd frontend
npm install
npm start
cd backend
celery -A celery_worker.celery_app call app.tasks.ingest.ingest_data