Skip to content
AnthennyGabrielPublic

About

AI-powered cross-border brand content workspace

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A-box: AI-Driven Cross-Border Brand Content Platform

A-box:AI驱动的跨境品牌内容工作台


面向俄罗斯市场的智能品牌内容生成工具

中文说明 • English


📖 Project Overview | 项目概述

A-box is an AI-powered brand content generation platform designed specifically for Chinese cross-border e-commerce sellers entering the Russian market. It streamlines the creation of localized brand materials, product listings, and marketing content for major Russian platforms like Ozon, Wildberries, and VK.

A-box 是一个AI驱动的品牌内容生成平台,专为中国跨境电商卖家进入俄罗斯市场而设计。它简化了本地化品牌材料、产品Listing和营销内容的创建流程,支持 Ozon、Wildberries、VK 等俄罗斯主流平台。

Target Users | 目标用户:

  • Chinese sellers expanding to Russian e-commerce market
  • 期望进入俄罗斯市场的中国卖家
  • Brands seeking efficient multi-language content creation
  • 需要高效多语言内容创建的品牌

🛠️ Tech Stack | 技术栈总览

Layer Technology Purpose
Frontend Next.js 14, React 18, TypeScript User interface
Styling Tailwind CSS, Lucide Icons Visual design
Backend Python 3.8+, FastAPI API server
Database SQLite Local data persistence
AI (Text) 阿里云百炼 qwen-plus Brand stories, slogans, listings
AI (Image) 阿里云百炼 wanx-v1 Logo & marketing images
Deployment Local development servers Development
层级 技术 用途
前端 Next.js 14, React 18, TypeScript 用户界面
样式 Tailwind CSS, Lucide Icons 视觉设计
后端 Python 3.8+, FastAPI API 服务
数据库 SQLite 本地数据持久化
AI (文本) 阿里云百炼 qwen-plus 品牌故事、口号、Listing
AI (图像) 阿里云百炼 wanx-v1 Logo 和营销图片
部署 本地开发服务器 开发环境

📁 Project Structure | 项目结构

A-box/
├── backend/                          # Backend Service | 后端服务
│   ├── main.py                       # FastAPI entry point | FastAPI 入口
│   ├── database.py                   # SQLite operations | SQLite 数据库操作
│   ├── api/                          # API Routes | API 路由
│   │   ├── brand.py                  # Brand content generation API
│   │   ├── listing.py                # Listing generation API
│   │   ├── marketing.py              # Marketing content API
│   │   └── history.py                # History CRUD API
│   ├── models/
│   │   └── schemas.py                # Pydantic request/response models
│   ├── services/
│   │   └── ai_service.py             # AI service integration layer
│   └── prompts/                      # AI prompt templates
│       ├── brand_prompt.json         # Brand generation prompts
│       ├── logo_prompt.json          # Logo generation prompts
│       ├── listing_prompt.json       # Listing generation prompts
│       ├── marketing_prompt.json     # Marketing copy prompts
│       └── marketing_image_prompt.json
├── frontend/                         # Frontend Application | 前端应用
│   ├── app/                          # Next.js App Router
│   │   ├── page.tsx                  # Home page
│   │   ├── brand/page.tsx            # Brand generation page
│   │   ├── listing/page.tsx          # Listing generation page
│   │   ├── marketing/page.tsx       # Marketing content page
│   │   └── history/page.tsx          # History management page
│   ├── lib/
│   │   └── api.ts                    # API client & utilities
│   └── package.json
├── data/                              # Runtime data | 运行时数据
│   ├── images/                        # Generated images | 生成的图片
│   └── abox.db                        # SQLite database
├── .env                               # Environment variables
├── .env.example                       # Environment template
├── start.bat                          # Quick start script
└── README.md                          # This file

🔧 Module Details | 模块详解

1. Brand Content Module | 品牌内容模块

