kelvin262292
MCP Serverkelvin262292public

3d

一个现代化的3D模型在线商店,提供完整的电商功能和沉浸式3D体验。

Repository Info

0
Stars
2
Forks
0
Watchers
0
Issues
HTML
Language
-
License

About This Server

一个现代化的3D模型在线商店,提供完整的电商功能和沉浸式3D体验。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

🎨 3D模型电商平台

一个现代化的3D模型在线商店,提供完整的电商功能和沉浸式3D体验

Deployed on Vercel Built with Next.js TypeScript Three.js

📋 项目概述

这是一个功能完整的3D模型电商平台,专为销售和展示3D模型而设计。平台集成了现代化的3D渲染技术、完整的用户认证系统、购物车功能、支付处理和管理后台。

🎯 主要特性

  • 🔐 完整的用户认证系统 - 注册、登录、会话管理
  • 🛒 购物车和愿望清单 - 实时同步,持久化存储
  • 💳 支付集成 - Stripe支付处理
  • 📱 响应式设计 - 支持所有设备尺寸
  • 🌐 多语言支持 - 国际化功能
  • 👨‍💼 管理后台 - 产品、订单、用户管理,带标签页界面
  • 🔍 智能搜索 - 自动完成和过滤功能
  • 📊 数据分析 - 销售统计和用户行为分析
  • 🎨 3D模型预览 - Three.js驱动的3D查看器
  • 📧 邮件通知 - SendGrid集成
  • ☁️ 云存储 - Cloudinary图片管理
  • ⚡ 3D模型优化 - 性能优化和渐进式加载
  • 📱 移动端优化 - 专为移动设备优化的体验
  • 🔄 渐进式加载 - 分段加载提升用户体验
  • 📈 实时监控 - 性能和错误实时监控
  • 🔒 安全审计 - 自动化安全检查
  • 📊 分析仪表板 - 详细的数据分析和报告
  • 🎯 集成3D优化器 - 内置3D模型优化工具

🎯 Hiện tại đã triển khai:

  • Giao diện người dùng hiện đại: Dark theme với Tailwind CSS
  • Hệ thống xác thực: Đăng nhập/đăng ký với NextAuth.js
  • Quản lý cơ sở dữ liệu: PostgreSQL với Prisma ORM
  • Hiển thị mô hình 3D: Tích hợp Three.js và React Three Fiber
  • Tải mô hình động: Hỗ trợ định dạng GLB/GLTF
  • Hệ thống thanh toán: Tích hợp Stripe
  • Admin Dashboard: Quản lý toàn diện với 4 tabs (Overview, Analytics, Performance, Security)
  • Admin Components: AdminHeader và BulkActions components cho giao diện quản trị thống nhất
  • Bulk Operations: Thao tác hàng loạt cho sản phẩm, khách hàng và đơn hàng
  • Quick Stats: Thống kê nhanh với QuickStats component
  • Responsive Design: Tối ưu cho mọi thiết bị
  • API Routes: RESTful API với Next.js
  • Middleware bảo mật: Rate limiting và CORS
  • Hệ thống tìm kiếm: Tìm kiếm và lọc sản phẩm
  • Giỏ hàng: Quản lý giỏ hàng với localStorage
  • MCP Testing: Kiểm thử hoàn chỉnh với Playwright MCP
  • Bug Fixes: Đã khắc phục lỗi ngôn ngữ và form input disabled
  • Wishlist: Danh sách yêu thích
  • Reviews & Ratings: Đánh giá sản phẩm
  • Email notifications: Thông báo qua email
  • File upload: Tải lên mô hình 3D
  • Caching: Redis cho hiệu suất tối ưu
  • Monitoring: Theo dõi hiệu suất ứng dụng
  • 3D Model Optimization: Tối ưu hóa hiệu suất với LOD, culling, texture compression
  • Mobile Optimization: Tối ưu chuyên biệt cho thiết bị di động với auto-detection
  • Progressive Loading: Tải dữ liệu theo chunk với lazy loading
  • Performance Monitoring: Theo dõi FPS, memory, CPU, GPU real-time
  • Security Audit: Kiểm tra bảo mật tự động với báo cáo chi tiết
  • Analytics Dashboard: Phân tích dữ liệu với biểu đồ và metrics
  • Integrated 3D Optimizer: Công cụ tối ưu hóa 3D tích hợp với auto-optimization
  • Testing Framework: Jest unit tests và integration tests
  • API Documentation: Tài liệu API chi tiết với examples
  • User Guide: Hướng dẫn sử dụng đầy đủ cho người dùng
  • Banner Management System: Quản lý hero slides/banners động với admin interface

