From 9e8d0f0e11d3261cd6c745a2bdeae806d82fbb19 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Wed, 16 Apr 2025 22:27:39 +0800 Subject: [PATCH] first commit --- .env | 2 + .env.production | 2 + .gitignore | 38 ++++++ Dockerfile | 32 +++++ README.md | 67 +++++++++++ docker-compose.yml | 17 +++ index.html | 13 ++ nginx.conf | 37 ++++++ package.json | 21 ++++ src/App.vue | 84 +++++++++++++ src/api/index.js | 38 ++++++ src/assets/main.css | 69 +++++++++++ src/main.js | 9 ++ src/router/index.js | 22 ++++ src/views/Home.vue | 82 +++++++++++++ src/views/TryonHistory.vue | 236 +++++++++++++++++++++++++++++++++++++ vite.config.js | 25 ++++ 17 files changed, 794 insertions(+) create mode 100644 .env create mode 100644 .env.production create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100644 index.html create mode 100644 nginx.conf create mode 100644 package.json create mode 100644 src/App.vue create mode 100644 src/api/index.js create mode 100644 src/assets/main.css create mode 100644 src/main.js create mode 100644 src/router/index.js create mode 100644 src/views/Home.vue create mode 100644 src/views/TryonHistory.vue create mode 100644 vite.config.js diff --git a/.env b/.env new file mode 100644 index 0000000..eb0935c --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VITE_APP_TITLE=美搭 +VITE_APP_API_URL=http://127.0.0.1:8000 \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..243ed55 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +VITE_APP_TITLE=美搭 +VITE_APP_API_URL=https://meida-api.beefast.co \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a41126a --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# 依赖包 +node_modules +npm-debug.log +yarn-debug.log +yarn-error.log +package-lock.json + +# 打包输出 +/dist +/build + +# 本地环境文件 +.env.local +.env.*.local + +# 日志文件 +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# 编辑器目录和文件 +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# 操作系统文件 +.DS_Store +Thumbs.db + +# 测试覆盖率 +/coverage \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..92a19c6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# 构建阶段 +FROM node:18-alpine as build-stage + +# 设置工作目录 +WORKDIR /app + +# 复制package.json和package-lock.json +COPY package*.json ./ + +# 安装依赖 +RUN npm install + +# 复制项目文件 +COPY . . + +# 构建应用 +RUN npm run build + +# 生产阶段 +FROM nginx:stable-alpine as production-stage + +# 将构建好的文件复制到nginx目录 +COPY --from=build-stage /app/dist /usr/share/nginx/html + +# 复制nginx配置文件 +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# 暴露80端口 +EXPOSE 80 + +# 启动nginx +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9478347 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# 美搭项目展示平台 + +这是一个基于Vue 3开发的美搭时尚穿搭项目展示平台,用于展示用户的穿搭历史和效果。 + +## 功能特点 + +- 展示用户的穿搭历史记录 +- 查看搭配效果和专业评分 +- 响应式设计,适配各种设备 + +## 开发技术 + +- Vue 3 +- Vue Router 4 +- Axios +- Vite + +## 安装与运行 + +### 安装依赖 + +```bash +npm install +``` + +### 启动开发服务器 + +```bash +npm run dev +``` + +### 构建生产版本 + +```bash +npm run build +``` + +### 预览生产构建 + +```bash +npm run serve +``` + +## 环境配置 + +项目配置了两个环境的API接口: + +- 开发环境:http://127.0.0.1:8000 +- 生产环境:https://meida-api.beefast.co/ + +## 项目结构 + +``` +meida-portal/ +├── public/ # 静态资源 +├── src/ # 源代码 +│ ├── api/ # API接口 +│ ├── assets/ # 资源文件 +│ ├── components/ # 通用组件 +│ ├── router/ # 路由配置 +│ ├── views/ # 页面视图 +│ ├── App.vue # 根组件 +│ └── main.js # 入口文件 +├── index.html # HTML模板 +├── vite.config.js # Vite配置 +└── package.json # 项目配置 +``` \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d718680 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3' + +services: + meida-portal: + build: + context: . + dockerfile: Dockerfile + container_name: meida-portal + ports: + - "80:80" + restart: always + networks: + - meida-network + +networks: + meida-network: + driver: bridge \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..1faadbc --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + +
+ + + +您的个人时尚穿搭助手
+AI智能分析您的身材特点,为您推荐最合适的穿搭方案
+无需实际试穿,在线体验不同服装的效果
+专业评分系统,为您的穿搭提供专业意见
+加载中...
+{{ error }}
+ +暂无穿搭历史记录
+
{{ history.comment }}
+