Skip to content
Atoui Abderahman Yakoub edited this page Sep 15, 2024 · 8 revisions

Project Documentation

Overview

This project is a Django application integrated with HubSpot. It includes a CI/CD pipeline using GitHub Actions to ensure code quality and automate testing.

Table of Contents

Setup Instructions

Prerequisites

  • Python 3.12 or higher
  • Docker
  • Git

Steps

  1. Clone the Repository:

    git clone https://github.com/ATOUIYakoub/Django-hubspot-integration.git
    cd crm_analytics
  2. Create a Virtual Environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install Dependencies:

    pip install --upgrade pip
    pip install -r requirements.txt
  4. Run Migrations:

    python manage.py migrate
  5. Run the Development Server:

    python manage.py runserver
  6. Access the Application:

    • Open your browser and go to http://localhost:8000.

Usage Guide

Overview

This section provides instructions on how to use the application.

Accessing the Application

  • Open your browser and go to http://localhost:8000.

Features

  • Lead Management: View, create, update, and delete leads.
  • Integration with HubSpot: Sync leads with HubSpot.

Example Usage

  1. View Leads:

    • Navigate to the leads page to view all leads.
  2. Update a Lead:

    • Click on a lead to update its details.
  3. Sync with HubSpot:

    • Use the provided API endpoints to sync leads with HubSpot.

CI/CD Setup

Overview

This project uses GitHub Actions for Continuous Integration (CI) and Continuous Deployment (CD).

Workflow Configuration

The CI/CD pipeline is defined in the .github/workflows/ci.yml file.

Excerpt from ci.yml

--health-timeout 5s
          --health-retries 5

    env:
      DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_db

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.12'  

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

    - name: Run tests
      run: |
        python manage.py migrate
        python manage.py test
Clone this wiki locally