2022-03-23 09:37:25 +01:00
# Contributing to FitTrackee
First off, thank you for your interest in contributing!
## Report issues, ask for features
* If a bug is a **security vulnerability** , please refer to [security policy ](https://github.com/SamR1/FitTrackee/blob/master/SECURITY.md ).
* Ensure an issue was not **already opened** by searching on **GitHub** under [Issues ](https://github.com/SamR1/FitTrackee/issues ).
* If not, [open a new one ](https://github.com/SamR1/FitTrackee/issues/new ) with a descriptive title and provide a description.
## Contributing Code
### Project repository
The **GitHub** repository contains:
- source code (note that the repository also includes client build),
2022-07-03 08:02:43 +02:00
- translations,
2022-03-23 09:37:25 +01:00
- tests,
2023-06-25 14:00:35 +02:00
- documentation (source, translations and build).
2022-03-23 09:37:25 +01:00
2022-04-09 10:16:46 +02:00
Continuous integration workflows run on **Github Actions** platform (on **push** and **pull requests** ).
2023-06-25 14:00:35 +02:00
For now, releases do not follow [semantic versioning ](https://semver.org ). Any version may contain backward-incompatible changes.
2022-07-03 08:02:43 +02:00
### Translations
The available languages are:
[![Translation status ](https://hosted.weblate.org/widgets/fittrackee/-/multi-auto.svg )](https://hosted.weblate.org/engage/fittrackee/)
2023-06-25 14:00:35 +02:00
Application translations files are located:
2022-07-03 08:02:43 +02:00
- on API side (emails): `fittrackee/emails/translations/` (implemented with [Babel ](https://babel.pocoo.org/en/latest/ ))
- on client side: `fittrackee_client/src/locales` (implemented with [Vue I18n ](https://vue-i18n.intlify.dev/ ))
Translations can be updated through [Weblate ](https://hosted.weblate.org/engage/fittrackee/ ).
2022-04-09 10:16:46 +02:00
2023-06-25 14:00:35 +02:00
Documentation translations are located in following directory: `docsrc/locales` .
For now only English and French are available and translations files are not yet on Weblate.
2022-03-23 09:37:25 +01:00
### How to install FitTrackee
see [Installations instructions ](https://samr1.github.io/FitTrackee/installation.html )
### Pull Requests
2023-06-03 15:37:15 +02:00
**Note**: Before starting, please open an issue to discuss implementation if the feature requires major changes or involves the addition of a new sport or language.
2023-05-29 14:35:09 +02:00
2022-03-23 09:37:25 +01:00
Please make your changes from the development branch (`dev`).
* Fork the repository (see [GitHub instructions ](https://docs.github.com/en/get-started/quickstart/contributing-to-projects ))
* Implement your feature.
* If your changes need a database migration:
* You can generate one after updating models with the following command:
```shell
$ make migrate-db
```
* For data migration, an empty migration can be created with this following command:
```shell
$ make revision MIGRATION_MESSAGE="< MIGRATION_MESSAGE > "
```
* Rename the migration, prefixing with the next number.
* To apply database changes:
```shell
$ make upgrade-db
```
* Check the downgrade migration.
2022-04-09 10:16:46 +02:00
* Run checks (lint, type check and unit tests).
2022-03-23 09:37:25 +01:00
```shell
$ make check-all
```
2022-03-26 16:06:46 +01:00
There are some end-to-end tests, to run them (needs a running application):
2022-03-23 09:37:25 +01:00
```shell
$ make test-e2e
```
2023-06-03 15:37:15 +02:00
* If needed, update translations (at least add English strings).
2022-07-03 08:02:43 +02:00
* On client side, update files in `fittrackee_client/src/locales` folder.
* On API side (emails), to extract new strings into `messages.pot` :
```shell
$ make babel-extract
```
To add new strings in translations files (`fittrackee/emails/translations/< LANG > /LC_MESSAGES/messages.po`):
```shell
$ make babel-update
```
After updating strings in `messages.po` , compile the translations:
```shell
$ make babel-compile
```
2022-03-23 09:37:25 +01:00
* If needed, add or update tests.
2022-04-09 10:16:46 +02:00
* If needed, update documentation (no need to build documentation, it will be done when releasing).
2022-03-23 09:37:25 +01:00
2022-07-03 08:02:43 +02:00
* If updated code contains client-side changes, you can generate javascript assets to check **FitTrackee** whithout starting client dev server:
2022-03-23 09:37:25 +01:00
```shell
$ make build-client
```
2022-07-03 08:02:43 +02:00
No need to commit these files, dist files will be generated before merging or when releasing.
2022-03-23 09:37:25 +01:00
* Create your pull request to merge on `dev` branch.
* Ensure the pull requests description clearly describes the problem and solution. Include the relevant issue number if applicable.
2023-06-03 15:37:15 +02:00
* Check that all tests have been successfully passed.
2022-03-26 16:06:46 +01:00
* If needed, [update your branch ](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch ).
2022-03-23 09:37:25 +01:00
Thanks.