<commit_before><commit_msg>docs: create the api doc file<commit_after># Documentation

The Friends Bet API is a RESTful API based on [Sails.js](http://sailsjs.org/).

## Authentication

ToDo

## Resources

**Find records:**
 - *GET /matches*: Get the matches list (limited to 30 elements)
 - *GET /matches?pool=A*: Get the pool A matches list
 - *GET /matches?where={"venue":{"contains":"Twickenham"}}*: Get a matches list that take place at Twickenham
 - *GET /matches?where={"kickOffAt":{">":2015-09-30}}*: Get the matches that happen after September 30
 - *GET /matches?sort=kickOffAt%20DESC*: Get the matches in descending order
 - *GET /matches?limit=10*: Just get a list of 10 matches
 - *GET /matches?skip=10*: Skip 10 matches
 - *GET /matches?populate=[teamA]*: Get the matches with more informations about one of the Team
 - *GET /matches/<id>*: Get a precise match
 - *GET /matches/<id>/teamB*: Get a Team in a match

You can find more informations on [Sails docs](http://sailsjs.org/#!/documentation/reference/blueprint-api).

### Bet

 - *GET /bets*

**Description**

Get a list of bets.

**Attributes**

| Name       | Description             | Type    | Example | Default | Required | Unique |
|------------|-------------------------|---------|---------|---------|----------|--------|
| scoreTeamA | The score bet on Team A | integer | 15      |         | Yes      | No     |
| scoreTeamB | The score bet on Team B | integer | 7       |         | Yes      | No     |

**Associated resources**

| Name  | Description                 | Type     | Model | Required |
|-------|-----------------------------|----------|-------|----------|
| match | The Match concerned         | Instance | Match | Yes      |
| user  | The User who's done the Bet | Instance | User  | Yes      |

### Group

 - *GET /groups*

**Description**

Get a list of groups.

**Attributes**

| Name        | Description                                  | Type    | Example                                                                    | Default | Required | Unique |
|-------------|----------------------------------------------|---------|----------------------------------------------------------------------------|---------|----------|--------|
| name        | The Group name                               | string  | "The Friends Bet group"                                                    |         | Yes      | Yes    |
| score       | The cumulative score of this Group           | integer | 1024                                                                       | 0       | No       | No     |
| description | Everything you need to know about this group | string  | "The England national rugby union team represents England in rugby union." |         | No       | No     |

**Associated resources**

| Name    | Description            | Type     | Model | Required |
|---------|------------------------|----------|-------|----------|
| admin   | The admin of the Group | Instance | User  | Yes      |
| members | The list of members    | List     | User  | No       |

### Match

 - *GET /matches*

**Description**

Get a list of matches.

**Attributes**

| Name       | Description                          | Type     | Example                    | Default | Required | Unique |
|------------|--------------------------------------|----------|----------------------------|---------|----------|--------|
| kickOffAt  | The kick off in UTC                  | datetime | "2015-09-18T20:00:00.000Z" |         | Yes      | No     |
| stopBetsAt | When the User can't bet anymore      | datetime | "2015-09-18T20:00:00.000Z" |         | Yes      | No     |
| venue      | The location                         | string   | "Twickenham, London"       |         | Yes      | No     |
| importance | The importance coefficient           | float    | 1.5                        | 1.0     | No       | No     |
| scoreTeamA | The team A score                     | integer  | 15                         | 0       | No       | No     |
| scoreTeamB | The team B score                     | integer  | 7                          | 0       | No       | No     |
| pool       | The pool name during the group stage | string   | "A"                        |         | No       | No     |

**Associated resources**

| Name  | Description     | Type     | Model | Required |
|-------|-----------------|----------|-------|----------|
| teamA | The first Team  | Instance | Team  | Yes      |
| teamB | The second Team | Instance | Team  | Yes      |

### Team

 - *GET /teams*

**Description**

Get a list of teams.

**Attributes**

| Name        | Description                                 | Type   | Example                                                                    | Default | Required | Unique |
|-------------|---------------------------------------------|--------|----------------------------------------------------------------------------|---------|----------|--------|
| name        | The complete name of the Team               | string | "England"                                                                  |         | Yes      | Yes    |
| slug        | A slug is a short name given to a Team      | string | "eng"                                                                      |         | Yes      | Yes    |
| description | Everything you need to know about this team | string | "The England national rugby union team represents England in rugby union." |         | No       | No     |

**Associated resources**

| Name           | Description                                         | Type | Model | Required |
|----------------|-----------------------------------------------------|------|-------|----------|
| matchesAsTeamA | The Matches list associated with this Team as teamA | List | Match | No       |
| matchesAsTeamB | Same thing as teamB                                 | List | Match | No       |

### User

 - *GET /users*

**Description**

Get a list of users.

**Attributes**

| Name        | Description                          | Type   | Example             | Default | Required | Unique |
|-------------|--------------------------------------|--------|---------------------|---------|----------|--------|
| email       | The email adress of the User         | string | "<EMAIL>"     |         | Yes      | Yes    |
| firstName   | The first name of the User           | string | "John"              |         | Yes      | No     |
| lastName    | His/Her last name                    | string | "Snow"              |         | Yes      | No     |
| description | Everything the User want you to know | string | "King of the North" |         | No       | No     |

**Associated resources**

| Name   | Description                               | Type | Model | Required |
|--------|-------------------------------------------|------|-------|----------|
| bets   | The collection of the User Bets           | List | Bet   | No       |
| groups | The Groups in which the User participates | List | Group | No       |
{'fraction_non_alphanumeric': 0.2307474117146504, 'fraction_numerical': 0.010353141398383208, 'mean_word_length': 0.9881590076120665, 'pattern_counts': {'":': 4, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 39, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4830455', 'n_tokens_mistral': 1691, 'n_tokens_neox': 1570, 'n_words': 561}