Skip to content

Commit

Permalink
Merge pull request #169 from antoinezanardi/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
antoinezanardi authored Apr 30, 2021
2 parents bfea7d9 + 0038a3b commit a0fa987
Show file tree
Hide file tree
Showing 59 changed files with 3,647 additions and 6,473 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ BASIC_USERNAME=root
BASIC_PASSWORD=secret
SENTRY_ENABLED=true
SENTRY_PROJECT_ID=projectId
SENTRY_KEY=key
SENTRY_KEY=key
FACEBOOK_APP_ID=appId
GOOGLE_CLIENT_ID=clientId
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
# 📈 LIST OF CHANGES FOR WEREWOLVES ASSISTANT API

## 0.11.0 (2021-04-30)

### 🚀 New features

* [#137](https://github.com/antoinezanardi/werewolves-assistant-api/issues/137) - `position` for each player.
* [#138](https://github.com/antoinezanardi/werewolves-assistant-api/issues/138) - Facebook authentication.
* [#139](https://github.com/antoinezanardi/werewolves-assistant-api/issues/139) - Google authentication.
* [#141](https://github.com/antoinezanardi/werewolves-assistant-api/issues/141) - Fox role.
* [#142](https://github.com/antoinezanardi/werewolves-assistant-api/issues/142) - Bear Tamer role.
* [#143](https://github.com/antoinezanardi/werewolves-assistant-api/issues/143) - Hidden game repartition option.
* [#144](https://github.com/antoinezanardi/werewolves-assistant-api/issues/144) - Role revealed on death option.
* [#145](https://github.com/antoinezanardi/werewolves-assistant-api/issues/145) - Seer see exact role option.
* [#146](https://github.com/antoinezanardi/werewolves-assistant-api/issues/146) - Guard can protect twice option.
* [#147](https://github.com/antoinezanardi/werewolves-assistant-api/issues/147) - Fox not powerless if he misses a werewolf option.
* [#148](https://github.com/antoinezanardi/werewolves-assistant-api/issues/148) - Bear Tamer growls if he is infected option.
* [#149](https://github.com/antoinezanardi/werewolves-assistant-api/issues/149) - Number of vote requests for Stuttering Judge option.
* [#150](https://github.com/antoinezanardi/werewolves-assistant-api/issues/150) - Time for the Sheriff to be elected option.
* [#151](https://github.com/antoinezanardi/werewolves-assistant-api/issues/151) - Thief not obliged to choose between werewolves cards option.
* [#152](https://github.com/antoinezanardi/werewolves-assistant-api/issues/152) - Wild Child transformation is revealed option.
* [#153](https://github.com/antoinezanardi/werewolves-assistant-api/issues/153) - Dog Wolf chosen side is revealed option.
* [#154](https://github.com/antoinezanardi/werewolves-assistant-api/issues/154) - Big Bad Wolf not powerless if one werewolf dies option.
* [#155](https://github.com/antoinezanardi/werewolves-assistant-api/issues/155) - White Werewolf waking up interval option.
* [#156](https://github.com/antoinezanardi/werewolves-assistant-api/issues/156) - Number of charmed people per night by Pied Piper option.
* [#157](https://github.com/antoinezanardi/werewolves-assistant-api/issues/157) - Pied Piper not powerless if infected option.
* [#158](https://github.com/antoinezanardi/werewolves-assistant-api/issues/158) - Lives count for the Ancient option.
* [#159](https://github.com/antoinezanardi/werewolves-assistant-api/issues/159) - Ancient doesn't make all villagers powerless if murdered from them option.
* [#160](https://github.com/antoinezanardi/werewolves-assistant-api/issues/160) - Number of additional cards for Thief option.
* [#161](https://github.com/antoinezanardi/werewolves-assistant-api/issues/161) - Rusty Sword Knight role.

### 🌟 Enhancements

* [#162](https://github.com/antoinezanardi/werewolves-assistant-api/issues/162) - Role types.

### ♻️ Refactoring

* [#140](https://github.com/antoinezanardi/werewolves-assistant-api/issues/140) - Extend token's lifetime to infinity.

### 📦 Packages

* `axios` installed with version `0.21.1`.
* `@sentry/node` updated to version `6.3.5`.
* `apidoc` updated to version `0.26.0`.
* `chai` updated to version `4.3.4`.
* `eslint` updated to version `7.25.0`.
* `express-validator` updated to version `6.10.1`.
* `migrate-mongo` updated to version `8.2.2`.
* `mocha` updated to version `8.3.2`.
* `mongoose` updated to version `5.12.6`.
* `qs` updated to version `6.10.1`.
* `validator` updated to version `13.6.0`.

---

## 0.10.0 (2021-03-03)

### 🚀 New features
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ Two versions are available for testing this API:

🔧 <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 contains some bugs and unexpected behaviors as its purpose is to test new features before deploying on **main API**.
**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.15.4`
- **NPM**: `v7.5.2`
- **MongoDB shell version**: `v4.4.3`
- **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**](https://www.getpostman.com/collections/d24ac6443fe18e0fe389) for your tests !

## <a name="roles-available">🃏 Roles available</a>

On this current version [![GitHub release](https://img.shields.io/github/release/antoinezanardi/werewolves-assistant-api.svg)](https://GitHub.com/antoinezanardi/werewolves-assistant-api/releases/), **24 different roles** are available to play:
On this current version [![GitHub release](https://img.shields.io/github/release/antoinezanardi/werewolves-assistant-api.svg)](https://GitHub.com/antoinezanardi/werewolves-assistant-api/releases/), **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**
Expand All @@ -71,7 +71,10 @@ On this current version [![GitHub release](https://img.shields.io/github/release
- **<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**
Expand Down Expand Up @@ -137,6 +140,10 @@ Complete list of all enabled rules is available in the **[.eslintrc.js file](htt
- _**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>

Expand Down
13 changes: 8 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ const cors = require("cors");
const Config = require("./config");
const { sendError, generateError } = require("./src/helpers/functions/Error");
const { connect: connectDatabase } = require("./src/helpers/functions/Mongoose");
const routes = require("./src/routes");

if (Config.sentry.enabled) {
const Sentry = require("@sentry/node");
Sentry.init({ dsn: `https://${Config.sentry.key}@sentry.io/${Config.sentry.projectID}` });
}
console.log("Starting the application...");
connectDatabase().then(() => {
console.log("✅ Connected to database.");
if (Config.app.nodeEnv !== "test") {
console.log("✅ Connected to database.");
}
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cors({ origin: "*" }));
Expand All @@ -27,13 +30,13 @@ connectDatabase().then(() => {
next();
}
});
const routes = require("./src/routes");
routes(app);
app.listen(Config.app.port);
console.log(`${bold("🐺 Werewolves Assistant API")} server started on port ${bold.blue(Config.app.port)} and running on database ${bold.green(Config.db.name)}.`);
console.log(`${bold("📚 API Documentation:")} http://localhost:${Config.app.port}/apidoc`);
if (Config.app.nodeEnv !== "test") {
console.log(`${bold("🐺 Werewolves Assistant API")} server started on port ${bold.blue(Config.app.port)} and running on database ${bold.green(Config.db.name)}.`);
console.log(`${bold("📚 API Documentation:")} http://localhost:${Config.app.port}/apidoc`);
}
app.emit("ready");
app.prototype.isReady = true;
});

module.exports = app;
2 changes: 1 addition & 1 deletion config/apidoc/apidoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "\uD83D\uDC3A Werewolves Assistant API",
"version": "0.10.0",
"version": "0.11.0",
"description": "Werewolves Assistant API provides over HTTP requests a way of manage The Werewolves of Millers Hollow games in order to help the game master in his task.",
"header": {
"title": "Classes",
Expand Down
Loading

0 comments on commit a0fa987

Please sign in to comment.