🎮 Hướng dẫn sử dụng

👤 Người dùng thông thường:

  1. Duyệt sản phẩm: Xem các mô hình 3D với viewer tương tác được tối ưu
  2. Tìm kiếm: Sử dụng thanh tìm kiếm với gợi ý tự động
  3. Giỏ hàng: Thêm sản phẩm và thanh toán
  4. Tài khoản: Quản lý thông tin và lịch sử đơn hàng
  5. Mobile: Trải nghiệm được tối ưu cho thiết bị di động

👨‍💼 Quản trị viên:

  1. Dashboard Overview: Xem thống kê tổng quan với biểu đồ
  2. Analytics: Phân tích dữ liệu chi tiết với metrics real-time
  3. Performance: Theo dõi hiệu suất FPS, memory, CPU, GPU
  4. Security: Kiểm tra bảo mật tự động với báo cáo
  5. 3D Optimizer: Tối ưu hóa mô hình 3D với auto-optimization
  6. Quản lý sản phẩm: Thêm/sửa/xóa mô hình 3D
  7. Quản lý đơn hàng: Xử lý và theo dõi đơn hàng
  8. Quản lý người dùng: Xem và quản lý tài khoản
  9. Quản lý Banners: Tạo/chỉnh sửa hero slides và banners trang chủ

🔧 Tính năng tối ưu hóa:

  1. Auto-Optimization: Tự động điều chỉnh chất lượng dựa trên hiệu suất
  2. Device Detection: Phát hiện thiết bị và tối ưu tương ứng
  3. Progressive Loading: Tải dữ liệu theo chunk để cải thiện UX
  4. Lazy Loading: Chỉ tải khi cần thiết với Intersection Observer
  5. Performance Monitoring: Theo dõi metrics real-time
  6. Security Audit: Kiểm tra bảo mật định kỳ

🚀 快速开始

环境要求

  • Node.js 18.0 或更高版本
  • SQLite 数据库 (默认) 或 PostgreSQL 数据库
  • Redis (可选,用于会话管理)
  • npm 或 pnpm 包管理器

安装步骤

  1. 克隆项目
git clone <repository-url>
cd 3d
  1. 安装依赖
pnpm install
  1. 环境配置
cp .env.example .env.local

编辑 .env.local 文件,配置以下环境变量:

# 数据库配置 (SQLite - 默认)
DATABASE_URL="file:./dev.db"

# 或者使用 PostgreSQL
# DATABASE_URL="postgresql://username:password@localhost:5432/3d_model_store_dev"

# 认证配置
NEXTAUTH_SECRET="your-super-secret-jwt-key"
NEXTAUTH_URL="http://localhost:3000"

# 第三方服务
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_PUBLISHABLE_KEY="pk_test_..."
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
SENDGRID_API_KEY="SG..."

# Redis (可选)
REDIS_URL="redis://localhost:6379"

# 环境
NODE_ENV="development"
  1. 数据库设置
# 生成Prisma客户端
npx prisma generate

# 推送数据库架构 (SQLite)
npx prisma db push

# 填充示例数据
npm run db:seed
  1. 启动开发服务器
