# 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 ```bash git clone git.linuxforward.com/byom/byom-trends cd byom-trends ``` 2. Copy the example config and update it with your settings ```bash cp config.yaml.example config.yaml ``` 3. Install dependencies ```bash go mod download ``` 4. Start the LiteLLM Proxy Server ```bash litellm --model gpt-4 --api_base https://api.openai.com/v1 ``` 5. Build and run ```bash 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 ```bash go test ./... ``` ### Code Style Follow the standard Go code style guidelines and use `gofmt`. ## License Proprietary - All rights reserved