- ๐บ 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
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 ? Check out the dedicated about page.
Two versions are available for testing this API:
โจ Main API (Base URL: https://werewolves-assistant-api.antoinezanardi.fr)
๐ง Sandbox API (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 !
On this current version , 27 different roles are available to play:
The Werewolf
The Big Bad Wolf
The Vile Father Of Wolves
The White Werewolf
The Villager
The Villager-Villager
The Seer
The Cupid
The Witch
The Hunter
The Little Girl
The Guard
The Ancient
The Scapegoat
The Idiot
The Two Sisters
The Three Brothers
The Fox
The Bear Tamer
The Stuttering Judge
The Rusty Sword Knight
The Wild Child
The Dog-Wolf
The Thief
The Angel
The Pied Piper
The Raven
Please check the Player role section on API documentation or the Available Roles section on the official website for more details about each role.
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.
Each change when a new version comes up is listed in the CHANGELOG.md file 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 .
โจ Main API is updated when commits are merged into the master
branch.
๐ง Sandbox API 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.
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.
- 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.
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
.
- 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.
This project is licensed under the MIT License.
If you want to contribute to this project, please read the contribution guide.
Thank you to all the contributors:
![]() Thomas Deschamps |