npm run dev

访问 http://localhost:3000 查看应用。

📚 功能详解

🔐 用户认证系统

注册功能

  • 路径: /register
  • 功能: 用户注册新账户
  • 验证: 邮箱格式、密码强度、用户名唯一性
  • 安全: bcrypt密码加密

登录功能

  • 路径: /login
  • 功能: 用户登录认证
  • 安全: JWT令牌、速率限制(5次/分钟)
  • 会话: 自动会话管理和令牌刷新

用户仪表板

  • 路径: /dashboard
  • 功能: 用户个人信息、订单历史、统计数据
  • 权限: 需要登录访问

🛒 购物功能

产品浏览

  • 路径: /products
  • 功能: 产品列表、分页、搜索、过滤
  • 过滤器: 分类、价格范围、评分
  • 排序: 价格、评分、下载量、最新

产品详情

  • 路径: /products/[id]
  • 功能: 详细信息、3D预览、相关产品
  • 3D查看器: Three.js驱动的交互式3D模型预览

购物车

  • 路径: /cart
  • 功能: 添加/删除商品、数量调整、价格计算
  • 同步: 实时后端同步、离线支持

愿望清单

  • 路径: /wishlist
  • 功能: 收藏商品、快速添加到购物车
  • 管理: 批量操作、分类整理

💳 支付和订单

结账流程

  • 路径: /checkout
  • 功能: 订单确认、地址填写、支付处理
  • 支付: Stripe安全支付集成
  • 验证: 库存检查、价格验证

订单管理

  • 路径: /orders
  • 功能: 订单历史、状态跟踪、发票下载
  • 通知: 邮件状态更新

👨‍💼 管理后台

管理员仪表板

  • 路径: /admin/dashboard
  • 功能: 销售统计、用户分析、系统监控
  • 图表: 收入趋势、热门产品、用户增长

产品管理

  • 路径: /admin/products
  • 功能: 查看/编辑/删除产品、实时数据展示
  • 数据源: 从SQLite数据库获取真实产品数据
  • 显示信息: 产品名称、分类、价格、下载量、评分、状态
  • 过滤功能: 按状态筛选(库存/缺货/推荐)、按分类筛选、搜索功能
  • 图片展示: 产品缩略图预览,支持错误回退
  • 操作: 查看详情、编辑、删除产品

订单管理

  • 路径: /admin/orders
  • 功能: 订单处理、状态更新、退款处理
  • 导出: CSV/Excel订单报告

用户管理

  • 路径: /admin/customers
  • 功能: 用户信息、权限管理、活动监控

🔍 搜索和导航

智能搜索

  • 功能: 实时搜索建议、自动完成
  • 算法: 模糊匹配、相关性排序
  • 性能: 防抖优化、缓存机制

分类浏览

  • 路径: /categories
  • 功能: 分层分类、动态过滤
  • 展示: 分类图片、产品数量

🛠️ 技术栈

前端技术

  • Next.js 15 - React全栈框架
  • TypeScript - 类型安全
  • Tailwind CSS - 样式框架
  • Radix UI - 无障碍组件库
  • Three.js - 3D图形渲染
  • React Three Fiber - React 3D组件
  • Framer Motion - 动画库
  • React Hook Form - 表单管理
  • Zod - 数据验证

后端技术

  • Next.js API Routes - 服务端API
  • Prisma - 数据库ORM
  • PostgreSQL - 主数据库
  • Redis - 缓存和会话存储
  • NextAuth.js - 认证框架
  • Jose - JWT处理(Edge Runtime兼容)
  • bcryptjs - 密码加密

第三方集成

  • Stripe - 支付处理
  • Cloudinary - 图片和文件存储
  • SendGrid - 邮件服务
  • Google OAuth - 社交登录

开发工具

  • ESLint - 代码检查
  • Prettier - 代码格式化
  • Playwright - 端到端测试
  • Prisma Studio - 数据库管理
  • Vercel - 部署平台

