Common Voice 项目使用教程
项目的目录结构及介绍
Common Voice 项目的目录结构如下:
common-voice/
├── docker/
├── docs/
├── locales/
├── maintenance/
├── scripts/
├── server/
├── web/
├── .dockerignore
├── .editorconfig
├── .env-local-docker.example
├── .eslintignore
├── .eslintrc.js
├── .gitattributes
├── .gitignore
├── .node-version
├── .prettierignore
├── .prettierrc
├── Japanese-sentence-submission.txt
├── LICENSE
├── README.md
├── contribute.json
├── docker-compose.yaml
├── l10n.toml
├── package.json
├── renovate.json
├── tsconfig.base.json
├── tsconfig.eslint.json
└── yarn.lock
目录介绍
docker/
: 包含 Docker 相关的配置文件。docs/
: 包含项目文档。locales/
: 包含多语言文件。maintenance/
: 包含维护脚本。scripts/
: 包含各种脚本文件。server/
: 包含服务器端代码。web/
: 包含前端代码。.dockerignore
: Docker 忽略文件。.editorconfig
: 编辑器配置文件。.env-local-docker.example
: 本地 Docker 环境变量示例文件。.eslintignore
: ESLint 忽略文件。.eslintrc.js
: ESLint 配置文件。.gitattributes
: Git 属性配置文件。.gitignore
: Git 忽略文件。.node-version
: Node.js 版本文件。.prettierignore
: Prettier 忽略文件。.prettierrc
: Prettier 配置文件。Japanese-sentence-submission.txt
: 日语句子提交文件。LICENSE
: 项目许可证。README.md
: 项目说明文档。contribute.json
: 贡献指南文件。docker-compose.yaml
: Docker Compose 配置文件。l10n.toml
: 本地化配置文件。package.json
: 项目依赖配置文件。renovate.json
: Renovate 配置文件。tsconfig.base.json
: TypeScript 基础配置文件。tsconfig.eslint.json
: TypeScript ESLint 配置文件。yarn.lock
: Yarn 锁定文件。
项目的启动文件介绍
Common Voice 项目的启动文件主要包括以下几个部分:
package.json
: 包含了项目的依赖、脚本命令等信息。docker-compose.yaml
: 用于启动 Docker 容器的配置文件。
package.json
{
"name": "common-voice",
"version": "1.0.0",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.17.1"
}
}
docker-compose.yaml
version: '3'
services:
web:
build: .
ports:
- "8080:8080"
项目的配置文件介绍
Common Voice 项目的配置文件主要包括以下几个部分:
.env-local-docker.example
: 本地 Docker 环境变量示例文件。l10n.toml
: 本地化配置文件。.eslintrc.js
: ESLint 配置文件。.prettierrc
: Prettier 配置文件。
.env-local-docker.example
# 本地 Docker 环境变量示例
NODE_ENV=development
PORT=8080
l10n.toml
[general]
default_locale = "en"
.eslintrc.js
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',