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
```markdown
#### Contribution Guidelines


# Contribution Guidelines

## How to Contribute
We welcome contributions from the community. Here are the steps to contribute:

1. **Fork the Repository**:
    - Click the "Fork" button at the top right of the repository page.

2. **Clone Your Fork**:
    ```sh
    git clone https://github.com/ATOUIYakoub/Django-hubspot-integration.git
    cd your-fork
    ```

3. **Create a Branch**:
    ```sh
    git checkout -b feature/your-feature-name
    ```

4. **Make Your Changes**:
    - Implement your feature or fix.

5. **Commit Your Changes**:
    ```sh
    git add .
    git commit -m "Add your commit message"
    ```

6. **Push to Your Fork**:
    ```sh
    git push origin feature/your-feature-name
    ```

7. **Create a Pull Request**:
    - Go to the original repository and click on "New Pull Request".
    - Select your branch and submit the pull request.

## Coding Standards
- Follow PEP 8 guidelines for Python code.
- Write clear and concise commit messages.
- Include tests for new features and bug fixes.

## Reporting Issues
- Use the "Issues" tab to report bugs or request features.
- Provide detailed information to help us understand and reproduce the issue.

# FAQs

## How do I set up the project locally?
Follow the [Setup Instructions](#setup-instructions) to set up the project on your local machine.

## How do I contribute to the project?
Follow the [Contribution Guidelines](#contribution-guidelines) to contribute to the project.

## How do I run the tests?
Run the following command to execute the tests:
```sh
python manage.py test
Clone this wiki locally