Functionality | 功能描述: Generates comprehensive brand content packages including brand names, stories, slogans, color schemes, font suggestions, and logo concepts tailored for the Russian market.

生成完整的品牌内容包,包括品牌名称、品牌故事、口号、配色方案、字体建议,以及针对俄罗斯市场优化的 Logo 概念图。

Involved Files | 涉及文件:

  • backend/api/brand.py - API endpoint handler
  • backend/services/ai_service.py - AI content generation logic
  • backend/prompts/brand_prompt.json - AI prompts for text
  • backend/prompts/logo_prompt.json - AI prompts for images
  • frontend/app/brand/page.tsx - User interface

Core Logic | 核心逻辑:

1. User submits brand info (name, industry, description, tone)
2. System calls qwen-plus to generate text content
3. System calls wanx-v1 to generate 2 logo concept images
4. Results saved to SQLite with unique record_id
5. Response returned with all generated content

2. Listing Generation Module | Listing 生成模块

Functionality | 功能描述: Generates optimized product listings for Russian e-commerce platforms (Ozon, Wildberries) with bilingual (Russian + English) titles, selling points, and keywords.

为俄罗斯电商平台(Ozon、Wildberries)生成优化的产品 Listing,包含双语(俄语+英语)标题、卖点和关键词。

Involved Files | 涉及文件:

  • backend/api/listing.py - API endpoint handler
  • backend/services/ai_service.py - AI content generation
  • backend/prompts/listing_prompt.json - Listing generation prompts
  • frontend/app/listing/page.tsx - User interface

Core Logic | 核心逻辑:

1. User submits product info and target platform
2. System calls qwen-plus for bilingual content
3. Results include: title_ru, title_en, selling_points_ru/en, keywords_ru
4. Saved to database for history tracking

3. Marketing Content Module | 营销内容模块

Functionality | 功能描述: Generates marketing copy and images for various Russian social media scenarios (VK posts, advertising banners, holiday promotions) based on existing brand data.

基于现有品牌数据,生成俄罗斯社交媒体场景(VK 帖子、广告 Banner、节日促销)的营销文案和图片。

Involved Files | 涉及文件:

  • backend/api/marketing.py - API endpoint handler
  • backend/services/ai_service.py - Marketing content generation
  • backend/prompts/marketing_prompt.json - Marketing copy prompts
  • backend/prompts/marketing_image_prompt.json - Image prompts
  • frontend/app/marketing/page.tsx - User interface

Core Logic | 核心逻辑:

1. User selects existing brand record and scenario
2. System retrieves brand data from database
3. Generates scenario-specific marketing copy
4. (Image generation code is commented out - using Stability AI)

4. History Management Module | 历史记录模块

Functionality | 功能描述: Provides CRUD operations for all generated content records. Users can view, search, and delete historical records.

提供所有生成内容记录的增删改查操作。用户可以查看、搜索和删除历史记录。

Involved Files | 涉及文件:

  • backend/api/history.py - History API endpoints
  • backend/database.py - Database operations
  • frontend/app/history/page.tsx - History management UI

5. Data Model Layer | 数据模型层

Functionality | 功能描述: Defines request/response schemas using Pydantic for validation and type safety.

使用 Pydantic 定义请求/响应模式,确保数据验证和类型安全。

Involved Files | 涉及文件:

  • backend/models/schemas.py - All Pydantic models

Key Models | 主要模型:

  • BrandGenerateRequest/Response - Brand content request/response
  • ListingGenerateRequest/Response - Listing request/response
  • MarketingGenerateRequest/Response - Marketing request/response
  • Record - Generic record model for history

6. Database Layer | 数据库层

Functionality | 功能描述: Manages SQLite database for persistent storage of all generated content and configuration.

管理 SQLite 数据库,用于持久化存储所有生成的内容和配置。

Involved Files | 涉及文件:

  • backend/database.py - All database operations

