Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 742dbab

Browse files
Merge pull request #118 from Human-Connection/develop
[WIP] update with latest fixes and improvements
2 parents bf8218a + c482ff0 commit 742dbab

File tree

116 files changed

+2599
-1422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2599
-1422
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Authenticate '...'
13+
2. Post following data to endpoint '...'
14+
3. See error
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen
18+
19+
**Additional context**
20+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ lib-cov
1212

1313
# Coverage directory used by tools like istanbul
1414
coverage
15+
.nyc_output
1516

1617
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1718
.grunt
@@ -121,3 +122,4 @@ lib/
121122
rethinkdb_data
122123
.env
123124
/config/local.json
125+
package-lock.json

.travis.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,23 @@ jobs:
1818
script: true
1919
- stage: Build and Test
2020
script:
21-
- docker build -t humanconnection/api-feathers:alpha .
21+
- docker build -t humanconnection/api-feathers .
2222
- script:
23-
- cp ./config/local.example.json ./config/local.json
2423
- yarn install --frozen-lockfile --non-interactive
2524
- yarn add codacy-coverage
26-
- rm -Rf tmp
27-
- yarn eslint
28-
- NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha -- test/ --timeout=10000 --exit
25+
- yarn run eslint
26+
- cp config/cucumber.json config/local.json
27+
- yarn run test:coverage
2928
- cat ./coverage/lcov.info | codacy-coverage
30-
- rm ./config/local.json
3129

3230
after_success:
3331
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
3432
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
33+
docker tag humanconnection/api-feathers humanconnection/api-feathers:alpha;
3534
docker push humanconnection/api-feathers:alpha;
3635
fi
36+
- if [ $TRAVIS_BRANCH == "develop" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
37+
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
38+
docker tag humanconnection/api-feathers humanconnection/api-feathers:edge;
39+
docker push humanconnection/api-feathers:edge;
40+
fi

LICENSE.md

Lines changed: 21 additions & 175 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
<p align="center">
77
<a href="https://travis-ci.org/Human-Connection/API"><img src="https://img.shields.io/travis/Human-Connection/API/master.svg" alt="Build Status"></a>
8-
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-green.svg" "Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)" /></a>
8+
<a href="https://github.com/Human-Connection/WebApp/blob/develop/LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-green.svg" "MIT" /></a>
9+
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2FHuman-Connection%2FAPI?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2FHuman-Connection%2FAPI.svg?type=shield"/></a>
10+
<a href="https://discord.gg/NgVpvx9" alt="Discord Channel">
11+
<img src="https://img.shields.io/discord/443107904757694465.svg" alt="Discord" /></a>
912
</p>
1013

1114
# Human-Connection API
@@ -61,16 +64,18 @@ Getting up and running is as easy as 1, 2, 3, 4 ... 5.
6164
# start mongodb, feathers and seed database
6265
$ yarn dev
6366
$ yarn dev:win if you're on windows
67+
6468
# start mongodb, feathers without seeding the database
6569
$ yarn dev:noseed
70+
6671
# start mongodb, feathers for production
6772
$ yarn start
6873
```
6974
7075
> ##### IMPORTANT for WIN users:
7176
> - make sure you have mongo bin directory added to your PATH
7277
> - if you picked another data directory during mongodb setup make sure
73-
> to change package.json scripts section for key "dev-win" so it points to
78+
> to change package.json scripts section for key "dev:win" so it points to
7479
> the proper path. Otherwise you will get missing data path errors from mongodb.
7580
7681
If you did it right it will seed some fake data for you and downloads some images and avatar for faster development.
@@ -105,9 +110,6 @@ The seeder configuration has two properties:
105110
106111
Simply run `yarn test` and all your tests in the `test/` directory will be run.
107112
108-
> **Note:**
109-
> *At the moment there are some issues with linting while testing, but you can run the tests also with mocha run*
110-
111113
## Scaffolding
112114
113115
Feathers has a powerful command line interface. Here are a few things it can do:
@@ -129,6 +131,6 @@ The HC platform is documented in our [gitbook](https://www.gitbook.com/book/huma
129131
130132
## License
131133
132-
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="https://mirrors.creativecommons.org/presskit/buttons/80x15/svg/by-nc-sa.svg"/></a>
134+
Copyright (c) 2018 [Human-Connection.org](https://human-connection.org)
133135
134-
[Creative Commons (CC BY-NC-SA 4.0) License](https://creativecommons.org/licenses/by-nc-sa/4.0/) not for commercial use.
136+
Licensed under the [MIT](https://github.com/Human-Connection/WebApp/blob/develop/LICENSE.md) license.

config/cucumber.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"host": "localhost",
3+
"port": 3030,
4+
"baseURL": "http://localhost:3030",
5+
"frontURL": "http://localhost:3000",
6+
"smtpConfig": {
7+
"host": "0.0.0.0",
8+
"port": 1025,
9+
"ignoreTLS": true
10+
},
11+
"thumbor": {
12+
"url": "",
13+
"key": ""
14+
},
15+
"seeder": {
16+
"runOnInit": false,
17+
"dropDatabase": false
18+
},
19+
"defaultEmail": "[email protected]"
20+
}

config/local.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"seeder": {
1616
"runOnInit": true,
17-
"dropDatabase": true
17+
"dropDatabase": false
1818
},
1919
"defaultEmail": "[email protected]"
2020
}

config/test.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
"runOnInit": false,
66
"dropDatabase": false
77
},
8+
"smtpConfig": {
9+
"host": "0.0.0.0",
10+
"port": 1025,
11+
"ignoreTLS": true
12+
},
813
"mongodb": "mongodb://localhost:27017/hc_api_test"
914
}

features/api/post.feature

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Feature: Import a post from an organization and publish it in Human Connection
2+
As a user of human connection
3+
You would like to publish a post programmatically
4+
In order to automate things
5+
6+
7+
Background:
8+
Given the Human Connection API is up and running
9+
And there is a user in Human Connection with these credentials:
10+
| email | password |
11+
| user@example.com | 1234 |
12+
13+
Scenario: Get a JWT token
14+
When you send a POST request to "/authentication" with:
15+
"""
16+
{
17+
"email": "[email protected]",
18+
"password": "1234",
19+
"strategy": "local"
20+
}
21+
"""
22+
Then there is an access token in the response:
23+
"""
24+
{
25+
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyIsInR5cGUiOiJhY2Nlc3MifQ..."
26+
}
27+
"""
28+
29+
Scenario: Publish a post
30+
Given you are authenticated
31+
When you send a POST request to "/contributions" with:
32+
"""
33+
{
34+
"title": "Cool title",
35+
"content": "<p>A nice content</p>",
36+
"contentExcerpt": "Nice",
37+
"type": "post",
38+
"language": "de",
39+
"categoryIds": ["5ac7768f8d655d2ee6d48fe4"]
40+
}
41+
"""
42+
Then a new post is created

0 commit comments

Comments
 (0)