simba-index/README.md

5.2 KiB
Raw Permalink Blame History

Simba Index

黑龙江大学 Simba Robotics 战队的官方网站项目,用于展示团队信息、成员、机器人作品和比赛成就。

目录

项目概述

Simba Index 是一个使用 Next.js 构建的现代化 Web 应用,采用 React 框架和 Tailwind CSS 进行样式设计。网站包含以下主要功能:

  • 响应式设计,适配各种设备屏幕
  • 团队介绍和成员展示
  • 机器人作品展示
  • 比赛成就和历史记录
  • 联系方式和招募信息

开发环境需求

要开发和运行此项目,您需要以下环境:

  • Node.js (v18.0.0 或更高版本)
  • npm (v8.0.0 或更高版本) 或 yarn (v1.22.0 或更高版本)
  • 现代浏览器 (Chrome, Firefox, Safari, Edge)
  • 代码编辑器 (推荐 Visual Studio Code)
  • Git

项目目录结构

simba-index/
├── app/                    # Next.js 应用路由
│   ├── history/            # 英灵殿页面
│   ├── privacy/            # 隐私政策页面
│   ├── robots/             # 机器人详情页面
│   ├── teams/              # 团队小组页面
│   ├── terms/              # 服务条款页面
│   ├── globals.css         # 全局样式
│   ├── layout.tsx          # 根布局组件
│   └── page.tsx            # 首页组件
├── components/             # 可复用组件
│   ├── ui/                 # UI 组件库
│   ├── about-section.tsx   # 关于部分组件
│   ├── achievements-section.tsx # 成就部分组件
│   ├── contact-section.tsx # 联系部分组件
│   ├── footer.tsx          # 页脚组件
│   ├── header.tsx          # 页头组件
│   ├── hero-section.tsx    # 英雄部分组件
│   ├── robots-showcase.tsx # 机器人展示组件
│   ├── team-groups-section.tsx # 团队小组部分组件
│   └── theme-provider.tsx  # 主题提供者组件
├── lib/                    # 工具和数据
│   ├── achievement-data.ts # 成就数据
│   ├── robot-data.ts       # 机器人数据
│   └── utils.ts            # 工具函数
├── public/                 # 静态资源
│   ├── icons/              # 图标文件
│   ├── grid-pattern.png    # 网格背景
│   └── logo.svg            # 团队 Logo
├── .gitignore              # Git 忽略文件
├── next.config.js          # Next.js 配置
├── package.json            # 项目依赖
├── README.md               # 项目说明
├── tailwind.config.ts      # Tailwind CSS 配置
└── tsconfig.json           # TypeScript 配置

安装和设置

按照以下步骤设置开发环境:

1. 克隆仓库

git clone https://git.sloray.com/PRAM/simba-index.git
cd simba-index

2. 安装依赖

使用 npm

npm install

或使用 yarn

yarn install

3. 环境变量设置

如果需要,创建 .env.local 文件并添加必要的环境变量:

NEXT_PUBLIC_SITE_URL=http://localhost:3000

编译和调试

开发模式

启动开发服务器:

npm run dev
# 或
yarn dev

访问 http://localhost:3000 查看网站。

构建项目

构建生产版本:

npm run build
# 或
yarn build

运行生产版本

npm run start
# 或
yarn start

代码检查

运行 ESLint 检查代码:

npm run lint
# 或
yarn lint

部署

该项目可以部署到任何支持 Next.js 的平台。

自托管部署

  1. 构建项目:npm run build
  2. .nextpublic 目录和 package.json 复制到服务器
  3. 在服务器上安装依赖:npm install --production
  4. 启动服务:npm run start

贡献指南

我们欢迎任何形式的贡献!如果您想为项目做出贡献,请遵循以下步骤:

  1. Fork 仓库
  2. 创建您的特性分支:git checkout -b feature/amazing-feature
  3. 提交您的更改:git commit -m 'Add some amazing feature'
  4. 推送到分支:git push origin feature/amazing-feature
  5. 提交 Pull Request

代码风格

  • 使用 TypeScript 进行类型检查
  • 遵循 ESLint 规则
  • 使用函数组件和 React Hooks
  • 使用 Tailwind CSS 进行样式设计
  • 保持组件的可复用性和模块化

命名约定

  • 组件文件:使用 kebab-casehero-section.tsx
  • React 组件:使用 PascalCaseHeroSection
  • 函数和变量:使用 camelCasehandleClick
  • 常量:使用大写 SNAKE_CASEMAX_ITEMS

许可证

本项目采用 GPL-v3.0 许可证 - 详情请参阅 LICENSE 文件。

联系方式

如有任何问题或建议,请联系:


© 2025 Simba Robotics. 保留一切权利。