Awesome
đē Werewolves Assistant API
đ Table of Contents
- đē What is this API ?
- đ Let's try !
- đ Roles available
- đ API Documentation
- đ Versions & changelog
- âī¸ Code analysis and consistency
- đ¨ Installation
- đ Let's go
- âī¸ Other useful commands
- Šī¸ License
- â¤ī¸ Contributors
<a name="what-is-this-api">đē What is this API ?</a>
Werewolves Assistant API provides over HTTP requests a way of manage Werewolves games in order to help the game master in his task.
This is the project's API used by Werewolves Assistant Web, the main web VueJS client.
đ¤ Want to know more about this awesome project ? <a href="https://werewolves-assistant.antoinezanardi.fr/about" target="_blank">Check out the dedicated about page</a>.
<a name="lets-try">đ Let's try !</a>
Two versions are available for testing this API:
⨠<a href="https://werewolves-assistant-api.antoinezanardi.fr" target="_blank">Main API</a> (Base URL: https://werewolves-assistant-api.antoinezanardi.fr)
đ§ <a href="https://sandbox.werewolves-assistant-api.antoinezanardi.fr" target="_blank">Sandbox API</a> (Base URL: https://sandbox.werewolves-assistant-api.antoinezanardi.fr)
Sandbox API may contain some bugs and unexpected behaviors as its purpose is to test new features before deploying on main API.
Both APIs are running on a server with the following configuration:
- OS:
Debian GNU/Linux 10 (buster)
- NodeJS:
v14.16.1
- NPM:
v6.14.12
- MongoDB shell version:
v4.4.5
The MongoDB database is protected under username and password authentication.
đđ§âđ Fan of Postman ? Try out the official public collection for your tests !
<a name="roles-available">đ Roles available</a>
On this current version , 27 different roles are available to play:
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/werewolf.png" width="25"/> The Werewolf
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/big-bad-wolf.png" width="25"/> The Big Bad Wolf
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/vile-father-of-wolves.png" width="25"/> The Vile Father Of Wolves
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/white-werewolf.png" width="25"/> The White Werewolf
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/villager.png" width="25"/> The Villager
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/villager.png" width="25"/> The Villager-Villager
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/seer.png" width="25"/> The Seer
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/cupid.png" width="25"/> The Cupid
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/witch.png" width="25"/> The Witch
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/hunter.png" width="25"/> The Hunter
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/little-girl.png" width="25"/> The Little Girl
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/guard.png" width="25"/> The Guard
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/ancient.png" width="25"/> The Ancient
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/scapegoat.png" width="25"/> The Scapegoat
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/idiot.png" width="25"/> The Idiot
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/two-sisters.png" width="25"/> The Two Sisters
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/three-brothers.png" width="25"/> The Three Brothers
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/fox.png" width="25"/> The Fox
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/bear-tamer.png" width="25"/> The Bear Tamer
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/stuttering-judge.png" width="25"/> The Stuttering Judge
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/rusty-sword-knight.png" width="25"/> The Rusty Sword Knight
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/wild-child.png" width="25"/> The Wild Child
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/dog-wolf.png" width="25"/> The Dog-Wolf
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/thief.png" width="25"/> The Thief
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/angel.png" width="25"/> The Angel
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/pied-piper.png" width="25"/> The Pied Piper
- <img src="https://werewolves-assistant-api.antoinezanardi.fr/img/roles/raven.png" width="25"/> The Raven
Please check the <a href="https://werewolves-assistant-api.antoinezanardi.fr/apidoc/#player-roles" target="_blank">Player role section on API documentation</a> or the <a href="https://werewolves-assistant.antoinezanardi.fr/about" target="_blank">Available Roles section on the official website</a> for more details about each role.
<a name="api-documentation">đ API Documentation</a>
Documentation is available for both versions:
Note that contributors try their best to maintain documentations up to date. If you find any typos or oversights, please open an issue, or a pull request.
<a name="versions">đ Versions & changelog</a>
Each change when a new version comes up is listed in the <a href="https://github.com/antoinezanardi/werewolves-assistant-api/blob/master/CHANGELOG.md" target="_blank">CHANGELOG.md file</a> placed at project's root.
Also, you can keep up with changes by watching releases with the Watch GitHub button at the top of this page.
Current release on main API is .
⨠<a href="https://werewolves-assistant-api.antoinezanardi.fr" target="_blank">Main API</a> is updated when commits are merged into the master
branch.
đ§ <a href="https://sandbox.werewolves-assistant-api.antoinezanardi.fr" target="_blank">Sandbox API</a> is updated when commits are merged into the staging
branch.
Travis helps the project to be automatically updated by deploying new versions for both Sandbox and Main APIs. Please refer to the .travis.yml file for more details.
đˇī¸ <a href="https://github.com/antoinezanardi/werewolves-assistant-api/releases" target="_blank">All releases for this project are available here</a>.
<a name="code-analysis-and-consistency">âī¸ Code analysis and consistency</a>
In order to keep the code clean, consistent and free of bad JS practises, ESLint is installed with more than 220 rules activated !
Complete list of all enabled rules is available in the .eslintrc.js file.
<a name="installation">đ¨ Installation</a>
- Install dependencies with
npm install
(add--production
to omit dev dependencies). - Copy
.env.example
and paste it as.env
. - Replace environment values in the fresh new
.env
file if necessary (When â ī¸ī¸ Required is specified):- DB_USER: User for authenticating into the MongoDB database.
- â ī¸ Required if MongoDB auth is enabled
- DB_PASSWORD: Password for authenticating into the MongoDB database.
- â ī¸ Required if MongoDB auth is enabled
- DB_NAME: Name of the MongoDB database.
- Not required - Default value:
werewolves-assistant
- Not required - Default value:
- BASIC_USERNAME: Username for basic authentication.
- Not required - Default value:
root
- Not required - Default value:
- BASIC_PASSWORD: Password for basic authentication.
- Not required - Default value:
secret
- Not required - Default value:
- PORT: Which port the API must run.
- Not required - Default value:
4202
- Not required - Default value:
- JWT_SECRET: Encryption key used for JSON Web Token.
- Not required - Default value:
somethingsecret
- Not required - Default value:
- SENTRY_ENABLED: Enable if errors are caught and sent to Sentry.
- Not required
- SENTRY_PROJECT_ID: Sentry project's ID.
- Not required
- SENTRY_KEY: Sentry secret key.
- Not required
- FACEBOOK_APP_ID: Facebook application ID if you want to enable Facebook authentication.
- Not Required
- GOOGLE_CLIENT_ID: Google client ID if you want to enable Google authentication.
- Not Required
- DB_USER: User for authenticating into the MongoDB database.
<a name="lets-go">đ Let's go</a>
To start the API on development mode, simply run npm start
.
To start the API on production mode, run npm run start_sandbox
or npm run start_production
.
<a name="other-useful-commands">âī¸ Other useful commands</a>
- Tests:
npm run test
runs various tests to check API endpoints. - Lint:
npm run lint
checks for code style. Based on AirBnB configuration with many more rules. - Doc:
npm run doc
generates doc for API.
<a name="license">Šī¸ License</a>
This project is licensed under the MIT License.
<a name="contributors">â¤ī¸ Contributors</a>
If you want to contribute to this project, please read the contribution guide.
Thank you to all the contributors:
<table> <tbody> <tr> <td align="center" valign="top"> <a href="https://github.com/DeschampsThomas"> <img src="https://github.com/DeschampsThomas.png?s=75" width="75" height="75"><br/> Thomas Deschamps </a> </td> </tr> </tbody> </table>