# Where to start - Project Development

**URL:** https://community.openai.com/t/where-to-start-project-development/1259125
**Category:** Community
**Tags:** api
**Created:** [May 12, 2025, 5:26pm UTC](https://community.openai.com/t/where-to-start-project-development/1259125 "2025-05-12T17:26:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![siba2893](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/siba2893/32/628930_2.png) [@siba2893](https://community.openai.com/u/siba2893)
#### Post date: [May 12, 2025, 5:26pm UTC](https://community.openai.com/t/where-to-start-project-development/1259125/1 "2025-05-12T17:26:17Z")

</div>

Hey everybody, I’m new to this community. Happy to be part of it. I wanted to know if you guys could point me in the right direction. I have to build a project for a client that requires a WhatsApp chatbot where he can ask questions about their company information. Like, “Which product was the best seller today? or How much were the sales of the last shift?” For this they gave me an N8N server, which I know I have to configure for this interaction. But the data for the chatbot is stored in Power BI Datasets. So I need to create DAX queries from the dataset structure and the question from WhatsApp to get the data. Then feed this data to the ChatGPT API model and respond to the WhatsApp with a natural language response from the summary of the data.

My problem is that they also want to generate charts from this data. So, for example, the user could ask, “I want to know how many Coca-Cola bottles today.” And the response might be, “We sold 1000 bottles of 1.5L for a selling price of $3,500,” and the user might respond. Show me a chart with all the coca cola bottles we sell and the quantity sold this month." So the chatbot needs to generate this chart and a text summary of the chart and make a PDF out of it and send it through WhatsApp.

This feature is the one that I don’t know how to tackle. Should I build a micro back-end for this? Is the ChatGPT API reliable enough to be able to generate this kind of request? Would appreciate any feedback.

Also, if anyone has a proposal on a different way to tackle the issue, I’m open to listen.

---

<div class="post-metadata">

### Author: ![FullTimeAI](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/fulltimeai/32/619505_2.png) [@FullTimeAI](https://community.openai.com/u/FullTimeAI)
#### Post date: [May 14, 2025, 6:20am UTC](https://community.openai.com/t/where-to-start-project-development/1259125/2 "2025-05-14T06:20:56Z")

</div>

Just ask ChatGPT, I gave it your question and this is what it said.

Your project involves combining multiple technologies: **WhatsApp chatbot** , **N8N automation** , **Power BI Datasets (DAX queries)**, **ChatGPT API** , and **chart generation**. Let’s break it down step by step:

### **1. Architecture Overview**

1. **WhatsApp Message Handling (N8N)**:

2. **Natural Language Understanding (ChatGPT API)**:

3. **Data Retrieval (DAX Queries to Power BI)**:

4. **Data Processing and Chart Generation (Microservice)**:

5. **Sending the Response (N8N)**:

* * *

### **2. Key Technical Considerations**

#### **Micro Back-End for Processing**

Yes, you should build a small backend (preferably with Python or Node.js) because:

- N8N is not designed for complex data processing or chart generation.
- Python has robust libraries for chart creation and PDF generation.
- The backend can easily handle ChatGPT API requests, DAX query formation, and chart creation.

#### **Reliability of ChatGPT API for Query Generation**

- ChatGPT can generate simple DAX queries if trained or prompted properly.
- You might need a “query template” database that matches question patterns with DAX query templates.
- Use ChatGPT mainly for understanding the user’s intent and generating query components.

* * *

### **3. Implementation Steps**

#### **Step 1: Setting Up N8N for WhatsApp**

- Integrate WhatsApp using services like Twilio or the WhatsApp Business API.
- Set up triggers to capture incoming messages.

#### **Step 2: Natural Language Processing with ChatGPT**

- Use ChatGPT to:

#### **Step 3: Dynamic DAX Query Generation**

- Create a DAX template for common questions, like:

- Use Python to replace placeholders in the DAX template based on the parsed question.

#### **Step 4: Data Retrieval from Power BI**

- Use the **Power BI REST API** to execute the DAX query and retrieve the results.
- Ensure proper authentication (OAuth) and permission handling.

#### **Step 5: Chart and PDF Generation**

- Use **Matplotlib** , **Seaborn** , or **Plotly** to generate charts based on the query results.
- Export the chart as an image (e.g., PNG) and embed it into a PDF using **ReportLab** or **PDFKit**.

#### **Step 6: Sending the Response via WhatsApp**

- Return a structured response combining:

- Use N8N to handle the final message sending, including the PDF as an attachment.

* * *

### **4. Example Workflow**

1. User: _“Show me the best-selling product today.”_

2. Backend:

3. Backend sends the response to N8N, which forwards it to WhatsApp.

* * *

### **5. Chart Generation Example in Python**

```python
import matplotlib.pyplot as plt
from fpdf import FPDF

def generate_chart(data, title):
    products = [item['name'] for item in data]
    quantities = [item['quantity'] for item in data]
    
    plt.bar(products, quantities, color='blue')
    plt.title(title)
    plt.xlabel('Products')
    plt.ylabel('Quantity Sold')
    plt.savefig('/path/to/chart.png')

def create_pdf(chart_path, summary):
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font('Arial', 'B', 16)
    pdf.cell(0, 10, summary, 0, 1, 'C')
    pdf.image(chart_path, x=10, y=30, w=180)
    pdf.output('/path/to/report.pdf')

```

* * *

### **6. Hosting the Backend**

- Deploy the microservice on the same server where N8N runs, or use a cloud service.
- Make the API endpoint accessible to N8N for sending and receiving data.

* * *

### **Final Thoughts**

- ChatGPT is good for interpreting user intent and generating DAX templates.
- A Python microservice is ideal for handling data processing, chart creation, and PDF generation.
- N8N acts as the integration layer between WhatsApp and your backend.
