Skip to content

Repository files navigation

Affiliate Management SaaS

A Django-based web application to streamline operations between advertisers and publishers. Features include AI-based offer matching, automated invoicing, campaign performance management, and affiliate validation.

Features

  • Dashboard with revenue and profit analytics
  • Advertiser and Publisher management
  • Offer Matcher (AI-powered)
  • Invoicing system with PDF generation
  • Daily Revenue Sheet (DRS)
  • Validation module
  • Role-based permissions

Tech Stack

  • Python (Django)
  • MySQL
  • scikit-learn (AI matching)
  • WeasyPrint (PDF generation)
  • Docker

Setup

Prerequisites

  1. Python 3.9+
  2. MySQL 8.0+
  3. For PDF generation on:
    • Windows: GTK3 Runtime (download here)
    • macOS: Install Cairo with Homebrew: brew install cairo pango gdk-pixbuf libffi

Installation

  1. Create and activate a virtual environment:
    python -m venv venv
    source venv/bin/activate  # Linux/macOS
    venv\Scripts\activate    # Windows
  2. Install dependencies:
    pip install -r requirements.txt
  3. Configure MySQL in settings.py:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': 'your_db_name',
            'USER': 'your_db_user',
            'PASSWORD': 'your_db_password',
            'HOST': 'localhost',
            'PORT': '3306',
        }
    }
  1. Run migrations:
    python manage.py makemigrations
    python manage.py migrate
  2. Create a superuser:
    python manage.py createsuperuser
  3. Run the development server:
    python manage.py runserver

Docker Setup (Optional)

  1. Build the Docker image:
    docker-compose build
  2. Start the containers:
    docker-compose up
  3. Access the application at http://127.0.0.1:8000/panel/users/login/.
  4. For API access, use the endpoint /api/get_amount/ to retrieve currency amounts.
python manage.py update_rates

Platform-Specific Notes

Windows Setup

  1. Install GTK3 Runtime from this link
  2. Add GTK3 to your system PATH:
Typically installed at: C:\Program Files\GTK3-Runtime Win64\bin
  1. Restart your terminal/IDE after installation

macOS Setup

  1. Install Homebrew if not already installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install required libraries:
brew install cairo pango gdk-pixbuf libffi

Folder Structure

project/
├── apps/
│   ├── invoicing/          # Invoicing app
│   │   ├── models.py       # Invoice models
│   │   ├── views.py        # Invoice views
│   │   ├── templates/      # Invoice templates
│   │   └── ...
│   └── drs/                # Daily Revenue Sheets
├── requirements.txt        # Project dependencies
└── README.md               # Project documentation

Troubleshooting

PDF Generation Issues:

Windows: Ensure GTK3 is in your PATH macOS: Verify Cairo installation with brew list cairo Both: Check WeasyPrint installation with python -m weasyprint --info

MySQL Issues:

Ensure MySQL service is running Verify database credentials in settings.py

About

A Django-based web application to streamline operations between advertisers and publishers. Features include AI-based offer matching, automated invoicing, campaign performance management, and affiliate validation.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages