You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 27, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+48-33Lines changed: 48 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,13 @@ The API for a better world. More information under [human-connection.org](https:
17
17
18
18
> **Note:** This is only the API part of Human-Connection, you have to also checkout the [WebApp](https://github.com/Human-Connection/WebApp) which uses this API.
19
19
20
-
## Development
20
+
## Local installation
21
21
22
22
> we recommand to install the project locally for the best development ease and performance
23
23
24
24
Getting up and running is as easy as 1, 2, 3, 4 ... 5.
25
25
26
-
1. Make sure you have [NodeJS](https://nodejs.org/), [yarn](https://yarnpkg.com),[mongoDB](https://www.mongodb.com/download-center#community) installed.
26
+
1. Make sure you have a recent version of [NodeJS](https://nodejs.org/), [yarn](https://yarnpkg.com) and[mongoDB](https://www.mongodb.com/download-center#community) installed.
27
27
28
28
2. Clone this repo
29
29
```bash
@@ -43,71 +43,86 @@ Getting up and running is as easy as 1, 2, 3, 4 ... 5.
43
43
```
44
44
45
45
5. Setup local mailserver (optional)
46
-
47
-
> **Note:**
46
+
47
+
> **Note:**
48
48
> *You only have to start that mailserver when you want to register, reset your password or test emails in any form, it
49
49
> does not affect the rest of the application.*
50
-
50
+
51
51
Install the [MailDev](https://github.com/djfarrelly/MailDev)
52
52
server to catch all sent emails in a nice web interface.
53
-
53
+
54
54
```bash
55
55
# install mail dev (only has to be done once)
56
56
$ yarn global add maildev
57
-
58
-
# start the server, it will output the web url
57
+
58
+
# start the server, it will output the web url
59
59
# which normally is http://localhost:1080
60
60
$ maildev
61
61
```
62
-
62
+
63
63
You could also insert your smtp credentials into the local.json but that is not recommended as all emails would be sent
64
64
to the given addresses which should not happen in development.
65
-
65
+
66
66
6. Start server
67
67
68
-
Make sure that the `data` folder exists according to the `mongod --dbpath` in `package.json` to write the data into, then start the server:
68
+
You don't have a background process running for mongodb?
69
+
Just open another terminal and run:
70
+
71
+
```bash
72
+
# open up another terminal and run:
73
+
$ yarn run mongo
74
+
# or if you are on windows, run:
75
+
$ yarn run mongo:win
76
+
```
77
+
78
+
Start the API server with the following commands:
69
79
```bash
70
-
# start mongodb, feathers and seed database
71
80
$ yarn dev
72
-
$ yarn dev:win if you're on windows
73
81
74
-
# start mongodb, feathers without seeding the database
75
-
$ yarn dev:noseed
76
-
77
-
# start mongodb, feathers for production
82
+
# without hot reload
78
83
$ yarn start
84
+
# you can customize the environment like this:
85
+
$ NODE_ENV=production yarn start
79
86
```
80
87
81
-
> ##### IMPORTANT for WIN users:
88
+
> ##### IMPORTANT for WIN users:
82
89
> - make sure you have mongo bin directory added to your PATH
83
-
> - if you picked another data directory during mongodb setup make sure
84
-
> to change package.json scripts section for key "dev:win" so it points to
85
-
> the proper path. Otherwise you will get missing data path errors from mongodb.
86
-
87
-
If you did it right it will seed some fake data for you and downloads some images and avatar for faster development.
88
-
Now you should be able to list some post at [http://localhost:3030/contributions](http://localhost:3030/contributions)
90
+
91
+
Now, your API should be running at [http://localhost:3030](http://localhost:3030).
92
+
If you seeded your database, you will see some contributions at [http://localhost:3030/contributions](http://localhost:3030/contributions).
89
93
90
94
7. Setup and Start Thumbnail Service (optional)
91
95
92
96
We are using [Thumbor](https://github.com/thumbor/thumbor) as a Thumbnail Microservice.
93
97
You can install it locally if you like but this is totally optional.
94
-
98
+
95
99
**Install OR use docker**
96
-
100
+
97
101
- At first you have to [install](http://thumbor.readthedocs.io/en/latest/installing.html) it locally and start it in the console with `thumbor`**OR** run it with docker `docker run -p 8000:8000 apsl/thumbor`
98
102
- Set the `thumbor.url` in `config/local.json` to `http://localhost:8888` (with docker `http://localhost:8000`) if not defined differently. The `thumbor.key` does not necessarily have to be defined, it just makes the URL more secure.
99
-
100
-
> Do not forget to always start it if you choose that setup or otherwise you will not see any pictures at all.
101
103
102
-
## Local configuration
104
+
> Do not forget to always start it if you choose that setup or otherwise you will not see any pictures at all.
103
105
104
-
If you need to configure anything you can do so inside the `config/local.json` file. For that the `config/local.example.json` will contain always a minimal setup to get it working.
106
+
### Local configuration
105
107
106
-
E.g. if you want to change listen address, port or URL, you can do so. Entries in the `config/local.json` will override entries in the `config/default.json`.
108
+
You can override any default configuration in `config/local.json`. You can find
109
+
a list of availabe defaults in `config/default.json`.
110
+
See [node-config documentation](https://github.com/lorenwest/node-config/wiki/Configuration-Files)
111
+
for details.
107
112
108
113
## Testing
109
114
110
-
Simply run `yarn test` and all your tests in the `test/` directory will be run.
115
+
Run the entire test suite with:
116
+
```bash
117
+
yarn run test
118
+
```
119
+
120
+
If you want you can run specific tests:
121
+
```bash
122
+
yarn run mocha
123
+
yarn run cucumber
124
+
```
125
+
111
126
112
127
## Scaffolding
113
128
@@ -128,7 +143,7 @@ For more information on all the framework related things visit [docs.feathersjs.
128
143
129
144
The HC platform is documented in our [gitbook](https://www.gitbook.com/book/human-connection/documentation/) (work in progress).
0 commit comments