├── .gitbook
└── assets
│ ├── development_env (1).png
│ ├── development_env.png
│ ├── grafik (1).png
│ ├── grafik (2).png
│ ├── grafik.png
│ ├── hc-guide-2x.png
│ ├── overview_api3 (1).svg
│ ├── overview_api3.svg
│ ├── posts.png
│ ├── server_api_models_3 (1).svg
│ ├── server_api_models_3.svg
│ ├── test_production_env_docker (1).png
│ ├── test_production_env_docker.png
│ ├── tota11y-large.png
│ └── tota11y-small.png
├── .gitignore
├── README.md
├── SUMMARY.md
├── administration
├── README.md
└── mongo.md
├── architecture.md
├── assets
├── HC-Guide@2x.png
├── Server_API_Contributions.svg
├── Server_API_Models.svg
├── Server_API_Models_.svg
├── Server_API_Models_2.svg
├── Server_API_Models_3.svg
├── development_env.png
├── overview_api3.svg
├── overview_api_top_frame.svg
├── test_production_env_docker.png
└── tools
│ ├── tota11y-large.png
│ └── tota11y-small.png
├── book.json
├── contributing.md
├── environments
├── README.md
├── docker-test-production
│ ├── README.md
│ └── docker-configuration.md
└── local-development.md
├── features
├── README.md
├── bestoflists.md
├── chats.md
├── eventmanagement.md
├── knowledge-sharing.md
├── letstalk.md
├── modularui.md
├── organizations.md
├── postbuilder.md
├── procontra.md
├── projects.md
├── versus.md
└── voting.md
├── license.md
├── server-api
├── README.md
├── helpers.md
├── hooks.md
├── installation.md
├── middleware.md
├── models.md
├── node-modules.md
├── overview.md
└── services
│ ├── README.md
│ ├── badges
│ ├── README.md
│ └── model.md
│ ├── categories
│ ├── README.md
│ └── model.md
│ ├── comments
│ ├── README.md
│ └── model.md
│ ├── contributions
│ ├── README.md
│ └── model.md
│ ├── emotions
│ ├── README.md
│ └── model.md
│ ├── follows
│ ├── README.md
│ └── model.md
│ ├── organizations
│ ├── README.md
│ └── model.md
│ ├── projects
│ ├── README.md
│ └── model.md
│ └── users
│ ├── README.md
│ └── model.md
├── styles
└── website.css
└── web-app
├── README.md
├── accessibility.md
├── installation.md
└── internationalization.md
/.gitbook/assets/development_env (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/development_env (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/development_env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/development_env.png
--------------------------------------------------------------------------------
/.gitbook/assets/grafik (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/grafik (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/grafik (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/grafik (2).png
--------------------------------------------------------------------------------
/.gitbook/assets/grafik.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/grafik.png
--------------------------------------------------------------------------------
/.gitbook/assets/hc-guide-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/hc-guide-2x.png
--------------------------------------------------------------------------------
/.gitbook/assets/overview_api3.svg:
--------------------------------------------------------------------------------
1 |
684 |
--------------------------------------------------------------------------------
/.gitbook/assets/posts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/posts.png
--------------------------------------------------------------------------------
/.gitbook/assets/test_production_env_docker (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/test_production_env_docker (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/test_production_env_docker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/test_production_env_docker.png
--------------------------------------------------------------------------------
/.gitbook/assets/tota11y-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/tota11y-large.png
--------------------------------------------------------------------------------
/.gitbook/assets/tota11y-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/.gitbook/assets/tota11y-small.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Node rules:
2 | ## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
3 | .grunt
4 |
5 | ## Dependency directory
6 | ## Commenting this out is preferred by some people, see
7 | ## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git
8 | node_modules
9 |
10 | # Book build output
11 | _book
12 |
13 | # eBook build output
14 | *.epub
15 | *.mobi
16 | *.pdf
17 |
18 | # ide
19 | .idea
20 | .vscode
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | [](https://human-connection.org)
4 |
5 | [](https://discord.gg/6ub73U3)
6 |
7 | ## Human-Connection Documentation
8 |
9 | This is the documentation source of HC.
10 | You can read this Documentation under [docs.human-connection.org](https://docs.human-connection.org)
11 |
12 | Staging: [https://staging.human-connection.org/](https://staging.human-connection.org/) Please test here and look out for bugs.
13 |
14 | ### Help
15 |
16 | The HC platform and its setup is documented in our [docs](https://docs.human-connection.org/) \(work in progress\).
17 | You can get help here too: [Discord](https://discord.gg/6ub73U3)
18 |
19 | ### License
20 |
21 | Copyright \(c\) 2018 [Human-Connection.org](https://human-connection.org)
22 | Licensed under the [MIT](https://github.com/Human-Connection/WebApp/blob/develop/LICENSE.md) license.
23 |
24 |
--------------------------------------------------------------------------------
/SUMMARY.md:
--------------------------------------------------------------------------------
1 | # Table of contents
2 |
3 | * [Introduction](README.md)
4 | * [Server API](server-api/README.md)
5 | * [Overview](server-api/overview.md)
6 | * [Installation](server-api/installation.md)
7 | * [Helpers](server-api/helpers.md)
8 | * [Hooks](server-api/hooks.md)
9 | * [Middleware](server-api/middleware.md)
10 | * [Models](server-api/models.md)
11 | * [Services](server-api/services/README.md)
12 | * [Users](server-api/services/users/README.md)
13 | * [Model](server-api/services/users/model.md)
14 | * [Contributions](server-api/services/contributions/README.md)
15 | * [Model](server-api/services/contributions/model.md)
16 | * [Comments](server-api/services/comments/README.md)
17 | * [Model](server-api/services/comments/model.md)
18 | * [Categories](server-api/services/categories/README.md)
19 | * [Model](server-api/services/categories/model.md)
20 | * [Projects](server-api/services/projects/README.md)
21 | * [Model](server-api/services/projects/model.md)
22 | * [Organizations](server-api/services/organizations/README.md)
23 | * [Model](server-api/services/organizations/model.md)
24 | * [Badges](server-api/services/badges/README.md)
25 | * [Model](server-api/services/badges/model.md)
26 | * [Follows](server-api/services/follows/README.md)
27 | * [Model](server-api/services/follows/model.md)
28 | * [Emotions](server-api/services/emotions/README.md)
29 | * [Model](server-api/services/emotions/model.md)
30 | * [Node Modules](server-api/node-modules.md)
31 | * [Web APP](web-app/README.md)
32 | * [Installation](web-app/installation.md)
33 | * [Accessibility](web-app/accessibility.md)
34 | * [Internationalization](web-app/internationalization.md)
35 | * [Environments](environments/README.md)
36 | * [Docker: Test / Production](environments/docker-test-production/README.md)
37 | * [Docker Configuration](environments/docker-test-production/docker-configuration.md)
38 | * [Local: Development](environments/local-development.md)
39 | * [Architecture](architecture.md)
40 | * [Features](features/README.md)
41 | * [Post Builder](features/postbuilder.md)
42 | * [Administration](administration/README.md)
43 | * [MongoDB](administration/mongo.md)
44 | * [Contributing](contributing.md)
45 | * [License](license.md)
46 |
47 |
--------------------------------------------------------------------------------
/administration/README.md:
--------------------------------------------------------------------------------
1 | # Administration
2 |
3 | In our case, we're hosting a staging environment on [digital ocean](https://www.digitalocean.com/) and we're using a UI for docker orchestration, ie. rancher by [rancher labs](https://rancher.com/).
4 |
5 | The following tutorial assumes you have permissions to connect to a server (e.g. a digital ocean droplet) and you have sudo access as well as access to the UI of rancher.
6 |
7 |
--------------------------------------------------------------------------------
/administration/mongo.md:
--------------------------------------------------------------------------------
1 | # Setup mongo cluster
2 |
3 | First of all, start your mongo docker container in rancher with `command` parameter `--port 27017` (or anything which is *not* `--auth`, see below).
4 |
5 | Connect with your server via SSH and get the container id of the running mongo cluster:
6 | ```sh
7 | sudo docker ps
8 | ```
9 |
10 | Connect to the mongo client in the docker container
11 | ```
12 | sudo docker exec -it mongo
13 | ```
14 |
15 | Use the mongo client to setup authentication:
16 | ```sh
17 | use admin;
18 | # replace rootUserPassword with your own secure password
19 | db.createUser({user:"su", pwd:"rootUserPassword",roles:["root"]});
20 | db.auth("su", "rootUserPassword");
21 |
22 | # add external users with minimal required permissions for their corresponding tables
23 | use hc_api;
24 | # replace apiUserPassword with your own secure password
25 | db.createUser({user:"hc-api", pwd:"apiUserPassword",roles:["readWrite"]});
26 |
27 | use embed_api;
28 | # replace embedApiUserPassword with your own secure password
29 | db.createUser({user:"hc-embed-api", pwd:"embedApiUserPassword",roles:["readWrite"]});
30 |
31 | ```
32 |
33 | After creating one root user and the required external users we need to restart the mongo docker image with `command` parameter `--auth` to enforce authentication.
34 |
--------------------------------------------------------------------------------
/architecture.md:
--------------------------------------------------------------------------------
1 | # Architecture
2 |
3 | 
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/assets/HC-Guide@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/assets/HC-Guide@2x.png
--------------------------------------------------------------------------------
/assets/Server_API_Contributions.svg:
--------------------------------------------------------------------------------
1 |
190 |
--------------------------------------------------------------------------------
/assets/development_env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/assets/development_env.png
--------------------------------------------------------------------------------
/assets/overview_api3.svg:
--------------------------------------------------------------------------------
1 |
684 |
--------------------------------------------------------------------------------
/assets/overview_api_top_frame.svg:
--------------------------------------------------------------------------------
1 |
360 |
--------------------------------------------------------------------------------
/assets/test_production_env_docker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/assets/test_production_env_docker.png
--------------------------------------------------------------------------------
/assets/tools/tota11y-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/assets/tools/tota11y-large.png
--------------------------------------------------------------------------------
/assets/tools/tota11y-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/assets/tools/tota11y-small.png
--------------------------------------------------------------------------------
/book.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "include-codeblock",
4 | "ace",
5 | "asciinema-local",
6 | "asciinema",
7 | "html5-video",
8 | "expand-active-chapter",
9 | "-theme-faq",
10 | "fontsettings",
11 | "sharing",
12 | "sectionx",
13 | "katex",
14 | "terminal",
15 | "heading-anchors"
16 | ],
17 | "pluginsConfig": {
18 | "sectionx": {
19 | "tag": "b"
20 | },
21 | "terminal": {
22 | "copyButtons": false,
23 | "fade": false,
24 | "style": "ubuntu"
25 | }
26 | }
27 |
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/contributing.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Contents
4 |
5 | * [Introduction](contributing.md#Introduction)
6 | * [Components Overview](contributing.md#Components-Overview)
7 | * [Setup Development Environment](contributing.md#Setup-Developmen-Environment)
8 |
9 | ## Introduction
10 |
11 | You want to contribute to the Human-Connection project? Great! Just read on!
12 | Or are you still unsure how you could actually help? We've got you covered:
13 | Head over to Opensource.Guide - there's an article that tells a lot about the Why and [How to contribute to Open Source](https://opensource.guide/how-to-contribute/) .
14 |
15 |
16 |
17 | ## Components Overview
18 |
19 | Human-Connection is build on its two main components: the server API and the Web-App.
20 | Both are developed in separate repositories and can be run either locally or off a Docker image.
21 | The HC documentation is in its own repository as well.
22 |
23 |
24 |
25 | ## Get the code
26 |
27 | ### Clone the repositories
28 |
29 | To explore and make changes to the files in the repository, you may want to clone it to your local disk.
30 |
31 | You'll find them here on GitHub:
32 |
33 |
34 | > [Server API](https://github.com/Human-Connection/API)
35 | > [Web App](https://github.com/Human-Connection/WebApp)
36 | > [Documentation](https://github.com/Human-Connection/Documentation)
37 | >
38 | >
39 | >
40 | > ## Change the code
41 | >
42 | > If you see a problem, that you want to fix or know how to fix, feel free to create an issue in the corresponding repository. Issues that effect more than repository, should be created in the repository [Human-Connection](https://github.com/Human-Connection/Human-Connection) .
43 | >
44 | >
45 | >
46 | > ### Fork the code
47 | >
48 | > To change and commit the code, you will need to fork the repository, that you want to change files in, into your own GitHub.
49 | > You need to have a login to [GitHub](https://github.com), and you can register for free, if you haven't already.
50 | >
51 | > After that, you are able to clone this forked repository to your local system and begin to make changes in it.
52 | > Add, fix, change the code as you wish. To make it easier for everyone maintaining or reviewing your code, you are encouraged to consider the [Coding Styleguide](web-app/installation.md#styleguide).
53 | >
54 | > You can commit your changes to a new or to the same branch in your GitHub fork stating the issue number in the title, so it can easy be linked to by the repository owners, when it is ready to be merged.
55 | >
56 | >
57 | >
58 | > ## Test the code
59 | >
60 | > Unless you improve the documentation, you will want to test your changes . To do that, you need to setup the API and the Web App environments.
61 | >
62 | >
63 | > ### Setup Developer Environment
64 | >
65 | > There is a Docker and a local setup available for both parts - you are free to choose whatever you like:
66 | >
67 | > [Setup the API via Docker](https://docs.human-connection.org/server-api/installation.html#setup-the-api-via-docker)
68 | > [Setup the API locally](https://docs.human-connection.org/server-api/installation.html#setup-the-api-locally)
69 | > [Setup the Web App via Docker](https://docs.human-connection.org/web-app/installation.html#setup-the-web-app-via-docker)
70 | > [Setup the Web App locally](https://docs.human-connection.org/web-app/installation.html#setup-the-web-app-locally)
71 | >
72 | >
73 | >
74 | > ### Write test cases
75 | >
76 | > We are running tests with Travis CI.
77 | >
78 | >
79 | >
80 | > ### Ready to merge
81 | >
82 | > If your test cases work out, you can create a pull request, committing the changes you made to the HC repositories. The owners of this repository will then review the code and finally merge your contribution into the HC source.
83 |
84 |
--------------------------------------------------------------------------------
/environments/README.md:
--------------------------------------------------------------------------------
1 | # Environments
2 |
3 | For different purposes, the runtime environments can be setup differently.
4 |
5 | * [Docker: Test / Production](docker-test-production/)
6 | * [Local: Development](local-development.md)
7 |
8 |
--------------------------------------------------------------------------------
/environments/docker-test-production/README.md:
--------------------------------------------------------------------------------
1 | # Docker: Test / Production
2 |
3 | The components of the Human Connection runtime are configured to run in Docker containers.
4 |
5 | The Docker images are used for testing and production environments.
6 |
7 | Here's an overview:
8 |
9 | 
10 |
11 |
--------------------------------------------------------------------------------
/environments/docker-test-production/docker-configuration.md:
--------------------------------------------------------------------------------
1 | # Docker Configuration
2 |
3 | We are building Docker Images automatically from the API and WebApp master branches with Travis CI where we also run tests.
4 |
5 | ### ToDo's
6 |
7 | * [x] finish the docker env documentation for the API
8 | * [x] finish the doceker env documentation for the WebApp
9 | * [ ] Update Docker Compose Files
10 |
11 | ## API
12 |
13 | ### ENV Variables
14 |
15 | | ENV Var | Required | Default \(local\) | Description |
16 | | :--- | :--- | :--- | :--- |
17 | | HOST | ✓ | localhost | Host on which the api is running. |
18 | | PORT | ✓ | 3030 | Port on which the API Server is running. |
19 | | BASE\_URL | ✓ | [http://localhost:3030](http://localhost:3030) | Full API URL used for generating the Upload URL's. |
20 | | FRONT\_URL | ✓ | [http://localhost:3000](http://localhost:3000) | Full WebApp URL used in Emails. |
21 | | API\_SECRET | - | - | Used for the maintenance api toggle |
22 | | MONGO\_DB | ✓ | mongodb://localhost:27017/hc\_api | Connection URI used to connect to the Mongo Database. The credentials have to be included here on production. |
23 | | SMTP\_HOST | ✓ | localhost | SMTP Host used for sending emails from locale or an 3th party service. |
24 | | SMTP\_USER | ✓ | - | The SMTP User |
25 | | THUMBOR\_URL | - | - | Optional URL to the Thumbor Service which generates Thumbnails on the fly, chaches and serves them. |
26 | | THUMBOR\_KEY | _recommended for prod_ | - | The Thumbor Secret to prevent URL tempering. |
27 | | AUTH\_SECRET | ✓ | - | A Secret which is used to salt sensitive date like the passwords etc. |
28 | | EMAIL\_ADDRESS | ✓ | no-replay@human-connection.org | Email address used in outgoing emails. |
29 |
30 | ## WebApp
31 |
32 | ### ENV Variables
33 |
34 | | ENV Var | Required | Default \(locale\) | Description |
35 | | :--- | :--- | :--- | :--- |
36 | | BASE\_URL | ✓ | [http://localhost](http://localhost) | Full URL used for generating URL's |
37 | | HOST | ✓ | localhost | WebApp Server Host |
38 | | PORT | ✓ | 3000 | WebApp Server Port |
39 | | API\_HOST | ✓ | localhost | API Server Host |
40 | | API\_PORT | ✓ | 3030 | API Server Port |
41 | | SENTRY\_DNS\_PUBLIC | | | Logging Identifier used for debugging frontend and backend issues |
42 | | MAPBOX\_TOKEN | | | Mapbox access token |
43 | | RELEASE | | | Release Key which is replaced on build time to identify which issue affects which release |
44 |
45 |
--------------------------------------------------------------------------------
/environments/local-development.md:
--------------------------------------------------------------------------------
1 | # Local: Development
2 |
3 | For prerequisites and setup of API and frontend, please see those pages:
4 |
5 | * [Server API / Feathers](../server-api/installation.md)
6 | * [Frontend / Nuxt](../web-app/installation.md)
7 |
8 | Here's a graphical overview of how the components in the development environment are connected.
9 |
10 | 
11 |
12 |
--------------------------------------------------------------------------------
/features/README.md:
--------------------------------------------------------------------------------
1 | # Features
2 |
3 | This list gives you an brief overview of the networks features at it's core. This is kept rather non-technical and serves the purpose of reference when working on these. Once a feature is integrated it should be documented on the page referring that feature.
4 |
5 |
--------------------------------------------------------------------------------
/features/bestoflists.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/chats.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/eventmanagement.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/knowledge-sharing.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/letstalk.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/modularui.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/organizations.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/postbuilder.md:
--------------------------------------------------------------------------------
1 | # Post Builder
2 |
3 | Posts \(contributions\) can be build using the Quill editor or plain text. Each post can be filled with different content elements like embeds, videos, images, lists, paragraphs, headings, gallery, polls and many more.
4 |
5 | Current stage of the Feature: As of now we have 2 types of posts **post** and **can do** as shown in the image below. In the future we want to change this by moving "can do" to the list of content elements.
6 |
7 | 
8 |
9 | The Post builder should be easy to understand and work with for non-tech users. Quill is the current WYSIWYG editor implemented and it's toolbar can be customized.
10 |
11 |
--------------------------------------------------------------------------------
/features/procontra.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/projects.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/versus.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/features/voting.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Human-Connection/Documentation/cc71b8e9c58cdef4e5a0a10b24580bb1326cbe19/features/voting.md
--------------------------------------------------------------------------------
/license.md:
--------------------------------------------------------------------------------
1 | # License
2 |
3 | MIT License
4 |
5 | Copyright \(c\) 2018 Human-Connection
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \(the "Software"\), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 |
13 |
--------------------------------------------------------------------------------
/server-api/README.md:
--------------------------------------------------------------------------------
1 | # Server API
2 |
3 | The API for a better world. More information: [human-connection.org](https://human-connection.org)
4 |
5 | > **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.
6 |
7 | ## Framework
8 |
9 | This project uses [Feathers](http://feathersjs.com), an open source web framework for building modern real-time applications.
10 |
11 |
12 | You can find the API REST Documentation here:
13 | [https://documenter.getpostman.com/view/309658/human-connection-api/RVu7Dnmh\\#737e3ed1-d108-4f6a-a8d3-ec8aba326eff](https://documenter.getpostman.com/view/309658/human-connection-api/RVu7Dnmh#737e3ed1-d108-4f6a-a8d3-ec8aba326eff)
14 |
15 |
--------------------------------------------------------------------------------
/server-api/helpers.md:
--------------------------------------------------------------------------------
1 | # Helpers
2 |
3 | _Will be added soon_
4 |
5 |
--------------------------------------------------------------------------------
/server-api/hooks.md:
--------------------------------------------------------------------------------
1 | # Hooks
2 |
3 | _Will be added soon_
4 |
5 |
--------------------------------------------------------------------------------
/server-api/installation.md:
--------------------------------------------------------------------------------
1 | # Installation
2 |
3 | ## Setup the API via Docker
4 |
5 | ### Installation
6 |
7 | Make sure you have a recent version of [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/) installed on your system.
8 |
9 |
10 | If you have, clone the repo of Human Connection in a console(-window) by typing
11 |
12 | ```bash
13 | $ git clone https://github.com/Human-Connection/API.git
14 | ```
15 | and change to its directory with
16 |
17 | ```bash
18 | $ cd API
19 | ```
20 | .
21 |
22 | The following command needs root-privileges, on Linux-Systems we strongly recommend the use of sudo, on Windows-Systems you will need admin-rights or you should use the LSS (Linux Sub System).
23 |
24 | Determine now the installed version, running
25 |
26 | ```bash
27 | $ sudo docker-compose up --build
28 | ```
29 | .
30 |
31 | Now, your API should be running at [http://localhost:3030](http://localhost:3030) and you can see some contributions at [http://localhost:3030/contributions](http://localhost:3030/contributions).
32 |
33 | For debugging you can run:
34 |
35 | ```bash
36 | $ docker-compose run --rm --service-ports api yarn run dev:debug
37 | ```
38 |
39 | And debug your app with [Chrome Dev Tools](chrome://inspect).
40 |
41 | ### Setting up the database seeder for local development
42 |
43 | Change configuration in `config/docker/local-development.json` or `config/docker/local.json` and rerun `docker-compose up --build`.
44 |
45 | If both the files do no exist create a `config/local.json` and copy the content of `config/local.example.json` and rerun `docker-compose up --build`.
46 |
47 | Reference : https://github.com/lorenwest/node-config/wiki/Configuration-Files
48 |
49 | #### Local Staging Environment
50 |
51 | To get an environment which is close to production, run the following:
52 |
53 | ```bash
54 | $ docker-compose -f docker-compose.yml -f docker-compose.staging.yml up --build
55 | ```
56 |
57 | ### Testing
58 |
59 | Run the entire test suite with:
60 |
61 | ```bash
62 | $ docker-compose run --rm api yarn run test
63 | ```
64 |
65 | If you want you can run specific tests:
66 |
67 | ```bash
68 | $ docker-compose run --rm api yarn run mocha
69 | $ docker-compose run --rm api yarn run cucumber
70 | ```
71 |
72 | ## Setup the API locally
73 |
74 | ### Getting Started
75 |
76 | > We recommend to install the project locally for the best development ease and performance.
77 | >For windows users we recommend that either you use the docker setup or the linux sub system on windows when setting up the API
78 |
79 | Getting up and running is as easy as 1, 2, 3, 4, 5 ... 6.
80 |
81 | 1. Make sure you have [NodeJS](https://nodejs.org/), [yarn](https://yarnpkg.com), [mongoDB](https://www.mongodb.com/download-center#community) installed.
82 | 2. Clone this repo
83 |
84 | ```bash
85 | $ git clone https://github.com/Human-Connection/API.git
86 | ```
87 |
88 | 3. Install your dependencies
89 |
90 | ```bash
91 | $ cd ./API
92 | $ yarn
93 | ```
94 |
95 | ##Setting up the database seeder for local development \(recommended\)
96 |
97 | Run
98 |
99 | ```bash
100 | $ cp config/local.example.json config/local.json
101 | ```
102 |
103 | or copy the content in config/local.example.json to config/local.json
104 |
105 | 4. Setup local mailserver \(optional\)
106 |
107 | > **Note:** _You only have to start that mailserver when you want to register, reset your password or test emails in any form, it does not affect the rest of the application._
108 |
109 | Install the [MailDev](https://github.com/djfarrelly/MailDev) server to catch all sent emails in a nice web interface.
110 |
111 | ```bash
112 | # install mail dev (only has to be done once)
113 | $ yarn global add maildev
114 |
115 | # start the server, it will output the web url
116 | # which normally is http://localhost:1080
117 | $ maildev
118 | ```
119 |
120 | You could also insert your smtp credentials into the local.json but that is not recommended as all emails would be sent to the given addresses which should not happen in development.
121 |
122 | 6. Start server
123 |
124 | You don't have a background process running for mongodb? Just open another terminal and run:
125 |
126 | ```bash
127 | # open up another terminal and run:
128 | $ yarn run mongo
129 | # or if you are on windows, run:
130 | $ yarn run mongo:win
131 | ```
132 |
133 | > **IMPORTANT for Windows users:**
134 | >
135 | > * make sure you have mongo bin directory added to your PATH
136 |
137 | Start the API server with the following commands:
138 |
139 | ```bash
140 | $ yarn dev
141 |
142 | # without hot reload
143 | $ yarn start
144 | # you can customize the environment like this:
145 | $ NODE_ENV=production yarn start
146 | ```
147 |
148 | Now, your API should be running at [http://localhost:3030](http://localhost:3030). If you seeded your database, you will see some contributions at [http://localhost:3030/contributions](http://localhost:3030/contributions).
149 |
150 | ### Local Configuration
151 |
152 | You can override any default configuration in `config/local.json`. You can find a list of availabe defaults in `config/default.json`. See [node-config documentation](https://github.com/lorenwest/node-config/wiki/Configuration-Files) for details.
153 |
154 | E.g. if you want to access the server from your mobile over WiFi, you should replace `localhost` in your settings with your IP address in the local network:
155 |
156 | ```javascript
157 | {
158 | "host": "192.168.188.22",
159 | "baseURL": "http://192.168.188.22:3030",
160 | "frontURL": "http://192.168.188.22:3000"
161 | }
162 | ```
163 |
164 | ### Local Testing
165 |
166 | Test Logins
167 |
168 | | Role | E-Mail | Password |
169 | | :--- | :--- | :--- |
170 | | Admin | test@test.de | 1234 |
171 | | Moderator | test2@test2.de | 1234 |
172 | | User | test3@test3.de | 1234 |
173 |
174 | Run the entire test suite with:
175 |
176 | ```bash
177 | $ yarn run test
178 | ```
179 |
180 | If you want you can run specific tests:
181 |
182 | ```bash
183 | $ yarn run mocha
184 | $ yarn run cucumber
185 | ```
186 |
187 | ## Scaffolding
188 |
189 | Feathers has a powerful command line interface. Here are a few things it can do:
190 |
191 | ```bash
192 | $ yarn global add feathers-cli # Install Feathers CLI
193 |
194 | $ feathers generate service # Generate a new Service
195 | $ feathers generate hook # Generate a new Hook
196 | $ feathers generate model # Generate a new Model
197 | $ feathers help # Show all commands
198 | ```
199 |
200 |
--------------------------------------------------------------------------------
/server-api/middleware.md:
--------------------------------------------------------------------------------
1 | # Middleware
2 |
3 | _Will be added soon_
4 |
5 |
--------------------------------------------------------------------------------
/server-api/models.md:
--------------------------------------------------------------------------------
1 | # Models
2 |
3 | _Will be added soon_
4 |
5 |
--------------------------------------------------------------------------------
/server-api/node-modules.md:
--------------------------------------------------------------------------------
1 | # Node Modules
2 |
3 | ## body-parser
4 |
5 | ### body parsing middleware
6 |
7 | Parse incoming request bodies in a middleware before your handlers, available under the `req.body` property.
8 |
9 | ## compression
10 |
11 | Returns the compression middleware using the given `options.` The middleware will attempt to compress response bodies for all request that traverse through the middleware, based on the given `options.`
12 |
13 | ## cors
14 |
15 | Cross-orign resource sharing between Browser and Server.
16 |
17 | ## crypto
18 |
19 | Providing encryption of sensitive data.
20 |
21 | ## crypto-js
22 |
23 | Library of crypto standards like sha256, hmac-sha512, enc-base64 ...
24 |
25 | ## dauria
26 |
27 | Provides conversions between Node.js-Buffers and rfc-standardized URIs
28 |
29 | ## email-templates
30 |
31 | Create, preview and send customizable email-templates with NodeJS
32 |
33 | ## feathers
34 |
35 | Feathers-framework for NodeJS
36 |
37 | > **Note on the Feathers Modules, they will be replaced by a new set after updating to Feathers Buzzard**
38 |
39 | ## feathers-authentication
40 |
41 | Adds shared PassportJS authentication for Feathers HTTP REST and WebSocket transports
42 |
43 | ## feathers-authentication-hooks
44 |
45 | Useful hooks for authentication and authorization like `queryWithCurrentUser`, `restrictToOwner`, `associateCurrentUser`, `restrictToRoles`, `hasRoleOrRestrict`
46 |
47 | ## feathers-authentication-jwt
48 |
49 | JWT \(JSON Web Tokens\) authentication strategy for feathers-authentication using Passport \(authentication middleware for node.js\)
50 |
51 | ## feathers-authentication-local
52 |
53 | Local authentication strategy for feathers-authentication using Passport without all the boilerplate.
54 |
55 | ## feathers-authentication-management
56 |
57 | Adds sign up verification, forgotten password reset, and other capabilities to local `feathers-authentication`.
58 |
59 | ## feathers-configuration
60 |
61 | A small configuration module for your Feathers application, using config-folder containing default.json, production.json ...
62 |
63 | ## feathers-errors
64 |
65 | Error handling mixin for Feathers apps.
66 |
67 | ## feathers-hooks
68 |
69 | Middleware for Feathers service methods \(included in module feathers starting with feathers v3\)
70 |
71 | ## feathers-hooks-common
72 |
73 | Useful hooks for use with Feathers services: Resolvers, Shaping the Result, Customize Resolver Operation, Calculated Fields, Recursive Operations, Keeping Resolvers DRY, Batch-loaders, Using a Persistent Cache, Populate and Validate
74 |
75 | ## feathers-logger
76 |
77 | just a simple wrapper for any logger so that you can conveniently do `app.log()`. There are 4 methods provided to use: info, warn, error, debug
78 |
79 | ## feathers-mailer
80 |
81 | Feathers mailer service using nodemailer.
82 |
83 | ## feathers-memory
84 |
85 | A Feathers service adapter for in-memory data storage that works on all platforms \(implements the Feathers Common database adapter API and querying syntax\).
86 |
87 | ## feathers-mongodb
88 |
89 | Create a MongoDB service for FeathersJS
90 |
91 | ## feathers-mongodb-fuzzy-search
92 |
93 | implements $search to mongodb service.find, update, patch and remove queries. Full-text search on documents with stemming as well as pattern matching on individual fields.
94 |
95 | ## feathers-mongoose
96 |
97 | A Feathers database adapter for Mongoose, an object modeling tool for MongoDB.
98 |
99 | ## feathers-rest
100 |
101 | This provider exposes Feathers services through a RESTful API using Express that can be used with Feathers 1.x and 2.x as well as client support for Fetch, jQuery, Request, Superagent, axios and angular2+'s HTTP Service. \(replaced by framework specific adapters for feathers v3 and later\)
102 |
103 | ## feathers-seeder
104 |
105 | enables you to fill your database \(specifically feathers-memory\) with needed fake data to test your application appropiately. You can launch your application with or without new seeded data.
106 |
107 | ## feathers-socketio
108 |
109 | allows you to call service methods and receive real-time events via Socket.io and can be used standalone or together with a Feathers framework integration like Express. This module adds the feathers-layer to Socket.io and eases the server- and client-usage of it.
110 |
111 | ## fs-blob-store
112 |
113 | filesystem storage module for blobs
114 |
115 | ## fs-extra
116 |
117 | adds file system methods that aren't included in the native fs-module and adds promise support to the fs-methods; drop in replacement for the fs-module including [these](https://github.com/jprichardson/node-fs-extra) methods.
118 |
119 | ## handlebars
120 |
121 | Templating engine for Email generation \(easing management of HTML content\)
122 |
123 | ## handlebars-layouts
124 |
125 | Layouts for Email Templates \(Handlebars helpers which implement layout blocks similar to Jade, Jinja, Nunjucks, Swig, and Twig.\)
126 |
127 | ## helmet
128 |
129 | Used for Security Settings like SSL Enforcing and other best practice headers \(Securing HTTP headers\)
130 |
131 | ## html-excerpt
132 |
133 | Creating short and truncated versions of content for previews \(Attempts to remove all HTML and then shortens the result according to the provided option.\)
134 |
135 | ## mongoose
136 |
137 | MongoDB object modeling tool, designed to work in an asyncronous environment. Models are defined through the Schema interface.
138 |
139 | ## multer
140 |
141 | Middleware to handle 'multipart/form-data', primarily used for uploading files \(not processing any form which is not multipart\)
142 |
143 | ## node-sass
144 |
145 | Node-sass is a library that provides binding for Node.js to [LibSass](https://github.com/sass/libsass), the C version of the popular stylesheet preprocessor, Sass. It allows you to natively compile .scss files to css at incredible speed and automatically via a connect middleware.
146 |
147 | ## raven
148 |
149 | JavaScript client for the [Sentry](https://sentry.io/welcome/) realtime event logging and aggregation platform.
150 |
151 | ## serve-favicon
152 |
153 | Middleware for serving a favicon \(caching, excluding favicon-log-messages\).
154 |
155 | ## shortid
156 |
157 | Short non-sequential url-friendly unique id generator.
158 |
159 | ## slug
160 |
161 | Creating URL friendly Slugs for the Content that are used as deep-links \(slugifies every string, even when it contains unicode \)
162 |
163 | ## wait-on
164 |
165 | Used for waiting for the MongoDB to start in development mode.
166 | \(wait-on is a cross-platform command line utility which will wait for files, ports, sockets, and http\(s\) resources to become available \(or not available using reverse mode\)\).
167 |
168 | ## winston
169 |
170 | Logging Framework. Can be used though app.error, app.debug, etc...
171 | \(A logger for just about everything \)
172 |
173 |
--------------------------------------------------------------------------------
/server-api/overview.md:
--------------------------------------------------------------------------------
1 | # Overview
2 |
3 | ## This is a graphical overview of the server api for your convenience.
4 |
5 | 
6 |
7 | 
8 |
9 |
--------------------------------------------------------------------------------
/server-api/services/README.md:
--------------------------------------------------------------------------------
1 | # Services
2 |
3 | The Human Connection Plattform consists of seperate services that can be split into seperate parts in a micoservice approach.
4 |
5 | > **Note:** When we split the services apart we have to make sure that the realtime events will be triggered correctly.
6 | >
7 | > It's also not done in the first step as we wanted to be able to build and deliver quickly with a really small team which fluctuate very strongly.
8 |
9 |
--------------------------------------------------------------------------------
/server-api/services/badges/README.md:
--------------------------------------------------------------------------------
1 | # Badges
2 |
3 | _Will be added soon_
4 |
5 |
--------------------------------------------------------------------------------
/server-api/services/badges/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | image: imageSchema,
8 | // may be temporary or some other status
9 | status: {
10 | type: String,
11 | enum: ['permanent', 'temporary'],
12 | default: 'permanent',
13 | required: true
14 | },
15 | // the type off the badge, e.g.
16 | // Crowdfounder badge is a one time forever badge
17 | // some badges are given got by an achivement
18 | // some badges given by events or they are a gift form an other user
19 | // some badges may be temporary like moderator badge
20 | type: { type: String, required: true },
21 | createdAt: { type: Date, default: Date.now },
22 | updatedAt: { type: Date, default: Date.now }
23 | }
24 | ```
25 |
26 |
--------------------------------------------------------------------------------
/server-api/services/categories/README.md:
--------------------------------------------------------------------------------
1 | # Categories
2 |
3 | _Will be added soon_
4 |
5 |
--------------------------------------------------------------------------------
/server-api/services/categories/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | title: { type: String, required: true },
8 | // Generated from title
9 | slug: { type: String, required: true, unique: true },
10 | icon: { type: String, unique: true },
11 | createdAt: { type: Date, default: Date.now },
12 | updatedAt: { type: Date, default: Date.now }
13 | }
14 | ```
15 |
16 |
--------------------------------------------------------------------------------
/server-api/services/comments/README.md:
--------------------------------------------------------------------------------
1 | # Comments
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/server-api/services/comments/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | userId: { type: String, required: true },
8 | contributionId: { type: String, required: true },
9 | content: { type: String, required: true },
10 | // Generated from content
11 | contentExcerpt: { type: String, required: true },
12 | upvotes: { type: Array, default: [] },
13 | upvoteCount: { type: Number, default: 0 },
14 | language: { type: String, required: true },
15 | createdAt: { type: Date, default: Date.now },
16 | updatedAt: { type: Date, default: Date.now },
17 | wasSeeded: { type: Boolean }
18 | }
19 | ```
20 |
21 |
--------------------------------------------------------------------------------
/server-api/services/contributions/README.md:
--------------------------------------------------------------------------------
1 | # Contributions
2 |
3 | The Contribution Service deals with posts, votes, etc.
4 |
5 | > **Question:** Should votes, pro cons, etc. be split of form contributions?
6 | >
7 | > In tearms of searchability etc. it might be easier to only search one service that contains all types of contributions!?
8 |
9 | ## Interaction
10 |
11 | * Comments
12 | * Let's Talk
13 | * Version
14 |
15 | ## More Info
16 |
17 | List all Contributions and Chatrooms that match the current Contribution.
18 |
19 | _The matching happens by Categories and Tags._
20 |
21 | * Posts
22 | * Can Do's
23 | * Bestlists
24 | * Pro / Cons
25 | * Votes
26 | * Chatrooms
27 |
28 | ## Take Action
29 |
30 | * Projects
31 | * Can Do's
32 | * Projects
33 | * Jobs
34 | * Events
35 | * Map
36 |
37 |
--------------------------------------------------------------------------------
/server-api/services/contributions/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | userId: { type: String, required: true },
8 | categoryIds: { type: Array },
9 | title: { type: String, required: true },
10 | slug: { type: String, required: true, unique: true }, // Generated from title
11 | type: { type: String, required: true },
12 | content: { type: String, required: true },
13 | contentExcerpt: { type: String, required: true }, // Generated from content
14 | teaserImg: { type: String },
15 | language: { type: String, required: true },
16 | visibility: {
17 | type: String,
18 | enum: ['public', 'friends', 'private'],
19 | default: 'public'
20 | },
21 | emotions: { type: Object }
22 | createdAt: { type: Date, default: Date.now },
23 | updatedAt: { type: Date, default: Date.now }
24 | }
25 | ```
26 |
27 |
--------------------------------------------------------------------------------
/server-api/services/emotions/README.md:
--------------------------------------------------------------------------------
1 | # Emotions
2 |
3 | This Service has not an own database or table but manages entries inside the contributions service. It does count the user votes on five different emotions related to a given contribution.
4 |
5 | > Note: At the moment this service is used as a hook but should and will be changed to behave more like the followers service.
6 |
7 | Todos
8 |
9 | * \[ \] Finish tests
10 |
11 |
--------------------------------------------------------------------------------
/server-api/services/emotions/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | userId: { type: String, required: true },
8 | contributionId: { type: String, required: true },
9 | rated: {
10 | type: String,
11 | required: true,
12 | enum: ['funny', 'happy', 'surprised', 'cry', 'angry']
13 | },
14 | createdAt: { type: Date, default: Date.now },
15 | updatedAt: { type: Date, default: Date.now },
16 | wasSeeded: { type: Boolean }
17 | }
18 | ```
19 |
20 |
--------------------------------------------------------------------------------
/server-api/services/follows/README.md:
--------------------------------------------------------------------------------
1 | # Follows
2 |
3 | This Service has not an own database or table but manages entries inside the following service \(currently only users\) and the followed service \(users, organizations, projects\)
4 |
5 | **GET /follows/$id**
6 |
7 | List all services that the service with the given id follows
8 |
9 | **POST /follows**
10 |
11 | The user with the userId follows the service with the followingId specified by the type.
12 |
13 | ```text
14 | {
15 | "userId": "5a042f57a40ed49f79a328fb",
16 | "followingId": "5a042f5ca40ed49f79a32900",
17 | "type": "users"
18 | }
19 | ```
20 |
21 | ## Todos {#todos}
22 |
23 | * \[ \] Finish tests
24 |
25 |
--------------------------------------------------------------------------------
/server-api/services/follows/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 |
8 | }
9 | ```
10 |
11 |
--------------------------------------------------------------------------------
/server-api/services/organizations/README.md:
--------------------------------------------------------------------------------
1 | # Organizations
2 |
3 | Organizations can be administrated by users and are displayed in the map and in the take action section.
4 |
5 |
--------------------------------------------------------------------------------
/server-api/services/organizations/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | name: { type: String, required: true },
8 | slug: { type: String },
9 | followerIds: [],
10 | categoryIds: { type: Array },
11 | logo: { type: String },
12 | userId: { type: String, required: true },
13 | description: { type: String, required: true },
14 | addresses: { type: Array, default: [] },
15 | content: { type: String, required: true },
16 | createdAt: { type: Date, default: Date.now },
17 | updatedAt: { type: Date, default: Date.now },
18 | wasSeeded: { type: Boolean }
19 | }
20 | ```
21 |
22 |
--------------------------------------------------------------------------------
/server-api/services/projects/README.md:
--------------------------------------------------------------------------------
1 | # Projects
2 |
3 | _Will be added soon_
4 |
5 |
--------------------------------------------------------------------------------
/server-api/services/projects/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | name: { type: String, required: true },
8 | slug: { type: String },
9 | followerIds: [],
10 | categoryIds: { type: Array },
11 | logo: { type: String },
12 | userId: { type: String, required: true },
13 | description: { type: String, required: true },
14 | content: { type: String, required: true },
15 | addresses: { type: Array, default: [] },
16 | createdAt: { type: Date, default: Date.now },
17 | updatedAt: { type: Date, default: Date.now },
18 | wasSeeded: { type: Boolean }
19 | }
20 | ```
21 |
22 |
--------------------------------------------------------------------------------
/server-api/services/users/README.md:
--------------------------------------------------------------------------------
1 | # Users
2 |
3 | The `foreignUser` is a `user` or `organization` that the `user` follows.
4 |
5 | _More information will follow shortly_
6 |
7 |
--------------------------------------------------------------------------------
/server-api/services/users/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | ## Schema
4 |
5 | ```javascript
6 | {
7 | email: {type: String, required: true, unique: true},
8 | password: { type: String },
9 | name: { type: String },
10 | slug: { type: String },
11 | gender: { type: String },
12 | followerIds: [],
13 | follows: [followsSchema],
14 | isnothere: { type: Boolean },
15 | timezone: { type: String },
16 | avatar: { type: String },
17 | coverImg: { type: String },
18 | doiToken: { type: String },
19 | confirmedAt: { type: Date },
20 | badgeIds: [],
21 | deletedAt: { type: Date },
22 | createdAt: { type: Date, default: Date.now },
23 | updatedAt: { type: Date, default: Date.now },
24 | // Needed for verification
25 | isVerified: { type: Boolean },
26 | role: {
27 | type: String,
28 | enum: ['admin', 'moderator', 'manager', 'editor', 'user'],
29 | default: 'user'
30 | },
31 | verifyToken: { type: String },
32 | verifyShortToken: { type: String },
33 | verifyExpires: { type: Date },
34 | verifyChanges: { type: Object },
35 | resetToken: { type: String },
36 | resetShortToken: { type: String },
37 | resetExpires: { type: Date },
38 | wasSeeded: { type: Boolean },
39 | wasInvited: { type: Boolean },
40 | language: { type: String, default: 'en' }
41 | }
42 | ```
43 |
44 |
--------------------------------------------------------------------------------
/styles/website.css:
--------------------------------------------------------------------------------
1 | /* CSS for website */
2 | .ace {
3 | margin-bottom: 20px;
4 | }
5 |
6 | img {
7 | margin-top: 3em;
8 | margin-bottom: 3em;
9 | }
10 |
11 | .panel-heading {
12 | /* padding: 0px 10px;*/
13 | }
14 |
15 | /* Sidebar background */
16 | .book .book-summary {
17 | background: #FFFFFF;
18 | }
19 |
20 | /* Sidebar Links */
21 | .book .book-summary nav ul.summary li a {
22 | font-size: 1em;
23 | color: #666666;
24 | }
25 |
26 | .book .book-summary nav ul.summary li a:hover, .book .book-summary nav ul.summary li a:focus {
27 | color: #222222;
28 | text-decoration: none;
29 | }
30 |
31 | .book .book-summary nav ul.summary li.active > a {
32 | color: #15A338;
33 | text-decoration: none;
34 | }
35 |
36 | /* Top level links */
37 | .book .book-summary nav ul.summary > li > a {
38 | font-size: 1.1em;
39 | }
40 |
41 | /* 2nd level headings */
42 | .book .book-summary nav ul.summary > li > ul > li > span {
43 | font-weight: 700;
44 | }
45 |
46 | .book .book-summary nav ul.summary > li > ul > li > ul {
47 | padding-left: 8px !important;
48 | }
49 |
50 | /* 3rd level menu items */
51 |
52 | .book .book-summary nav ul.summary ul.page-headings > li > a {
53 | padding: 5px 10px;
54 | font-size: 0.9em;
55 | }
56 |
57 | /* Sidebar Title */
58 | .book .book-summary ul.summary li a.custom-link {
59 | color: rgba(0, 0, 0, 0);
60 | background-image: url('../assets/HC-Guide@2x.png');
61 | background-size: 90%;
62 | background-repeat: no-repeat;
63 | margin: 10px;
64 | min-height: 100px;
65 | }
66 |
67 | .book .book-summary ul.summary li a.custom-link:hover {
68 | color: rgba(0, 0, 0, 0);
69 | background-size: 90%;
70 | background-repeat: no-repeat;
71 | margin: 10px;
72 | min-height: 100px;
73 | }
74 |
75 | /* Sidebar Version Dropdown */
76 | .versions-select select {
77 | /* styling */
78 | background-color: white;
79 | border: 2px solid #15a338;
80 | border-radius: 4px;
81 | display: inline-block;
82 | font: inherit;
83 | color: #666666;
84 | line-height: 1.5em;
85 | padding: 0.5em 3.5em 0.5em 1em;
86 | /* reset */
87 | margin: 0;
88 | -webkit-box-sizing: border-box;
89 | -moz-box-sizing: border-box;
90 | box-sizing: border-box;
91 | -webkit-appearance: none;
92 | -moz-appearance: none;
93 | /* Dropdown Arrow */
94 | background-image: linear-gradient(45deg, transparent 50%, gray 50%), linear-gradient(135deg, gray 50%, transparent 50%), linear-gradient(to right, #ccc, #ccc);
95 | background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px), calc(100% - 2.5em) 0.5em;
96 | background-size: 5px 5px, 5px 5px, 1px 1.5em;
97 | background-repeat: no-repeat;
98 | }
99 |
100 | .versions-select select:focus {
101 | outline: none;
102 | }
103 |
104 | .versions-select select:-moz-focusring {
105 | color: transparent;
106 | text-shadow: 0 0 0 #000;
107 | }
108 |
109 | /* Sepia and dark themes */
110 | /*.book.color-theme-1 .book-summary ul.summary li a.custom-link, .book.color-theme-2 .book-summary ul.summary li a.custom-link {
111 | background-image: url('../assets/linuxguide_me.png');
112 | }*/
113 |
114 | /* Title Links that pop up on hover */
115 | .book .book-body .page-wrapper .page-inner section.normal a.anchorjs-link {
116 | color: #15A338;
117 | }
118 |
119 | /* Main links */
120 | .book .book-body .page-wrapper .page-inner section.normal a {
121 | color: #26C693;
122 | }
123 |
124 | .book .book-body .page-wrapper .page-inner section.normal blockquote, .book .book-body .page-wrapper .page-inner section.normal dl, .book .book-body .page-wrapper .page-inner section.normal ol, .book .book-body .page-wrapper .page-inner section.normal p, .book .book-body .page-wrapper .page-inner section.normal table, .book .book-body .page-wrapper .page-inner section.normal ul {
125 | font-size: 1.8rem;
126 | color: #4A4A4A;
127 | }
128 |
129 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote, .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal dl, .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal ol, .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal p, .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table, .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal ul {
130 | color: #bdcadb;
131 | }
132 |
133 | /* Block Quotes */
134 | .book .book-body .page-wrapper .page-inner section.normal blockquote {
135 | border: 2px solid #E4E4E4;
136 | padding: 15px;
137 | border-radius: 10px;
138 | }
139 |
140 | .book .book-body .page-wrapper .page-inner section.normal blockquote strong {
141 | color: #15A338;
142 | }
143 |
144 | .book .book-body .page-wrapper .page-inner section.normal blockquote p {
145 | margin: 0;
146 | }
147 |
148 | /* Page Titles */
149 | .book .book-body .page-wrapper .page-inner section.normal h1 {
150 | color: #15A338;
151 | }
152 |
153 | .book .book-body .page-wrapper .page-inner section.normal h2 {
154 | font-size: 1.7em;
155 | color: #757776;
156 | }
157 |
158 | .book .book-body .page-wrapper .page-inner section.normal h3 {
159 | font-size: 1.4em;
160 | color: #969C9A;
161 | }
162 |
163 | /* Allow tables to scroll horizontally if they get too wide */
164 | section.markdown-section table {
165 | display: block;
166 | overflow-x: auto;
167 | }
168 |
169 | .book .book-summary ul.summary > li[data-level="1.2"] > ul > li > a {
170 | font-weight: bold;
171 | }
172 |
173 | .page-inner ul ul {
174 | margin-bottom: 15px;
175 | }
176 |
177 | .page-inner ol ol {
178 | margin-bottom: 15px;
179 | }
--------------------------------------------------------------------------------
/web-app/README.md:
--------------------------------------------------------------------------------
1 | # Web APP
2 |
3 | > uses the Nuxt.js and Express.js projects
4 | >
5 | > **Note:** This is only the WebApp part of Human-Connection, you have to also checkout the [API](https://github.com/Human-Connection/API) which is used by this WebApp.
6 |
7 | This is the nuxt + express version of our WebApp as nuxt.js seams to be more stable and we have better options for keeping it updated.
8 |
9 |
--------------------------------------------------------------------------------
/web-app/accessibility.md:
--------------------------------------------------------------------------------
1 | # Accessibility
2 |
3 | We need to address accessibility so that our network can be used through screen readers like [Lynx](http://lynx.invisible-island.net/) or more modern ones like [NVDA](https://github.com/nvaccess/nvda/tree/master).
4 |
5 | ## Development
6 |
7 | 
8 |
9 | **You can open the tota11y tool on development by clicking on the glasses in the lower left corner.**
10 |
11 | 
12 |
13 | **It will give you some insides and tips for improving the accessitility.**
14 |
15 | ## Other Tools and Resources
16 |
17 | * [AXE Browser Plugins](https://www.axe-core.org/) _Developer Tools_
18 | * [a11y.css](http://ffoodd.github.io/a11y.css/) _Bookmarlet generator_
19 | * [tota11y](https://github.com/Khan/tota11y) _In Browser Checks_
20 | * [Getting Started with Web Accessibility in Vue](https://medium.com/@emilymears/getting-started-with-web-accessibility-in-vue-17e2c4ea0842) _Medium Article_
21 | * [Accessibility JS](https://github.com/github/accessibilityjs) _GitHub's Tooling_
22 | * [25 Accessibility Testing](https://dynomapper.com/blog/27-accessibility-testing/246-top-25-awesome-accessibility-testing-tools-for-websites)
23 | * [Cheatsheet](https://bitsofco.de/the-accessibility-cheatsheet/)
24 | * [Tool List](https://css-tricks.com/accessibility-testing-tools/)
25 |
26 |
--------------------------------------------------------------------------------
/web-app/installation.md:
--------------------------------------------------------------------------------
1 | # Docker Installation
2 |
3 |
4 | _More information will follow shortly_
5 |
6 | # Local Installation
7 |
8 | Run:
9 |
10 | ```bash
11 | # install dependencies
12 | $ yarn install
13 |
14 | # serve with hot reload at localhost:3000
15 | $ yarn run dev
16 |
17 | # build once and launch server
18 | $ yarn run build
19 | $ yarn run start
20 | ```
21 |
22 | For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).
23 |
24 | ## Env Vars
25 |
26 | > More information on environment variables can be found in the [documentation \(WIP\)](https://docs.human-connection.org/environments/docker-test-production/docker-configuration.html)
27 |
28 | #### Test Logins
29 |
30 | | Role | E-Mail | Password |
31 | | :--- | :--- | :--- |
32 | | Admin | test@test.de | 1234 |
33 | | Moderator | test2@test2.de | 1234 |
34 | | User | test3@test3.de | 1234 |
35 |
36 | #### Access over WiFi
37 |
38 | In order to make your web app accessible from your local WiFi you have to
39 | configure `WEBAPP_HOST`, `WEBAPP_BASE_URL` and `API_HOST` depending on your
40 | IP address within that network. E.g. on Linux you can check your IP address with
41 | `ip addr`. Here's an example `.env` file for an IP address `192.168.178.42`:
42 |
43 | ```sh
44 | # .env
45 | WEBAPP_HOST = 192.168.178.42
46 | WEBAPP_BASE_URL = http://192.168.178.42:3000
47 | API_HOST = 192.168.178.42
48 | ```
49 |
50 | You can use this configuration e.g. to test the webapp from your mobile phone.
51 |
52 |
53 | #### Styleguide
54 |
55 | The Developer Style Guide provides important infos about components and styles. To start it simply type:
56 |
57 | ```bash
58 | $ yarn run styleguide
59 | ```
60 |
61 | When built you can open it at [http://localhost:6060](http://localhost:6060)
62 |
63 | #### Backpack
64 |
65 | We use [backpack](https://github.com/palmerhq/backpack) to watch and build the application, so you can use the latest ES6 features \(module syntax, async/await, etc.\).
66 |
67 |
--------------------------------------------------------------------------------
/web-app/internationalization.md:
--------------------------------------------------------------------------------
1 | ## Internationalization
2 |
3 | We translate the application for two languages at the moment, English and German.
4 | You can find all translations for the frontend in two files:
5 |
6 | `locales/en.json`
7 | `locales/de.json`
8 |
9 | Feel free to contribute to our translations and join our project at
10 | [Lokalise.co](https://lokalise.co/public/829625945b3c04bf56d560.80490143/)!
11 |
--------------------------------------------------------------------------------