Tables | 数据表:

  • records - Stores all generation records (id, type, input_data, output_data, image_paths, created_at)

🔄 Data Flow | 数据流说明

Typical Request Flow | 典型请求流程

┌─────────────┐      1. Submit Form       ┌─────────────┐
│   Browser   │ ────────────────────────▶│   Frontend  │
│   (Next.js) │                          │  (React)    │
└─────────────┘                          └──────┬──────┘
       ▲                                        │
       │                                        │ 2. API Call
       │                                        ▼
       │                                 ┌─────────────┐
       │    6. Display Results           │   Backend   │
       │    5. JSON Response            │  (FastAPI)  │
       │                                 └──────┬──────┘
       │                                        │
       │                                        │ 3. Invoke AI
       │                                        ▼
       │                                 ┌─────────────┐
       │    4. Generate Content          │   阿里云百炼  │
       │                                 │   API       │
       │                                 └──────┬──────┘
       │                                        │
       │                                        │ 5. Save & Return
       │                                        ▼
       │                                 ┌─────────────┐
       │                                 │   SQLite    │
       │                                 │  Database   │
       │                                 └─────────────┘

Step-by-Step | 步骤说明:

  1. User Input | 用户输入: User fills out form on frontend (brand info, product details, etc.)
  2. API Request | API 请求: Frontend sends POST request to backend API endpoint
  3. AI Processing | AI 处理: Backend calls qwen-plus/wanx-v1 APIs based on request type
  4. Image Generation | 图片生成: For brand content, wanx-v1 generates logo images, saved to data/images/
  5. Data Persistence | 数据持久化: All results saved to SQLite with timestamp and unique record_id
  6. Response | 响应: Backend returns JSON response to frontend
  7. Display | 展示: Frontend updates UI with generated content

⚙️ Environment Variables | 环境变量配置

Variable Description Required
DASHSCOPE_API_KEY 阿里云百炼 API Key for qwen-plus and wanx-v1 Yes
# .env file
DASHSCOPE_API_KEY=your_api_key_here

How to get API Key | 如何获取 API Key:

  1. Visit 阿里云百炼
  2. Create an account or log in
  3. Navigate to API Keys section
  4. Generate a new API key
  5. Ensure you have activated the following services:
    • qwen-plus for text generation
    • wanx-v1 for image generation

🚀 Local Setup Guide | 本地运行指南

Prerequisites | 前置条件

  • Python 3.8+
  • Node.js 18+
  • npm or yarn

Quick Start | 快速启动

# Method 1: Use the batch script (Windows)
start.bat
# Method 2: Manual start

# Terminal 1: Start backend
cd backend
.\venv\Scripts\activate
python -m uvicorn main:app --host 0.0.0.0 --port 9002 --reload

# Terminal 2: Start frontend
cd frontend
npm install
npm run dev

Access | 访问地址

📡 API Documentation | API 文档

Base URL | 基础 URL

http://localhost:9002/api

Endpoints | 接口列表

1. Brand Content Generation | 品牌内容生成

POST /api/brand/generate

Request Body | 请求参数:

{
  "brand_name_cn": "安盾",
  "industry": "3C数码",
  "description": "专注家用智能安防,指纹+密码+APP三重解锁",
  "tone": "科技",
  "brand_name_en": "Andun",
  "target_market": "俄罗斯",
  "target_language": "俄语"
}

Response | 响应:

{
  "record_id": "550e8400-e29b-41d4-a716-446655440000",
  "brand_names": [
    {"name": "安盾", "explanation": "寓意安全防护..."}
  ],
  "brand_story": "安盾品牌始于...",
  "slogans": ["智能守护,安全无忧", "..."],
  "color_scheme": {
    "primary": "#2C5AA0",
    "secondary": "#4A90D9"
  },
  "font_suggestion": "主字体:思源黑体",
  "logo_images": ["/images/xxx.png"],
  "created_at": "2024-01-15 10:30:00"
}

