📋 Table of Contents#
- 🐺 What is this app ?
- 🃏 Available roles
- 🔨 Installation
- 🚀 Build
- 💯 Tests
- 🌿 Env variables
- ☑️ Code analysis and consistency
- 📈 Releases & Changelog
- 🐙 GitHub Actions
- ✨ Misc commands
- ©️ License
- ❤️ Contributors
🐺 What is this app ?#
Werewolves Assistant Web is a Nuxt Web App using the Werewolves Assistant API. It helps you, the game master, to manage your games of Werewolves Of Millers Hollow.
This is the next version of the current Werewolves Assistant Web. It is still under development.
🤔 Want to know more about this awesome project ? Check out the dedicated about page.#
🃏 Available roles#
Werewolf |
Big Bad Wolf |
Accursed Wolf-Father |
White Werewolf |
|---|---|---|---|
Villager |
Villager-Villager |
Seer |
Cupid |
Witch |
Hunter |
Little Girl |
Defender |
Elder |
Scapegoat |
Idiot |
Two Sisters |
Three Brothers |
Fox |
Bear Tamer |
Stuttering Judge |
Rusty Sword Knight |
Wild Child |
Wolf-Hound |
Thief |
Angel |
Pied Piper |
Scandalmonger |
Prejudiced Manipulator |
Actor |
Devoted Servant |
🔨 Installation#
To install this project, you will need to have on your machine :
We recommend to use the node version specified in the .nvmrc file.
If you don't have pnpm installed, you can still use npm for all commands below, but we recommend to use pnpm for faster and more reliable installs.
Then, run the following commands :
# Install dependencies and Husky hooks
pnpm install
# Run the app in dev mode
pnpm run dev
The above command will start the app in development mode and watch for changes on local.
🚀 Build#
In order to build the app for production, run the following command :
# Build the app
pnpm run build
💯 Tests#
🧪 Unit tests#
👽 Mutant testing#
You can also check the mutation testing report.
▶️ Commands#
Before testing, you must follow the installation steps.
Then, run one of the following commands :
# Assure you started test Docker containers (4 databases are created to parallelize tests)
pnpm run docker:test:start
# Run unit tests with coverage
pnpm run test:unit:cov
# Run unit tests only on staged files (run on pre-commit)
pnpm run test:staged # TODO: Fix this command
# Run mutant tests with coverage
pnpm run test:stryker
# Run mutant tests with coverage from scratch (without using the incremental file)
pnpm run test:stryker:force
🌿 Env variables#
Environnement files are available in the env directory.
You can create a .env file in this directory to override the default values when starting the API locally with pnpm run dev command.
Environment variables are :
| Name | Description | Required | Default value | Limitations |
|---|---|---|---|---|
NUXT_PUBLIC_WEREWOLVES_ASSISTANT_API_BASE_URL |
URL of the Werewolves Assistant API | ✅ | ❌ | Must be a valid URL |
☑️ Code analysis and consistency#
🔍 Code linting & formatting#
In order to keep the code clean, consistent and free of bad TS practices, more than 300 ESLint rules are activated !
Complete list of all enabled rules is available in the eslintrc.config.js file.
▶️ Commands#
Before linting, you must follow the installation steps.
Then, run one of the following commands :
# Lint
pnpm run lint
# Lint and fix
pnpm run lint:fix
# Lint and fix only on staged files (runs on pre-commit)
pnpm run lint:staged:fix
🥇 Project quality scanner#
Multiple tools are set up to maintain the best code quality and to prevent vulnerabilities :
You can check the CodeQL analysis report here.
SonarCloud summary is available here.
📈 Releases & Changelog#
Releases on main branch are generated and published automatically by :
It uses the conventional commit strategy.
Each change when a new release comes up is listed in the CHANGELOG.md file.
Also, you can keep up with changes by watching releases via the Watch GitHub button at the top of this page.
🐙 GitHub Actions#
This project uses GitHub Actions to automate some boring tasks.
You can find all the workflows in the .github/workflows directory.
🎢 Workflows#
| Name | Description & Status | Triggered on |
|---|---|---|
| ⚙️ Build | Various checks for app health, code quality and tests coverage |
push on develop and all pull requests to develop |
| 🔃 Lint PR Name Into Develop Workflow | Checks if pull request name respects conventionnal-commit rules |
pull-request created or updated |
| 🔃️ Upsert PR Release Workflow | Creates or updates pull request to main depending on commits on develop since last release |
push on develop |
| 🏷️ Release Creation Workflow | Creates a new release using semantic-release with tag and updated changelog |
push on main |
| 🚀 Deploy To Production Workflow | Deploys app with last tag version to Docker Hub and GCP |
tag-creation |
✨ Misc commands#
🔀 Create git branch with a conventional name#
pnpm run script:create-branch
⤴️ Create pull request against the develop branch from current branch#
pnpm run script:create-pull-request
📣 To all IntelliJ IDEs users (IntelliJ, Webstorm, PHPStorm, etc.)#
All the above commands are available in the .run directory at the root of the project.
You can add them as run configurations in your IDE.
©️ License#
This project is licensed under the MIT License.
❤️ Contributors#
There is no contributor yet. Want to be the first ?
If you want to contribute to this project, please read the contribution guide.