Home

Awesome

đŸē 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

<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:

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 GitHub release, 27 different roles are available to play:

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 GitHub release.

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

  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

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

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