Skip to content

antoinezanardi/werewolves-assistant-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐺 Werewolves Assistant API

GitHub release GitHub license Build Status Known Vulnerabilities Contributions are welcome

ForTheBadge open-source ForTheBadge built-with-love ForTheBadge uses-js

πŸ“‹ Table of Contents

  1. 🐺 What is this API ?
  2. πŸ” Let's try !
  3. πŸƒ Roles available
  4. πŸ“š API Documentation
  5. πŸ“ˆ Versions & changelog
  6. β˜‘οΈ Code analysis and consistency
  7. πŸ”¨ Installation
  8. πŸ”Œ Let's go
  9. βš™οΈ Other useful commands
  10. ©️ License
  11. ❀️ 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 GitHub release, 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 GitHub release.

✨ 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.

  1. Install dependencies with npm install (add --production to omit dev dependencies).
  2. Copy .env.example and paste it as .env.
  3. 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
    • BASIC_USERNAME: Username for basic authentication.
      • Not required - Default value: root
    • BASIC_PASSWORD: Password for basic authentication.
      • Not required - Default value: secret
    • PORT: Which port the API must run.
      • Not required - Default value: 4202
    • JWT_SECRET: Encryption key used for JSON Web Token.
      • Not required - Default value: somethingsecret
    • 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

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