Medianalytics is an open-source platform that processes articles daily from each registered source (media outlets, organizations, etc) and provides users with tools to view this information from a broader perspective through data visualization and analysis.
This project uses Docker to run the application. Make sure you have Docker installed on your machine. You can download it from Docker.
-
Create a
.envfileIn the
rootfoldermedianalytics, create a.envfile based on this example file and set your environment variables accordingly.DATABASE_URL=postgresql+asyncpg://dockeruser:**db_password**@db:5432/medianalytics DB_PASSWORD=**db_password** API_KEY=example # AI API key GOOGLE_AI_API_URL="https://generativelanguage.googleapis.com/v1beta/openai/" VERIFY_SSL="true" CONNECTION_TIMEOUT=10 READ_TIMEOUT=30 MAX_CONNECTIONS=10 MAX_KEEPALIVE_CONNECTIONS=5 # Only if you plan to use X API X_API_KEY=example X_API_SECRET=example X_ACCESS_TOKEN=example X_ACCESS_TOKEN_SECRET=example
- Get an AI API key
- Recommended: Google AI (free tier available with gemma-3-27b-it)
On root folder medianalytics:
- Launch Application
docker compose up
In the back-data docker container terminal Exec:
-
Database Migration Setup
alembic init alembic
-
Generate Migration Script
alembic revision --autogenerate -m "Initial migration" -
Apply Migration
alembic upgrade head
-
Initialize Database
python3 init_db.py
- Keep containers running for scheduled jobs to execute as specified in
Back-data/main.py - Frontend can also run locally as an Angular project (v19.0.6)
- To add new sources, follow the example in
Back-data/media_test_scrap.py