📁 项目结构

3d/
├── app/                    # Next.js App Router
│   ├── api/               # API路由
│   │   ├── auth/          # 认证API
│   │   ├── products/      # 产品API
│   │   ├── cart/          # 购物车API
│   │   ├── orders/        # 订单API
│   │   └── users/         # 用户API
│   ├── admin/             # 管理后台页面 (带标签页界面)
│   ├── auth/              # 认证页面
│   ├── products/          # 产品页面
│   ├── cart/              # 购物车页面
│   └── dashboard/         # 用户仪表板
├── components/            # React组件
│   ├── ui/               # 基础UI组件 (tabs, cards, etc.)
│   ├── admin/            # 管理后台组件
│   ├── notifications/    # 通知组件
│   ├── optimized-model-viewer.tsx     # 优化3D查看器
│   ├── mobile-optimized-viewer.tsx    # 移动端3D查看器
│   ├── progressive-loader.tsx         # 渐进式加载
│   ├── progressive-image-loader.tsx   # 图片懒加载
│   ├── performance-optimizer.tsx      # 性能监控
│   ├── security-audit-panel.tsx       # 安全审计
│   ├── analytics-dashboard.tsx        # 分析仪表板
│   └── integrated-3d-optimizer.tsx    # 集成3D优化器
├── hooks/                 # 自定义React Hooks
│   └── use-intersection-observer.ts   # 交叉观察器
├── lib/                   # 工具函数和配置
├── prisma/               # 数据库模式和迁移
├── public/               # 静态资源
│   └── models/           # 3D模型文件 (.glb)
├── styles/               # 全局样式
├── types/                # TypeScript类型定义
└── tests/                # 测试文件

🧪 测试

运行测试

# 单元测试
pnpm test

# 端到端测试
pnpm test:e2e

# 测试覆盖率
pnpm test:coverage

# 交互式测试
pnpm test:ui

测试类型

  • 单元测试: 组件和函数测试
  • 集成测试: API端点测试
  • 端到端测试: 完整用户流程测试
  • 性能测试: 页面加载和响应时间

📊 性能优化

前端优化

  • 代码分割: 动态导入和懒加载
  • 图片优化: Next.js Image组件
  • 缓存策略: SWR数据获取
  • 3D优化: 模型压缩和LOD

后端优化

  • 数据库索引: 查询性能优化
  • API缓存: Redis缓存层
  • 连接池: 数据库连接管理
  • CDN: 静态资源分发

🔒 安全措施

认证安全

  • JWT令牌: 安全的用户认证
  • 密码加密: bcrypt哈希算法
  • 会话管理: 自动过期和刷新
  • CSRF保护: 跨站请求伪造防护

数据安全

  • 输入验证: Zod模式验证
  • SQL注入防护: Prisma ORM
  • XSS防护: 内容安全策略
  • 速率限制: API调用频率控制

🌐 部署

Vercel部署(推荐)

  1. 连接GitHub仓库到Vercel
  2. 配置环境变量
  3. 自动部署和域名配置

手动部署

# 构建生产版本
pnpm build

# 启动生产服务器
pnpm start

环境配置

  • 开发环境: NODE_ENV=development
  • 生产环境: NODE_ENV=production
  • 数据库: PostgreSQL连接字符串
  • Redis: 缓存服务器配置

📈 监控和分析

应用监控

  • 错误跟踪: 自动错误报告
  • 性能监控: 页面加载时间
  • 用户分析: 行为数据收集
  • API监控: 响应时间和错误率

业务分析

  • 销售统计: 收入和订单分析
  • 用户行为: 浏览和购买模式
  • 产品性能: 热门商品和转化率
  • 搜索分析: 搜索词和结果质量

🤝 贡献指南

