Customer Trends API : LLM + social network scrapper + product/service suggestions

lblt 75d1ed5d35 init new golang services version 1 month ago
analysis 75d1ed5d35 init new golang services version 1 month ago
app 75d1ed5d35 init new golang services version 1 month ago
common 75d1ed5d35 init new golang services version 1 month ago
config 75d1ed5d35 init new golang services version 1 month ago
docs 75d1ed5d35 init new golang services version 1 month ago
handlers 75d1ed5d35 init new golang services version 1 month ago
logger 75d1ed5d35 init new golang services version 1 month ago
services 75d1ed5d35 init new golang services version 1 month ago
store 75d1ed5d35 init new golang services version 1 month ago
.dockerignore 75d1ed5d35 init new golang services version 1 month ago
.gitignore 75d1ed5d35 init new golang services version 1 month ago
Dockerfile 75d1ed5d35 init new golang services version 1 month ago
README.md 75d1ed5d35 init new golang services version 1 month ago
config.yaml.example 75d1ed5d35 init new golang services version 1 month ago
docker-compose.yml 75d1ed5d35 init new golang services version 1 month ago
go.mod 75d1ed5d35 init new golang services version 1 month ago
go.sum 75d1ed5d35 init new golang services version 1 month ago
main.go 75d1ed5d35 init new golang services version 1 month ago
model_config.yaml 75d1ed5d35 init new golang services version 1 month ago

README.md

BYOM Trends

A Go-based backend service for analyzing social media trends and audience insights.

Features

  • Social Media Profile Analysis
    • Instagram integration
    • TikTok integration
    • YouTube integration
  • Google Trends Analysis
  • Audience Insights
  • Trend Reports Generation
  • Product/Service Suggestions based on Trends

Prerequisites

  • Go 1.22.5 or higher
  • SQLite 3
  • LiteLLM Proxy Server

Project Structure

.
├── app/                # Core application components
│   ├── server.go      # HTTP server setup
│   └── routes.go      # API route definitions
├── common/            # Shared models and types
├── config/           # Configuration management
├── handlers/         # HTTP request handlers
├── store/           # Database operations
├── services/        # External service integrations
│   ├── instagram/   # Instagram API client
│   ├── tiktok/      # TikTok API client
│   ├── youtube/     # YouTube API client
│   └── google/      # Google Trends client
│   └── suggestions/ # LiteLLM integration
├── analysis/        # Analysis logic
├── logger/         # Logging configuration
└── docs/          # Documentation

Quick Start

  1. Clone the repository

    git clone git.linuxforward.com/byom/byom-trends
    cd byom-trends
    
  2. Copy the example config and update it with your settings

    cp config.yaml.example config.yaml
    
  3. Install dependencies

    go mod download
    
  4. Start the LiteLLM Proxy Server

    litellm --model gpt-4 --api_base https://api.openai.com/v1
    
  5. Build and run

    go build
    ./byom-trends
    

API Documentation

The API is documented using OpenAPI 3.0 (Swagger). You can access the documentation in several ways:

Swagger UI

When running the application, visit:

http://localhost:8080/swagger/index.html

Raw OpenAPI Specification

The OpenAPI specification is available at:

  • YAML format: docs/openapi.yaml
  • JSON format: http://localhost:8080/swagger/doc.json

Trend Analysis

  • POST /api/v1/trends/analyze/profile/:id

    • Analyze trends for a specific profile
    • Returns trend analysis results
  • GET /api/v1/trends/analysis/:id

    • Get a specific trend analysis report

Social Media

  • POST /api/v1/trends/social/connect

    • Connect a social media profile
    • Supports Instagram, TikTok, and YouTube
  • GET /api/v1/trends/social/:platform/stats

    • Get statistics for a connected social media profile

Google Trends

  • POST /api/v1/trends/google/analyze
    • Analyze Google Trends data for specific keywords

Suggestions

  • POST /api/v1/trends/suggestions
    • Get product/service suggestions based on analyzed trends

Configuration

The service is configured via a YAML file. See config.yaml.example for all available options.

Key configuration sections:

  • Server settings
  • Database configuration
  • JWT authentication
  • Social media API credentials
  • Google Trends API credentials
  • LiteLLM configuration

Development

Running Tests

go test ./...

Code Style

Follow the standard Go code style guidelines and use gofmt.

License

Proprietary - All rights reserved