{{ message }}
9 |{{ message }}
10 |├── nodemon.json ├── routes ├── doc.js ├── auth.js ├── stats.js ├── log.js ├── checkin.js ├── index.js ├── review.js ├── revision.js ├── datasource.js ├── tag.js ├── local.js └── user.js ├── views ├── error.html ├── tag │ ├── post.html │ ├── delete.html │ ├── get_id.html │ ├── get.html │ └── put.html ├── user │ ├── delete_all.html │ ├── delete.html │ ├── get.html │ ├── get_id.html │ ├── post.html │ └── put.html ├── revision │ ├── post.html │ ├── delete.html │ ├── put.html │ ├── get.html │ └── get_id.html ├── local │ ├── delete.html │ ├── get_light.html │ ├── get.html │ ├── get_id.html │ ├── post.html │ └── put.html ├── review │ ├── delete.html │ ├── post.html │ ├── get.html │ └── get_id.html ├── auth │ └── token.html ├── checkin │ ├── get.html │ ├── get_id.html │ └── post.html ├── layout.html ├── log │ └── get_id.html └── index.html ├── models ├── datasource.js ├── revision.js ├── checkin.js ├── tag.js ├── log.js ├── review.js ├── index.js ├── local.js └── user.js ├── src ├── javascripts │ └── main.js └── stylesheets │ ├── api.css │ └── normaset.css ├── bin └── www ├── config ├── config.json └── acl.json ├── controllers ├── StatsController.js ├── LogController.js ├── CheckinController.js ├── TagController.js ├── RevisionController.js ├── DataSourceController.js ├── ReviewController.js ├── AuthController.js ├── UserController.js └── LocalController.js ├── .gitignore ├── migrations ├── 20180206012509-create-data-source.js ├── 20170901010554-AddGoogleIdFieldToUser.js ├── 20161208165149-ColumnRole.js ├── 20161228195938-ColumnMethod.js ├── 20161228203042-ColumnIpOrigin.js ├── 20180205030357-AddIsPaidToLocal.js ├── 20170116180926-ColumnAuthorIP.js ├── 20170816041815-AddColumnUserIdToReview.js ├── 20170903052706-AddIsCoveredToLocal.js ├── 20180205030240-AddSlotsToLocal.js ├── 20170812221223-AddColumnUserIDToReview.js ├── 20180206014552-AddSourceIdToLocal.js ├── 20171120192818-AddViewsToLocal.js ├── 20161127140133-unnamed-migration.js ├── 20170811230516-CreateColumnsEmailAndFacebookID.js ├── 20170812005551-ChangeNotNullColumnsForUsers.js └── 20171213000916-AddCityStateToLocal.js ├── tests └── unit │ └── controllers │ ├── TagController_test.js │ └── AuthController_test.js ├── .travis.yml ├── README.md ├── gulpfile.js ├── LICENSE ├── package.json ├── app.js └── public └── stylesheets └── all.min.css /nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "restartable": "rs", 3 | "ignore": [ 4 | ".git", 5 | "*.md", 6 | "coverage", 7 | "node_modules/*", 8 | "public/", 9 | "src/*" 10 | ], 11 | "verbose": true, 12 | "ext": "js html" 13 | } 14 | -------------------------------------------------------------------------------- /routes/doc.js: -------------------------------------------------------------------------------- 1 | let express = require('express') 2 | let router = express.Router() 3 | 4 | router.get('/', function (request, response) { 5 | response.render('index', {title: 'bike de boa API'}) 6 | }) 7 | 8 | module.exports = router 9 | -------------------------------------------------------------------------------- /views/error.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html' %} 2 | 3 | {% block title %}{{ message }}{% endblock %} 4 | 5 | {% block content %} 6 | 7 |
{{ message }}
10 |
9 | {
10 | "name": "Iluminado"
11 | }
12 |
13 |
9 | {
10 | "message": "Deleted successfully"
11 | }
12 |
13 |
9 | {
10 | "local_id": 10,
11 | "comments": "Message for revision"
12 | }
13 |
14 | _id | String | Tag's _id
9 | 10 |
12 | {
13 | "message": "Deleted successfully"
14 | }
15 |
16 | _id | String | Local's _id
9 | 10 |
12 | {
13 | "message": "Deleted successfully"
14 | }
15 |
16 | _id | String | User's _id
9 | 10 |
12 | {
13 | "message": "Deleted successfully"
14 | }
15 |
16 | _id | String | Review's _id
9 | 10 |
12 | {
13 | "message": "Deleted successfully"
14 | }
15 |
16 | _id | String | Revision's _id
9 | 10 |
12 | {
13 | "message": "Deleted successfully"
14 | }
15 |
16 |
9 | {
10 | username: '',
11 | password: ''
12 | }
13 |
14 |
15 |
17 | {
18 | token: ''
19 | }
20 |
21 |
9 | [
10 | {
11 | "id": 1,
12 | "fullname": "John",
13 | "username": "john",
14 | "createdAt": "2016-11-07T00:19:04.459Z",
15 | "updatedAt": "2016-11-07T00:19:04.459Z"
16 | }
17 | ]
18 |
19 | _id | String | Tag's _id
9 | 10 |
12 | {
13 | "id": 1,
14 | "name": "Iluminado",
15 | "createdAt": "2016-11-08T14:56:40.207Z",
16 | "updatedAt": "2016-11-08T14:56:40.207Z"
17 | }
18 |
19 |
9 | [
10 | {
11 | "id": 1,
12 | "date": "2016-11-30T00:00:00.000Z",
13 | "hour": "10:45:56",
14 | "createdAt": "2016-11-30T12:45:56.046Z",
15 | "updatedAt": "2016-11-30T12:45:56.046Z",
16 | "local_id": 1
17 | }
18 | ]
19 |
20 | _id | String | User's _id
9 | 10 |
12 | {
13 | "id": 1,
14 | "fullname": "John",
15 | "username": "john",
16 | "createdAt": "2016-11-07T00:19:04.459Z",
17 | "updatedAt": "2016-11-07T00:19:04.459Z"
18 | }
19 |
20 | _id | String | Checkin's _id
9 | 10 |
12 | {
13 | "id": 1,
14 | "date": "2016-11-30T00:00:00.000Z",
15 | "hour": "10:45:56",
16 | "createdAt": "2016-11-30T12:45:56.046Z",
17 | "updatedAt": "2016-11-30T12:45:56.046Z",
18 | "local_id": 1
19 | }
20 |
21 |
9 | [
10 | {
11 | "id": 1,
12 | "name": "Iluminado",
13 | "createdAt": "2016-11-08T14:56:40.207Z",
14 | "updatedAt": "2016-11-08T14:56:40.207Z"
15 | },
16 | {
17 | "id": 2,
18 | "name": "Movimentado",
19 | "createdAt": "2016-11-08T14:57:19.407Z",
20 | "updatedAt": "2016-11-08T14:57:51.586Z"
21 | }
22 | ]
23 |
24 |
9 | {
10 | "fullname": "John",
11 | "username": "john",
12 | "password": "#######",
13 | "role": "colaborator"
14 | }
15 |
16 |
17 |
19 | {
20 | "fullname": "John",
21 | "username": "john",
22 | "role": "colaborator"
23 | }
24 |
25 | _id | String | Users's _id
9 | 10 |
12 | {
13 | "fullname": "John",
14 | "username": "john",
15 | "password": "#######"
16 | }
17 |
18 |
19 |
21 | {
22 | "fullname": "John",
23 | "username": "john"
24 | }
25 |
26 |
9 | {
10 | "local_id": 1
11 | }
12 |
13 |
14 |
16 | {
17 | "id": 1,
18 | "date": "2016-11-30T00:00:00.000Z",
19 | "hour": "10:45:56",
20 | "createdAt": "2016-11-30T12:45:56.046Z",
21 | "updatedAt": "2016-11-30T12:45:56.046Z",
22 | "local_id": 1
23 | }
24 |
25 | _id | String | Tag's _id
9 | 10 |
12 | {
13 | "name": "Iluminado"
14 | }
15 |
16 |
17 |
19 | {
20 | "id": 1,
21 | "name": "Iluminado",
22 | "createdAt": "2016-11-08T14:56:40.207Z",
23 | "updatedAt": "2016-11-08T14:56:40.207Z"
24 | }
25 |
26 |
9 | [
10 | {
11 | "average": "4.0000000000000000"
12 | "id": 931
13 | "isPublic": true
14 | "lat": "-30.037464"
15 | "lng": "-51.212618"
16 | "photo": "https://s3.amazonaws.com/bikedeboa/images/931.jpeg"
17 | "reviews": "1"
18 | "structureType": "deroda"
19 | "text": "Academia da Redenção"
20 | }
21 | ]
22 |
23 | _id | String | Revision's _id
9 | 10 |
12 | {
13 | "comments": "Message for revision"
14 | }
15 |
16 |
17 |
19 | {
20 | "id": 1,
21 | "local_id": 10,
22 | "comments": "Message for revision",
23 | "createdAt": "2016-11-08T14:56:40.207Z",
24 | "updatedAt": "2016-11-08T14:56:40.207Z"
25 | }
26 |
27 |
9 | {
10 | "rating": 3,
11 | "idLocal": 1123,
12 | "Tags": [
13 | {
14 | "id": 1,
15 | }
16 | ]
17 | }
18 |
19 |
20 |
22 | {
23 | "rating": 3,
24 | "hour": "16:35:28",
25 | "date": "2016-11-26T00:00:00.000Z",
26 | "idLocal": 1123,
27 | "Tags": [
28 | {
29 | "id": 1,
30 | }
31 | ]
32 | }
33 |
34 |
9 | [
10 | {
11 | "id": 53,
12 | "rating": 3,
13 | "hour": "16:35:28",
14 | "date": "2016-11-26T00:00:00.000Z",
15 | "createdAt": "2016-11-26T16:35:28.768Z",
16 | "updatedAt": "2016-11-26T16:35:28.768Z",
17 | "idLocal": 1123,
18 | "Tags": [
19 | {
20 | "id": 1,
21 | "name": "Iluminado",
22 | "createdAt": "2016-11-08T14:56:40.207Z",
23 | "updatedAt": "2016-11-08T14:56:40.207Z",
24 | "Review_Tags": {
25 | "createdAt": "2016-11-26T16:35:29.091Z",
26 | "updatedAt": "2016-11-26T16:35:29.091Z",
27 | "review_id": 53,
28 | "tag_id": 1
29 | }
30 | }
31 | ]
32 | }
33 | ]
34 |
35 |
9 | [
10 | {
11 | "address": "Largo Prof. Francisco de Paula Brochado Rocha - Farroupilha, Porto Alegre - RS, 90040-080, Brasil"
12 | "average": "4.0000000000000000"
13 | "checkins": "0"
14 | "createdAt": "2016-11-19T14:23:55.454Z"
15 | "description": "Perto do parquinho das crianças e do café."
16 | "id": 921
17 | "isPublic": true
18 | "lat": "-30.0358392"
19 | "lng": "-51.2178544"
20 | "photo": "https://s3.amazonaws.com/bikedeboa/images/921.jpeg"
21 | "reviews": "1"
22 | "structureType": "deroda"
23 | "text": "Redenção"
24 | "updatedAt": "2016-12-17T19:43:23.982Z"
25 | }
26 | ]
27 |
28 | _page | String | Log's _page
9 | 10 |
12 | {
13 | "result": [
14 | {
15 | "id": 1,
16 | "user": "pedro",
17 | "role": "admin",
18 | "endpoint": "http://url.com/local",
19 | "body": {},
20 | "method": "GET",
21 | "createdAt": "2016-12-23T18:30:44.618Z",
22 | "updatedAt": "2016-12-23T18:30:44.618Z"
23 | },
24 | {
25 | "id": 2,
26 | "user": "pedro",
27 | "role": "colaborator",
28 | "endpoint": "http://url.com/local",
29 | "body": {},
30 | "method": "GET",
31 | "createdAt": "2016-12-23T18:33:15.053Z",
32 | "updatedAt": "2016-12-23T18:33:15.053Z"
33 | }
34 | ],
35 | "count": 2,
36 | "pages": 1
37 | }
38 |
39 | _id | String | Local's _id
9 | 10 |
12 | {
13 | "id": 1123,
14 | "lat": "-30.037524579889894",
15 | "lng": "-51.2110917075396",
16 | "structureType": "deroda",
17 | "isPublic": true,
18 | "text": "Prato Verde",
19 | "photo": "https://s3.amazonaws.com/bikedeboa/images/1123.jpeg",
20 | "description": "Próximo a garagem",
21 | "address": "Rua Santa Terezinha, 50 - Farroupilha, Porto Alegre - RS, 90040-180, Brasil",
22 | "reviews": "1",
23 | "average": "5.000000",
24 | "tags": [
25 | {
26 | "name": "Fácil acesso",
27 | "count": "1"
28 | },
29 | {
30 | "name": "Iluminado",
31 | "count": "1"
32 | },
33 | {
34 | "name": "Movimentado",
35 | "count": "1"
36 | }
37 | ]
38 | }
39 |
40 | _id | String | Review's _id
9 | 10 |
12 | [
13 | {
14 | "id": 53,
15 | "rating": 3,
16 | "hour": "16:35:28",
17 | "date": "2016-11-26T00:00:00.000Z",
18 | "createdAt": "2016-11-26T16:35:28.768Z",
19 | "updatedAt": "2016-11-26T16:35:28.768Z",
20 | "idLocal": 1123,
21 | "Tags": [
22 | {
23 | "id": 1,
24 | "name": "Iluminado",
25 | "createdAt": "2016-11-08T14:56:40.207Z",
26 | "updatedAt": "2016-11-08T14:56:40.207Z",
27 | "Review_Tags": {
28 | "createdAt": "2016-11-26T16:35:29.091Z",
29 | "updatedAt": "2016-11-26T16:35:29.091Z",
30 | "review_id": 53,
31 | "tag_id": 1
32 | }
33 | }
34 | ]
35 | }
36 | ]
37 |
38 |
9 | [
10 | {
11 | "id": 2,
12 | "comments": "Teste",
13 | "createdAt": "2016-12-29T21:51:00.540Z",
14 | "updatedAt": "2016-12-29T21:51:00.540Z",
15 | "local_id": 921,
16 | "Local": {
17 | "id": 921,
18 | "lat": "-30.0358392",
19 | "lng": "-51.2178544",
20 | "structureType": "deroda",
21 | "isPublic": true,
22 | "text": "Redenção",
23 | "photo": "url",
24 | "description": "Perto do parquinho das crianças e do café.",
25 | "address": "Largo Prof. Francisco de Paula Brochado Rocha - Farroupilha, Porto Alegre - RS, 90040-080, Brasil",
26 | "createdAt": "2016-11-19T14:23:55.454Z",
27 | "updatedAt": "2016-12-17T19:43:23.982Z"
28 | }
29 | }
30 | ]
31 |
32 | _id | String | Revision's _id
9 | 10 |
12 | {
13 | "id": 2,
14 | "comments": "Teste",
15 | "createdAt": "2016-12-29T21:51:00.540Z",
16 | "updatedAt": "2016-12-29T21:51:00.540Z",
17 | "local_id": 921,
18 | "Local": {
19 | "id": 921,
20 | "lat": "-30.0358392",
21 | "lng": "-51.2178544",
22 | "structureType": "deroda",
23 | "isPublic": true,
24 | "text": "Redenção",
25 | "photo": "url",
26 | "description": "Perto do parquinho das crianças e do café.",
27 | "address": "Largo Prof. Francisco de Paula Brochado Rocha - Farroupilha, Porto Alegre - RS, 90040-080, Brasil",
28 | "createdAt": "2016-11-19T14:23:55.454Z",
29 | "updatedAt": "2016-12-17T19:43:23.982Z"
30 | }
31 | }
32 |
33 |
9 | {
10 | "lat": "-30.037524579889894",
11 | "lng": "-51.2110917075396",
12 | "structureType": "deroda",
13 | "isPublic": true,
14 | "text": "Prato Verde",
15 | "photo": (blob64),
16 | "authorIP": "199.199.99.9",
17 | "description": "Próximo a garagem.",
18 | "address": "Rua Santa Terezinha, 50 - Farroupilha, Porto Alegre - RS, 90040-180, Brasil"
19 | }
20 |
21 |
22 |
24 | {
25 | "id": 1123,
26 | "lat": "-30.037524579889894",
27 | "lng": "-51.2110917075396",
28 | "structureType": "deroda",
29 | "isPublic": true,
30 | "text": "Prato Verde",
31 | "photo": "https://s3.amazonaws.com/bikedeboa/images/1123.jpeg",
32 | "authorIP": "199.199.99.9",
33 | "description": "Próximo a garagem.",
34 | "address": "Rua Santa Terezinha, 50 - Farroupilha, Porto Alegre - RS, 90040-180, Brasil",
35 | "reviews": "0",
36 | "checkins": "0",
37 | "tags": []
38 | }
39 |
40 | _id | String | Local's _id
9 | 10 |
12 | {
13 | "id": "1123",
14 | "lat": "-30.037524579889894",
15 | "lng": "-51.2110917075396",
16 | "structureType": "deroda",
17 | "isPublic": true,
18 | "text": "Prato Verde",
19 | "photo": (blob64),
20 | "description": "Próximo a garagem",
21 | "address": "Rua Santa Terezinha, 50 - Farroupilha, Porto Alegre - RS, 90040-180, Brasil",
22 | "photoUrl": "(url photo update)"
23 | }
24 |
25 |
26 |
28 | {
29 | "lat": "-30.037524579889894",
30 | "lng": "-51.2110917075396",
31 | "structureType": "deroda",
32 | "isPublic": true,
33 | "text": "Prato Verde",
34 | "photo": "https://s3.amazonaws.com/bikedeboa/images/1123.jpeg",
35 | "description": "Próximo a garagem.",
36 | "address": "Rua Santa Terezinha, 50 - Farroupilha, Porto Alegre - RS, 90040-180, Brasil",
37 | "tags": [
38 | {
39 | "name": "Espaçoso",
40 | "count": "1"
41 | },
42 | {
43 | "name": "Fácil acesso",
44 | "count": "1"
45 | },
46 | {
47 | "name": "Movimentado",
48 | "count": "1"
49 | }
50 | ]
51 | }
52 |
53 |