开发流程

  1. Fork项目仓库
  2. 创建功能分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'Add amazing feature')
  4. 推送分支 (git push origin feature/amazing-feature)
  5. 创建Pull Request

代码规范

  • 使用TypeScript严格模式
  • 遵循ESLint配置
  • 编写有意义的提交信息
  • 所有PR必须代码审查
  • 合并前必须通过测试

📞 支持和帮助

常见问题

  • 数据库连接失败: 检查DATABASE_URL配置
  • 认证错误: 验证NEXTAUTH_SECRET设置
  • 支付问题: 确认Stripe密钥配置
  • 3D模型不显示: 检查文件格式和大小

获取帮助

  • 查看项目文档和TODO.md
  • 提交GitHub Issues
  • 查看测试用例和示例代码
  • 联系开发团队

📄 许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。

🙏 致谢

感谢所有为这个项目做出贡献的开发者和开源社区。

🔄 最近更新

2025年1月 - 数据库迁移和管理界面优化

主要变更

  • 数据库迁移: 从PostgreSQL迁移到SQLite,提高开发环境稳定性
  • Seed数据: 添加完整的示例数据,包括分类和产品信息
  • 管理界面升级: Admin产品管理页面使用真实数据库数据
  • API优化: 更新产品和分类API以支持SQLite数据库

技术改进

  • 移除对不存在字段的依赖(如inStock字段)
  • 优化产品展示界面,显示下载量、评分等真实数据
  • 改进错误处理和数据回退机制
  • 更新数据库架构以匹配实际需求
  • 移除所有console.log语句,清理生产代码
  • 修复中间件Edge Runtime兼容性问题
  • 解决构建过程中的EPERM错误

新功能

  • 产品图片预览功能,支持错误回退
  • 增强的产品过滤和搜索功能
  • 实时数据同步和状态显示
  • 改进的管理员操作界面

📅 最后更新: 2025年1月 🎯 项目状态: 100% 完成,生产就绪 👥 开发团队: 前端开发、后端开发、QA工程师 💰 预算: $12,000 - $20,000

注意: 这是一个功能完整的生产级应用,所有核心功能都已实现并经过测试。用户可以直接使用或在此基础上进行定制开发。

Hướng dẫn sử dụng MCP (Model Context Protocol)

Cài đặt

  1. Cài đặt các dependencies:
npm install -g @smithery/cli
  1. Chạy script cài đặt MCP:
./scripts/mcp-start.ps1

Kiểm tra trạng thái

Để kiểm tra trạng thái các MCP server:

./scripts/mcp-status.ps1

Các MCP Server đã cấu hình

  1. Filesystem MCP Server

    • Quản lý hệ thống file
    • Key: 9eaf9d55-4491-4639-9be5-b3e27b9cbc84
  2. Firecrawl MCP Server

    • Crawler dữ liệu
    • Key: 9eaf9d55-4491-4639-9be5-b3e27b9cbc84
    • Profile: sufficient-marlin-M3WykT
  3. Tavily MCP Server

    • Tích hợp với Tavily
    • Key: 9eaf9d55-4491-4639-9be5-b3e27b9cbc84
    • Profile: sufficient-marlin-M3WykT
  4. Context7 MCP Server

    • Quản lý context
    • Key: 9eaf9d55-4491-4639-9be5-b3e27b9cbc84
    • Profile: sufficient-marlin-M3WykT
  5. Sequential Thinking MCP Server

    • Xử lý tuần tự
    • Key: 9eaf9d55-4491-4639-9be5-b3e27b9cbc84
  6. Fetch MCP Server

    • Xử lý HTTP requests
    • Key: 9eaf9d55-4491-4639-9be5-b3e27b9cbc84
  7. Playwright MCP Server

    • Tự động hóa trình duyệt
    • Key: f227f917-cc87-45c4-964b-e17d00b0ee51