2. Listing Generation | Listing 生成

POST /api/listing/generate

Request Body | 请求参数:

{
  "product_title_cn": "智能门锁",
  "selling_points": ["指纹解锁", "密码保护", "APP远程控制"],
  "platform": "Ozon",
  "category": "智能安防",
  "target_language": "俄语+英语"
}

Response | 响应:

{
  "record_id": "...",
  "platform": "Ozon",
  "title_ru": "Умный дверной замок с отпечатком пальца",
  "title_en": "Smart Fingerprint Door Lock",
  "selling_points_ru": ["Разблокировка отпечатком пальца 0.3 сек", "..."],
  "selling_points_en": ["0.3s Fingerprint Unlock", "..."],
  "keywords_ru": ["умный замок", "безопасность", "..."],
  "created_at": "2024-01-15 10:35:00"
}

3. Marketing Content Generation | 营销内容生成

POST /api/marketing/generate

Request Body | 请求参数:

{
  "brand_record_id": "550e8400-e29b-41d4-a716-446655440000",
  "scene": "VK帖子",
  "product_info": "智能门锁新品上市",
  "promotion_theme": "新年特惠",
  "holiday": "俄罗斯新年"
}

Response | 响应:

{
  "record_id": "...",
  "scene": "VK帖子",
  "copywriting": "🎉 新年特惠!安盾智能门锁守护您的家...",
  "marketing_image": "",
  "created_at": "2024-01-15 10:40:00"
}

4. History Operations | 历史记录操作

GET /api/history/list

Returns all records sorted by creation time (newest first).

GET /api/history/detail/{record_id}

Returns detailed information for a specific record.

DELETE /api/history/delete/{record_id}

Deletes a specific record. Returns {"success": true, "message": "Record deleted successfully"}.

📋 TODO & Future Improvements | 后续计划

Based on the current codebase analysis, the following improvements are recommended:

High Priority | 高优先级

  1. Marketing Image Generation | 营销图片生成

    • Status: Currently disabled (Stability AI code is commented out)
    • Issue: Image generation uses deprecated Stability AI integration
    • Solution: Implement wanx-v1 for marketing image generation like brand logos
  2. Error Handling Enhancement | 错误处理增强

    • Status: Basic try-catch blocks exist
    • Improvement: Add more specific error types and user-friendly messages
  3. Input Validation | 输入验证增强

    • Status: Basic Pydantic validation exists
    • Improvement: Add more comprehensive validation rules

Medium Priority | 中优先级

  1. Authentication System | 认证系统

    • Status: No auth implemented
    • Issue: All endpoints are publicly accessible
    • Solution: Implement JWT-based authentication
  2. Batch Operations | 批量操作

    • Status: Only single-item generation
    • Improvement: Support batch generation for multiple products
  3. Export Functionality | 导出功能

    • Status: Copy to clipboard only
    • Improvement: Add PDF/Word export for generated content
  4. Configuration UI | 配置界面

    • Status: API key configured via .env file
    • Improvement: Add web UI for API key management

Low Priority | 低优先级

  1. Multi-language Support | 多语言支持

    • Status: Russian + English only
    • Improvement: Add more target markets (Kazakhstan, Belarus, etc.)
  2. Analytics Dashboard | 数据分析面板

    • Status: No analytics
    • Improvement: Add usage statistics and content performance tracking
  3. Cloud Deployment | 云端部署

    • Status: Local development only
    • Improvement: Docker containerization, Kubernetes deployment

📄 License | 许可证

This project is for educational and demonstration purposes. Please refer to the original documentation for third-party service terms.

本项目仅供学习和演示使用。请参阅原始文档了解第三方服务条款。

🙏 Acknowledgments | 致谢


Built with ❤️ for the Russian E-commerce Market

为俄罗斯电商市场而建

About

AI-powered cross-border brand content workspace

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages