Welcome to the Smart Marketing Assistant backend! This system orchestrates a full Machine Learning pipeline—from data processing with Airflow and Spark to serving predictions via FastAPI and monitoring with Prometheus/Grafana.
- Framework: FastAPI (Python 3.10+)
- Database: PostgreSQL 16
- Workflow Orchestration: Apache Airflow
- Data Processing: PySpark
- Model Tracking: MLflow
- Monitoring: Prometheus & Grafana
- Containerization: Docker & Docker Compose
- Docker installed.
- Docker Compose installed.
-
Clone the repository:
git clone <your-repo-url> cd Smart-Marketing-Business-Decision-Assistant
-
Spin up the services:
docker compose up -d
This will start the Database, Airflow, Backend API, MLflow, and Monitoring tools.
-
Initialize the Database: After the containers are up, populate the database with test data:
docker exec backend python /app/populate_db.py
| Service | Port (Host) | Description |
|---|---|---|
| Backend API | 8001 |
Core FastAPI service serving the dashboard. |
| Airflow Webserver | 8081 |
Pipeline orchestration and DAG management. |
| MLflow UI | 5001 |
Experiment tracking and model registry. |
| Prometheus | 9090 |
Metrics collection. |
| Grafana | 3001 |
Visual monitoring dashboard. |
Once the backend is running, you can access the interactive Swagger UI at: 👉 http://localhost:8001/docs
/backend: FastAPI source code (Controllers, Models, Schemas)./dags: Airflow DAGs for ETL and Training./ml: Machine Learning logic and data storage./monitoring: Configuration for Prometheus and Grafana.docker-compose.yml: Main orchestration file.populate_db.py: Database seeding script.
The backend uses JWT (JSON Web Tokens) for authentication.
- All
/dashboardand/predictionsendpoints require a valid token in the headers. - Default test user created by
populate_db.py:- Username:
testuser - Password:
testpassword123
- Username:
This project is licensed under the MIT License.