Scripts

  • mcp:init: Khởi tạo MCP
  • mcp:test: Chạy kiểm thử
  • mcp:lint: Kiểm tra lỗi code
  • mcp:build: Build dự án
  • mcp:dev: Khởi động môi trường phát triển
  • mcp:start: Khởi động tất cả MCP server
  • mcp:status: Kiểm tra trạng thái các MCP server

Lưu ý

  • Đảm bảo Node.js và npm đã được cài đặt
  • Các API key và profile được cấu hình trong file mcp.json
  • Kiểm tra trạng thái server thường xuyên để đảm bảo hoạt động ổn định
  • Đảm bảo có quyền thực thi script trên Windows
  • Kiểm tra firewall nếu gặp lỗi kết nối
  • Backup dữ liệu trước khi chạy script

🧪 Testing

Unit Tests

Dự án sử dụng Jest cho unit testing:

# Chạy tất cả tests
npm test

# Chạy tests với watch mode
npm run test:watch

# Chạy tests với coverage
npm run test:coverage

# Chạy Jest trực tiếp
npx jest

# Chạy tests cho component cụ thể
npx jest __tests__/components/file-upload.test.tsx

Test Structure

  • __tests__/components/ - Tests cho React components
  • __tests__/api/ - Tests cho API routes
  • __tests__/utils/ - Tests cho utility functions
  • jest.config.js - Cấu hình Jest
  • jest.setup.js - Setup file cho Jest

Test Coverage

Các component và API đã được test:

  • ✅ FileUpload component
  • ✅ Upload API endpoint
  • ✅ Basic utility functions

📚 Documentation

API Documentation

Tài liệu API chi tiết có tại:

  • docs/api/upload.md - Upload API documentation
  • Bao gồm examples, error codes, và usage guidelines

User Guides

Hướng dẫn sử dụng cho người dùng:

  • docs/user-guide/file-upload.md - Hướng dẫn upload file
  • Bao gồm troubleshooting và best practices

Development Docs

  • README.md - Tài liệu chính của dự án
  • Todo.md - Theo dõi tiến độ phát triển
  • Inline code comments trong tất cả files

Deployment Documentation

  • docs/deployment/README.md - Hướng dẫn deployment chi tiết
  • Vercel deployment guide
  • Netlify deployment guide
  • Traditional server setup
  • CI/CD pipeline configuration

Documentation Features

  • ✅ Comprehensive API documentation
  • ✅ User-friendly guides với screenshots
  • ✅ Troubleshooting sections
  • ✅ Best practices và optimization tips
  • ✅ Multi-language support (Vietnamese/English)

🚀 Deployment

Supported Platforms

  • Vercel (Khuyến nghị) - Serverless deployment
  • Netlify - JAMstack deployment
  • Traditional VPS/Server - Self-hosted deployment

Quick Deploy

Vercel

# Install Vercel CLI
npm install -g vercel

# Deploy
vercel

# Production deploy
npm run deploy:vercel

Netlify

# Install Netlify CLI
npm install -g netlify-cli

# Deploy
netlify deploy

# Production deploy
npm run deploy:netlify

Traditional Server

# Build application
npm run build

# Start with PM2
pm2 start ecosystem.config.js

CI/CD

  • GitHub Actions workflow configured
  • Automatic testing on PR
  • Automatic deployment on main branch
  • Preview deployments for PRs

Environment Setup

  • Production environment variables configured
  • Security headers implemented
  • Performance optimization enabled
  • Error tracking with Sentry

Configuration Files

  • vercel.json - Vercel deployment config
  • netlify.toml - Netlify deployment config
  • ecosystem.config.js - PM2 process manager
  • .github/workflows/deploy.yml - CI/CD pipeline
  • next-sitemap.config.js - SEO sitemap generation

Quick Start

1

Clone the repository

git clone https://github.com/kelvin262292/3d
2

Install dependencies

cd 3d
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerkelvin262292
Repo3d
LanguageHTML
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation