🎉 First off, thanks for taking the time to contribute! This project would not be possible without people like you. 🎉
By participating in this project, you're agreeing to uphold the Mozilla Community Participation Guidelines. If you need to report a problem, please see our REPORTING.md guide.
Help us add more sentences for other volunteers to read. See issue 341 for details.
All of our current issues can be found here on GitHub. Anything with a help wanted tag is up for grabs.
- NodeJS (v7 or higher)
- npm (v4 or higher)
- yarn (v1 or higher)
- ffmpeg
- MariaDB (v10 or higher) or MySQL (v5.6 or higher)
We provide a docker-compose setup to orchestrate the local development environment configuration using docker.
Fork and clone the repository onto your computer.
Then run the following commands to spin off voice-web
:
> cd voice-web
> docker-compose up
This is going to:
- Launch a mysql instance configured for
voice-web
- Launch an s3proxy instance to store files locally and avoid going through setting up AWS S3.
- Mount the project using a docker volume to allow reflecting changes to the codebase directly to the container.
- Launch
voice-web
server
You can visit the website at http://localhost:9000.
Fork and clone the repository onto your computer.
Either create a MySQL root user that conforms to the default DB_ROOT_USER
and DB_ROOT_PASS
in /server/src/config-helper.ts
or create your own config.
Then cd
into the project directory and enter the following commands:
yarn
yarn start
This will:
- Install all JavaScript dependencies.
- Build and serve files located in the
web
folder on localhost. - Save uploaded voice clips onto Amazon's S3.
- Lint and rebuild all js files on every change.
You can then access the website at http://localhost:9000.
You can find configurable options, like the port CommonVoice is running on, in /server/src/config-helper.ts
. Just create a /server/config.json
with the config you want to override.
The Common Voice project uses S3 for voice clip storage. If you need help configuring S3, check out HOWTO_S3.md
We use db-migrate for running database migrations.
To add a migration run:
yarn migrate create <MIGRATION_NAME>
.
At the moment you manually have to change the migration file extension to .ts
. A migration has to expose the following API:
export const up = async function(db: any): Promise<any> {
return null;
};
export const down = async function(): Promise<any> {
return null;
};
Migrations are always run when the server is started.
We're using Fluent to localize strings. You can find examples all over the frontend code. Strings that appear in the english message files, can then be translated on Pontoon. Some things to note regarding string changes are documented on MDN.
To update the list of locales run:
yarn import-locales
This creates/updates files in /locales
:
- fetch locale codes & names from Pontoon and save them in
all.json
- based on Pontoon translated data and a threshold defined in the script, save "completed" locales to
completed.json
- add codes that have a sentence folder in
/server/data
tocontributable.json
For more options, just type:
yarn run
The project is organized into the following directories:
- android: The Android app, a simple webview wrapper of voice.mozilla.org. This app is currently not published.
- docs: Design and data specifications for Common Voice.
- ios: The iOS app. This is a simple wrapper app for the website, as a workaround for a microphone issue in Safari.
- nubis: Configuration files for Nubis, our deployment tool.
- server: The server-side app logic, written in TypeScript.
- tools: Some scripts for managing data.
- web: The Common Voice website files, written in TypeScript. We use React to build the website.
Did you notice a bug? Do you have a feature request? Please file an issue here on GitHub.
Want to talk about something but can't find a home for it here? Head to our Discourse Category to discuss everything from feedback and ideas to questions and random musings.