Application that fetches data from external sources, performs actions based on defined rules, and presents the system state through a React-based UI.
The system currently implements the following automation rules:
- Weather-based: Pauses Twitter ads if temperature exceeds 30°C, activates them otherwise
- Sports-based: Activates Facebook ads if home team wins, pauses them otherwise
- Time-based: Activates Instagram ads during prime hours (8 AM - 8 PM), pauses them during off-hours
- Backend API: FastAPI-based REST API
- Data Ingestion: Fetches weather and sports data from external APIs
- Automation Engine: Performs actions based on input data
- React Frontend: Responsive, component-based UI
- Scheduling: Runs on a configurable cadence
- Node.js 16+ and npm (for local frontend development)
- Python 3.9+ (for local backend development)
- Go to the backend directory:
cd backend
- Create a virtual environment:
python -m venv venv source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Run the application:
uvicorn app.main:app --reload
or
python run.py
- Go to the frontend directory:
cd frontend
- Install dependencies:
npm install npm run build
- Start the development server: npm start
GET /api/logs
- Retrieve action logsGET /api/state
- Get current state of social targetsPUT /api/state/{target}
- Update target statePOST /api/run
- Manually trigger automationPUT /api/cadence
- Update automation cadenceGET /api/settings
- Get current settingsDELETE /api/logs
- Clear all logs from the database