advisor-calculator/
├── README.md, README.CN.md, LICENSE # 项目文档
├── package.json, package-lock.json # 依赖管理
├── next.config.js, tsconfig.json # Next.js配置
├── tailwind.config.ts, postcss.config.mjs # 样式配置
├── biome.json, eslint.config.mjs # 代码规范
├── components.json # shadcn/ui配置
├── assets/
│ ├── Banner-advisor-calculator.png # 项目横幅
│ └── todo.md # 开发记录
├── deploy/
│ └── netlify.toml # 部署配置
├── src/
│ ├── app/
│ │ ├── layout.tsx # 应用布局
│ │ ├── page.tsx # 主应用组件
│ │ ├── ClientBody.tsx # 客户端包装器
│ │ └── globals.css # 全局样式
│ ├── components/ui/ # UI组件库
│ │ ├── badge.tsx, button.tsx, card.tsx
│ │ ├── collapsible.tsx # 可折叠组件
│ │ ├── input.tsx, label.tsx, select.tsx
│ │ ├── slider.tsx, tooltip.tsx
│ └── lib/
│ └── utils.ts # 工具函数
├── out/ # 构建输出
└── node_modules/ # 依赖包
src/app/page.tsx- 主应用组件,包含完整的导师评估逻辑- 20维度评价指标系统
- 智能权重算法
- 风险识别与分析算法
- 数据导入导出功能
src/components/ui/- 完整的shadcn/ui组件集- 基础组件:Badge, Button, Card, Input, Label
- 交互组件:Select, Slider, Tooltip
- 高级组件:Collapsible(支持动画的可折叠面板)
tailwind.config.ts- Tailwind CSS配置,包含动画定义components.json- shadcn/ui组件库配置tsconfig.json- TypeScript配置
- 框架: Next.js 15 + TypeScript
- UI库: shadcn/ui (Radix UI + Tailwind CSS)
- 图标: Lucide React
- 样式: Tailwind CSS
- 动画: CSS动画 + Radix UI过渡效果
- 智能权重系统 (
getTitleMultiplier,getSchoolMultiplier,getGenderAgeMultiplier) - 分项得分计算 (
calculateDetailedScores) - 综合评分算法 (
calculateScore) - 风险识别系统 (
getDetailedAnalysis) - 数据管理 (
exportComparison,importComparison)
- React useState for component state
- localStorage for persistence
- Real-time calculation system
- 20维度评价指标体系
- 智能权重算法(基于学位类型)
- 实时评分计算
- 分项得分可视化
- 精准风险识别(检测所有<3分指标)
- 个性化优势分析(识别4-5分优秀表现)
- 针对性建议生成
- 可折叠详细分析报告
- JSON格式导入/导出
- 导师昵称管理
- 本地数据存储
- 版本控制支持
- 描述性评分界面
- 响应式设计
- 多导师对比
- 无障碍设计支持
- TypeScript严格模式
- ESLint + Biome代码检查
- 函数式组件设计
- 清晰的组件分离
- Next.js静态优化
- 组件懒加载
- CSS-in-JS优化
- 图片资源优化
- 平台: Netlify
- 构建命令:
npm run build - 输出目录:
out/ - 环境: Node.js 16+
- 包管理器: npm (兼容yarn/pnpm/bun)
- 开发服务器: Next.js Dev Server
- 热重载: Turbopack支持
- 本地数据存储,不上传服务器
- 导师昵称系统保护隐私
- 无用户身份追踪
- TypeScript类型安全
- ESLint安全规则检查
- 依赖版本安全检查
- 国际化(i18n)支持
- 劣势权重算法优化(2倍影响)
- 更多导师对比模式
- 历史数据分析
- 单元测试覆盖
- E2E测试
- 性能监控
- 错误边界处理
- 依赖包安全更新
- 算法权重调优
- UI/UX改进
- 文档同步更新
- 构建成功率
- 加载性能
- 用户反馈
- 错误率追踪
This is an international academic advisor evaluation tool called "这个导师坑不坑·测算版" (Is This Advisor a Trap? Calculator Version). It's a Next.js application that helps students scientifically evaluate and compare multiple academic advisors across various dimensions.
- Framework: Next.js 15 with App Router
- UI Components: Radix UI primitives with shadcn/ui
- Styling: Tailwind CSS with custom components
- Internationalization: next-intl for multi-language support (Chinese, English, Japanese)
- Type Checking: TypeScript with strict configuration
- Linting: ESLint with Next.js rules + Biome for formatting
src/app/[locale]/- Internationalized pages using Next.js App Routersrc/components/ui/- Reusable UI components based on shadcn/uisrc/i18n/- Internationalization configuration and locale filessrc/middleware.ts- Next-intl middleware for locale handling
The core logic is now primarily within src/components/AdvisorCalculator.tsx:
- AdvisorData Interface: Defines the structure for advisor information.
- Scoring Algorithm: Complex multi-dimensional scoring system with weighted calculations.
- Real-time Calculations: Dynamic score updates based on user input.
- Detailed Analysis: Generates advantages, risks, and suggestions for each advisor.
- Base Scores: 20 evaluation dimensions (personality, research, funding, etc.)
- Multipliers: Title-based (Nobel Prize to regular professor), school-level. Gender, age, and advisor type are now for reference only and do not affect scoring.
- Weighted Scoring: Configurable weights between school prestige vs advisor qualities.
- Detailed Breakdown: Four main categories (personality, academic, treatment, prospect).
- Uses next-intl with locale prefix strategy.
- Middleware handles locale routing automatically.
- Supports Chinese (default), English, and Japanese.
- Based on shadcn/ui with Radix UI primitives.
- Consistent styling with Tailwind CSS.
- Modular component architecture in
src/components/ui/.
- Main functionality is in
src/components/AdvisorCalculator.tsx. - The
[locale]/page.tsxis a simple wrapper for the calculator component. - Complex scoring logic includes multiple multipliers and weighted calculations.
- Follow the existing shadcn/ui pattern for new components.
- Use the established TypeScript interfaces for data structures.
- Maintain the responsive grid layout for advisor comparisons.
- Add new strings to locale files in
src/i18n/locales/. - Use the
useTranslationshook for client components. - Test with different locales using URL prefixes (e.g.,
/en,/ja).
- Webpack fallbacks configured for client-side compatibility.
- Image optimization enabled but unoptimized for static export compatibility.
- Trailing slash set to false for proper routing.
- Handles locale detection and routing.
- Logs requests for debugging (may want to remove in production).
- Excludes API routes and static assets from locale handling.
The project has been successfully internationalized with next-intl. The main calculator logic has been moved to a reusable component src/components/AdvisorCalculator.tsx that works with all supported locales (Chinese, English, Japanese). The application now properly supports locale-based routing with /zh, /en, and /ja routes.
The core scoring and analysis logic resides within src/components/AdvisorCalculator.tsx.
getTitleMultiplier(advisor: AdvisorData): Calculates a multiplier based on the advisor's academic title (e.g., Nobel, Academician).getSchoolMultiplier(advisor: AdvisorData): Calculates a multiplier based on the school's prestige level (e.g., Global Top, National Top).getGenderAgeMultiplier(advisor: AdvisorData): (For reference only, currently returns 1.0) Originally intended to apply multipliers based on gender and age range, but now serves as a placeholder for future scoring adjustments.getAdvisorTypeMultiplier(advisor: AdvisorData): (For reference only, currently returns 1.0) Originally intended to apply multipliers based on advisor type, but now serves as a placeholder for future scoring adjustments.
calculateDetailedScores(advisor: AdvisorData): Computes detailed scores for four main categories: Personality, Academic, Treatment, and Prospects. These scores are derived from weighted sums of individual evaluation metrics, incorporating relevant multipliers.calculateScore(advisor: AdvisorData): Calculates the final overall score for an advisor. This function combines the school's influence (viaschoolMultiplier) and the aggregated advisor scores (fromadvisorScores), applying user-defined weights for school vs. advisor factors.
getScoreLevel(score: number): Categorizes the overall score into levels (e.g., "Excellent Advisor", "Major Red Flags") with associated color indicators.getDetailedAnalysis(advisor: AdvisorData): Generates a comprehensive analysis report, identifying advantages (based on high scores), potential risks (based on low scores), and providing a general suggestion for the advisor).