├── data └── .gitkeep ├── .codecov.yml ├── email-templates ├── account │ ├── password-reset │ │ ├── en │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ │ └── de │ │ │ ├── style.scss │ │ │ ├── subject.hbs │ │ │ ├── text.hbs │ │ │ └── html.hbs │ ├── identity-change │ │ ├── en │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ │ └── de │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ ├── password-change │ │ ├── en │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ │ └── de │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ ├── invite-email │ │ ├── de │ │ │ ├── subject.hbs │ │ │ └── html.hbs.json │ │ └── en │ │ │ ├── subject.hbs │ │ │ └── html.hbs.json │ ├── reset-password │ │ ├── en │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ │ └── de │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ ├── verify-email │ │ ├── en │ │ │ ├── subject.hbs │ │ │ ├── style.scss │ │ │ ├── text.hbs │ │ │ └── html.hbs │ │ └── de │ │ │ ├── style.scss │ │ │ ├── subject.hbs │ │ │ ├── text.hbs │ │ │ └── html.hbs │ └── email-verified │ │ ├── de │ │ ├── style.scss │ │ ├── subject.hbs │ │ ├── text.hbs │ │ └── html.hbs │ │ └── en │ │ ├── style.scss │ │ ├── subject.hbs │ │ ├── text.hbs │ │ └── html.hbs └── layout │ ├── footer.hbs │ ├── _variables.scss │ └── header.hbs ├── .dockerignore ├── scripts ├── .gitignore └── remote-dump.sh ├── config ├── test-docker.json ├── local.example.json ├── test.json ├── default-docker.json ├── local-staging-docker.json ├── production.json └── default.json ├── public ├── favicon.ico └── img │ ├── emails │ ├── hc-logo.png │ └── alpha-ticket.png │ └── badges │ ├── fundraisingbox_de_crane.svg │ ├── fundraisingbox_de_starter.svg │ ├── fundraisingbox_de_glider.svg │ ├── fundraisingbox_de_balloon.svg │ ├── indiegogo_en_whale.svg │ ├── fundraisingbox_de_airship.svg │ ├── user_role_developer.svg │ ├── indiegogo_en_rabbit.svg │ ├── indiegogo_en_bear.svg │ ├── user_role_moderator.svg │ └── fundraisingbox_de_helicopter.svg ├── features ├── env │ ├── timeout.js │ ├── io.js │ └── database.js └── api │ ├── post.feature │ ├── usersettings │ ├── language.feature │ └── blacklist.feature │ └── usersettings.feature ├── test ├── assets │ ├── categories.js │ ├── comments.js │ ├── users.js │ └── contributions.js ├── services │ ├── admin.test.js │ ├── badges.test.js │ ├── emails.test.js │ ├── images.test.js │ ├── search.test.js │ ├── emotions.test.js │ ├── invites.test.js │ ├── projects.test.js │ ├── uploads.test.js │ ├── categories.test.js │ ├── notifications.test.js │ ├── organizations.test.js │ ├── user-invites.test.js │ ├── users-candos.test.js │ └── status.test.js ├── hooks │ ├── save-remote-images.test.js │ ├── create-default-avatar.test.js │ ├── calculate-emiotion-rating.test.js │ └── exclude-blacklisted.test.js └── app.test.js.bak ├── server ├── hooks │ ├── is-moderator-boolean.js │ ├── is-single-item.js │ ├── is-admin.js │ ├── include-all.js │ ├── is-moderator.js │ ├── patch-deleted-data.js │ ├── keep-deleted-data-fields.js │ ├── logger.js │ ├── create-default-avatar.js │ ├── exclude-blacklisted.js │ ├── is-enabled.js │ ├── cleanup-related-items.js │ ├── conceal-blacklisted-data.js │ ├── map-create-to-upsert.js │ ├── create-slug.js │ ├── exclude-disabled.js │ └── restrictReviewAndEnableChange.js ├── services │ ├── users │ │ ├── hooks │ │ │ ├── restrict-user-role.js │ │ │ ├── is-own-entry.js │ │ │ ├── create-admin.js │ │ │ ├── send-verification-email.js │ │ │ ├── save-avatar.js │ │ │ ├── invite-code.js │ │ │ └── remove-all-related-user-data.js │ │ └── users.service.js │ ├── users-candos │ │ ├── hooks │ │ │ └── set-done-date.js │ │ ├── users-candos.service.js │ │ └── users-candos.hooks.js │ ├── uploads │ │ ├── hooks │ │ │ └── encode.js │ │ ├── uploads.hooks.js │ │ └── uploads.service.js │ ├── invites │ │ ├── hooks │ │ │ └── send-invite-email.js │ │ ├── invites.service.js │ │ └── invites.hooks.js │ ├── status │ │ ├── status.hooks.js │ │ ├── status.service.js │ │ └── status.class.js │ ├── search │ │ ├── search.hooks.js │ │ ├── search.service.js │ │ └── search.class.js │ ├── auth-management │ │ ├── auth-management.service.js │ │ └── auth-management.hooks.js │ ├── emails │ │ ├── emails.hooks.js │ │ └── emails.service.js │ ├── admin │ │ ├── admin.service.js │ │ └── admin.hooks.js │ ├── user-invites │ │ ├── user-invites.hooks.js │ │ └── user-invites.service.js │ ├── settings │ │ ├── settings.service.js │ │ └── settings.hooks.js │ ├── badges │ │ ├── badges.hooks.js │ │ └── badges.service.js │ ├── pages │ │ ├── pages.service.js │ │ └── pages.hooks.js │ ├── images │ │ ├── images.service.js │ │ ├── hooks │ │ │ └── upload-file.js │ │ └── images.hooks.js │ ├── shouts │ │ ├── shouts.service.js │ │ ├── hooks │ │ │ └── set-shout-count.js │ │ └── shouts.hooks.js │ ├── comments │ │ ├── comments.service.js │ │ └── hooks │ │ │ ├── create-notifications.js │ │ │ └── create-mention-notifications.js │ ├── emotions │ │ ├── emotions.service.js │ │ └── emotions.hooks.js │ ├── projects │ │ ├── projects.service.js │ │ └── projects.hooks.js │ ├── organizations │ │ ├── hooks │ │ │ ├── save-avatar.js │ │ │ └── can-edit-organization.js │ │ └── organizations.service.js │ ├── categories │ │ ├── categories.service.js │ │ └── categories.hooks.js │ ├── usersettings │ │ ├── usersettings.service.js │ │ ├── hooks │ │ │ └── validate-blacklist.js │ │ └── usersettings.hooks.js │ ├── contributions │ │ ├── contributions.service.js │ │ └── hooks │ │ │ ├── notify-followers.js │ │ │ ├── create-mention-notifications.js │ │ │ └── get-associated-can-dos.js │ ├── notifications │ │ └── notifications.service.js │ ├── follows │ │ ├── follows.service.js │ │ └── hooks │ │ │ └── set-follow-count.js │ └── system-notifications │ │ ├── system-notifications.service.js │ │ └── system-notifications.hooks.js ├── seeder │ ├── demo │ │ ├── index.js │ │ └── contributions.js │ ├── base │ │ └── index.js │ └── development │ │ ├── usersettings.js │ │ ├── moderators.js │ │ ├── shouts.js │ │ ├── index.js │ │ ├── projects.js │ │ ├── invites.js │ │ ├── emotions.js │ │ ├── comments.js │ │ ├── users.js │ │ ├── users-candos.js │ │ ├── follows.js │ │ └── contributions.js ├── middleware │ └── index.js ├── models │ ├── status.model.js │ ├── categories.model.js │ ├── images.model.js │ ├── shouts.model.js │ ├── follows.model.js │ ├── settings.model.js │ ├── emotions.model.js │ ├── usersettings.model.js │ ├── invites.model.js │ ├── projects.model.js │ ├── users-candos.model.js │ ├── comments.model.js │ ├── pages.model.js │ ├── system-notifications.model.js │ ├── notifications.model.js │ └── badges.model.js ├── helper │ ├── urls.js │ ├── get-mentions.js │ ├── alter-items.js │ ├── get-unique-slug.js │ └── thumbor-helper.js ├── app.hooks.js ├── logger.js ├── mongoose.js ├── authentication.js └── index.js ├── .editorconfig ├── .istanbul.yml ├── docker-compose.override.yml ├── .eslintrc.json ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── docker-compose.staging.yml ├── .npmignore ├── docker-compose.yml ├── .gitattributes ├── LICENSE.md ├── Dockerfile ├── .travis.yml └── README.md /data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: "60...100" 3 | -------------------------------------------------------------------------------- /email-templates/account/password-reset/en/subject.hbs: -------------------------------------------------------------------------------- 1 | Password Reset -------------------------------------------------------------------------------- /email-templates/account/identity-change/en/subject.hbs: -------------------------------------------------------------------------------- 1 | Confirm Changes -------------------------------------------------------------------------------- /email-templates/account/password-change/en/subject.hbs: -------------------------------------------------------------------------------- 1 | Password Change -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | scripts/ 4 | Dockerfile 5 | -------------------------------------------------------------------------------- /email-templates/account/invite-email/de/subject.hbs: -------------------------------------------------------------------------------- 1 | Dein HC Alpha Ticket 2 | -------------------------------------------------------------------------------- /email-templates/account/invite-email/en/subject.hbs: -------------------------------------------------------------------------------- 1 | Your HC Alpha Ticket 2 | -------------------------------------------------------------------------------- /email-templates/account/password-change/de/subject.hbs: -------------------------------------------------------------------------------- 1 | Passwort geändert 2 | -------------------------------------------------------------------------------- /email-templates/account/reset-password/en/subject.hbs: -------------------------------------------------------------------------------- 1 | Confirm Reset Password -------------------------------------------------------------------------------- /email-templates/account/verify-email/en/subject.hbs: -------------------------------------------------------------------------------- 1 | Confirm yor Email Address -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !remote-dump.sh 3 | !README.md 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /email-templates/account/reset-password/de/subject.hbs: -------------------------------------------------------------------------------- 1 | Passwort zurücksetzen 2 | -------------------------------------------------------------------------------- /email-templates/account/verify-email/de/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; -------------------------------------------------------------------------------- /email-templates/account/verify-email/de/subject.hbs: -------------------------------------------------------------------------------- 1 | Bestätige deine E-Mail-Adresse -------------------------------------------------------------------------------- /email-templates/account/verify-email/en/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; -------------------------------------------------------------------------------- /config/test-docker.json: -------------------------------------------------------------------------------- 1 | { 2 | "mongodb": "mongodb://mongo:27017/hc_api_test" 3 | } 4 | -------------------------------------------------------------------------------- /email-templates/account/identity-change/de/subject.hbs: -------------------------------------------------------------------------------- 1 | Bestätige deine Änderungen 2 | -------------------------------------------------------------------------------- /email-templates/account/password-reset/de/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; -------------------------------------------------------------------------------- /email-templates/account/password-reset/en/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; -------------------------------------------------------------------------------- /email-templates/account/reset-password/de/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; -------------------------------------------------------------------------------- /email-templates/account/reset-password/en/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; -------------------------------------------------------------------------------- /email-templates/account/email-verified/de/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; 2 | -------------------------------------------------------------------------------- /email-templates/account/email-verified/de/subject.hbs: -------------------------------------------------------------------------------- 1 | Your email address has been verified -------------------------------------------------------------------------------- /email-templates/account/email-verified/en/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; 2 | -------------------------------------------------------------------------------- /email-templates/account/email-verified/en/subject.hbs: -------------------------------------------------------------------------------- 1 | Your email address has been verified -------------------------------------------------------------------------------- /email-templates/account/identity-change/de/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; 2 | -------------------------------------------------------------------------------- /email-templates/account/identity-change/en/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; 2 | -------------------------------------------------------------------------------- /email-templates/account/password-change/de/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; 2 | -------------------------------------------------------------------------------- /email-templates/account/password-change/en/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../layout/common'; 2 | -------------------------------------------------------------------------------- /email-templates/account/password-reset/de/subject.hbs: -------------------------------------------------------------------------------- 1 | Passwort erfolgreich zurückgesetzt 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Human-Connection/API/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /features/env/timeout.js: -------------------------------------------------------------------------------- 1 | const { setDefaultTimeout } = require('cucumber'); 2 | 3 | setDefaultTimeout(60 * 1000); 4 | -------------------------------------------------------------------------------- /public/img/emails/hc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Human-Connection/API/HEAD/public/img/emails/hc-logo.png -------------------------------------------------------------------------------- /config/local.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "seeder": { 3 | "runOnInit": true, 4 | "dropDatabase": false 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /public/img/emails/alpha-ticket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Human-Connection/API/HEAD/public/img/emails/alpha-ticket.png -------------------------------------------------------------------------------- /test/assets/categories.js: -------------------------------------------------------------------------------- 1 | const categoryData = { 2 | title: 'a', 3 | icon: 'a' 4 | }; 5 | 6 | module.exports = { 7 | categoryData 8 | }; -------------------------------------------------------------------------------- /test/assets/comments.js: -------------------------------------------------------------------------------- 1 | const commentData = { 2 | content: 'My comment content', 3 | }; 4 | 5 | module.exports = { 6 | commentData 7 | }; -------------------------------------------------------------------------------- /config/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "port": 3031, 3 | "baseURL": "http://localhost:3031", 4 | "mongodb": "mongodb://localhost:27017/hc_api_test" 5 | } 6 | -------------------------------------------------------------------------------- /config/default-docker.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseURL": "http://api.127.0.0.1.xip.io:3030", 3 | "mongodb": "mongodb://mongo:27017/hc_api", 4 | "host": "0.0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /email-templates/account/password-reset/en/text.hbs: -------------------------------------------------------------------------------- 1 | Password reset 2 | 3 | Hi {{ name }}, your password was just reset. 4 | 5 | If you didn't request this change please let us know! 6 | 7 | — Human Connection -------------------------------------------------------------------------------- /email-templates/account/password-change/de/text.hbs: -------------------------------------------------------------------------------- 1 | Passwort geändert 2 | 3 | Hallo {{ name }}, dein passwort wurde eben geändert. 4 | 5 | Wenn das nicht du warst lass es uns wissen! 6 | 7 | — Human Connection 8 | -------------------------------------------------------------------------------- /email-templates/account/password-change/en/text.hbs: -------------------------------------------------------------------------------- 1 | Password change 2 | 3 | Hi {{ name }}, your password was recently changed. 4 | 5 | If you didn't request this change please let us know! 6 | 7 | — Human Connection -------------------------------------------------------------------------------- /email-templates/account/invite-email/de/html.hbs.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "Hsd6ag", 3 | "email": "test@test.de", 4 | "language": "de", 5 | "frontURL": "http://localhost:3000", 6 | "backURL": "http://localhost:3030" 7 | } 8 | -------------------------------------------------------------------------------- /email-templates/account/invite-email/en/html.hbs.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "Hsd6ag", 3 | "email": "test@test.de", 4 | "language": "en", 5 | "frontURL": "http://localhost:3000", 6 | "backURL": "http://localhost:3030" 7 | } 8 | -------------------------------------------------------------------------------- /features/env/io.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console: off */ 2 | const { Before } = require('cucumber'); 3 | const fs = require('fs-extra'); 4 | 5 | const tmpDir = './tmp'; 6 | 7 | Before(() => fs.remove(tmpDir).then(() => fs.ensureDir(tmpDir))); 8 | 9 | -------------------------------------------------------------------------------- /server/hooks/is-moderator-boolean.js: -------------------------------------------------------------------------------- 1 | // Check if user is moderator 2 | module.exports = () => hook => { 3 | if(!hook.params || !hook.params.user) { 4 | return false; 5 | } 6 | return ['admin', 'moderator'].includes(hook.params.user.role); 7 | }; 8 | -------------------------------------------------------------------------------- /server/services/users/hooks/restrict-user-role.js: -------------------------------------------------------------------------------- 1 | // Delete role from data if user is no admin 2 | module.exports = () => hook => { 3 | if(!hook.params || !hook.params.user || hook.params.user.role !== 'admin') { 4 | delete hook.data.role; 5 | } 6 | return hook; 7 | }; 8 | -------------------------------------------------------------------------------- /email-templates/account/password-reset/de/text.hbs: -------------------------------------------------------------------------------- 1 | Passwort erfolgreich zurückgesetzt 2 | 3 | Hallo {{ name }}, dein passwort wurde erfolgreich zurückgesetzt. 4 | 5 | Wenn du es nicht warst der dein Passwort zurücksetzen wollte lass es uns wissen! 6 | 7 | — Human Connection 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /server/hooks/is-single-item.js: -------------------------------------------------------------------------------- 1 | // Check if the query is for a single item 2 | module.exports = () => hook => { 3 | if (hook && hook.params && hook.params.query && (hook.params.query.$limit === 1 || hook.params.query.slug)) { 4 | return true; 5 | } else { 6 | return false; 7 | } 8 | }; -------------------------------------------------------------------------------- /.istanbul.yml: -------------------------------------------------------------------------------- 1 | verbose: false 2 | instrumentation: 3 | root: ./ 4 | reporting: 5 | print: summary 6 | reports: 7 | - html 8 | - text 9 | - lcov 10 | watermarks: 11 | statements: [70, 90] 12 | lines: [70, 90] 13 | functions: [70, 90] 14 | branches: [70, 90] 15 | -------------------------------------------------------------------------------- /server/services/users-candos/hooks/set-done-date.js: -------------------------------------------------------------------------------- 1 | // Set done date, when cando is done 2 | module.exports = () => hook => { 3 | if (!hook.data.done) { 4 | hook.data.doneAt = null; 5 | } else if (!hook.data.doneAt) { 6 | hook.data.doneAt = Date.now(); 7 | } 8 | return hook; 9 | }; 10 | -------------------------------------------------------------------------------- /server/services/users/hooks/is-own-entry.js: -------------------------------------------------------------------------------- 1 | module.exports = (belongs = true) => hook => { 2 | const itemBelongsToAuthenticatedUser = Boolean(hook.params.user && hook.result && hook.params.user._id.toString() === hook.result._id.toString()); 3 | return itemBelongsToAuthenticatedUser === belongs; 4 | }; 5 | -------------------------------------------------------------------------------- /docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | 3 | services: 4 | api: 5 | environment: 6 | - NODE_ENV=development 7 | ports: 8 | - "3030:3030" 9 | - "9229:9229" # node inspect 10 | volumes: 11 | - .:/API 12 | - /API/node_modules 13 | command: yarn run dev 14 | tty: true 15 | -------------------------------------------------------------------------------- /email-templates/account/email-verified/de/text.hbs: -------------------------------------------------------------------------------- 1 | Thanks for verifying your email address 2 | 3 | Hi {{ name }}, your email address has been verified. 4 | 5 | You can now contribute to our great community and get inspired to take action. Have fun! 6 | 7 | Start exploring: {{frontURL}} 8 | 9 | — Human Connection 10 | -------------------------------------------------------------------------------- /email-templates/account/email-verified/en/text.hbs: -------------------------------------------------------------------------------- 1 | Thanks for verifying your email address 2 | 3 | Hi {{ name }}, your email address has been verified. 4 | 5 | You can now contribute to our great community and get inspired to take action. Have fun! 6 | 7 | Start exploring: {{frontURL}} 8 | 9 | — Human Connection 10 | -------------------------------------------------------------------------------- /server/seeder/demo/index.js: -------------------------------------------------------------------------------- 1 | // These seeders are only used during development 2 | // Use them to seed fake users, contributions, etc. 3 | 4 | module.exports = function () { 5 | // Add your seeder configs here 6 | return [ 7 | require('./contributions'), 8 | require('../development/emotions') 9 | ]; 10 | }; 11 | -------------------------------------------------------------------------------- /test/services/admin.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'admin\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('admin'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/badges.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'badges\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('badges'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/emails.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'emails\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('emails'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/images.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'images\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('images'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/search.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'search\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('search'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /server/hooks/is-admin.js: -------------------------------------------------------------------------------- 1 | // Check if user is admin 2 | const errors = require('@feathersjs/errors'); 3 | 4 | module.exports = () => hook => { 5 | if(!hook.params || !hook.params.user || hook.params.user.role !== 'admin') { 6 | throw new errors.Forbidden('You don\'t have admin rights.'); 7 | } 8 | return hook; 9 | }; 10 | -------------------------------------------------------------------------------- /test/services/emotions.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'emotions\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('emotions'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/invites.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'invites\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('invites'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/projects.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'projects\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('projects'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/uploads.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'uploads\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('uploads'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /config/local-staging-docker.json: -------------------------------------------------------------------------------- 1 | { 2 | "seeder": { 3 | "runOnInit": true, 4 | "dropDatabase": false 5 | }, 6 | "smtpConfig": { 7 | "host": "maildev", 8 | "port": 25, 9 | "ignoreTLS": true 10 | }, 11 | "thumbor": { 12 | "url": "http://thumbor.127.0.0.1.xip.io:8000", 13 | "key": "" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /server/seeder/base/index.js: -------------------------------------------------------------------------------- 1 | // These seeders are only used during development 2 | // Use them to seed fake users, contributions, etc. 3 | 4 | module.exports = function () { 5 | // Add your seeder configs here 6 | return [ 7 | require('./categories'), 8 | require('./pages'), 9 | require('./badges') 10 | ]; 11 | }; 12 | -------------------------------------------------------------------------------- /email-templates/account/reset-password/en/text.hbs: -------------------------------------------------------------------------------- 1 | Confirm password reset 2 | 3 | Hi {{ name }}, we got a request to reset your password. 4 | 5 | Reset password: {{ link }} 6 | 7 | If you ignore this message your password won't be changed. 8 | 9 | If you didn't request this change please let us know! 10 | 11 | — Human Connection -------------------------------------------------------------------------------- /server/hooks/include-all.js: -------------------------------------------------------------------------------- 1 | module.exports = () => hook => { 2 | if (!hook.params._includeAll) { 3 | return hook; 4 | } 5 | if (hook.params.query.deleted) { 6 | delete hook.params.query.deleted; 7 | } 8 | if (hook.params.query.isEnabled) { 9 | delete hook.params.query.isEnabled; 10 | } 11 | return hook; 12 | }; 13 | -------------------------------------------------------------------------------- /test/services/categories.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'categories\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('categories'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/notifications.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'notifications\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('notifications'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/organizations.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'organizations\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('organizations'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/user-invites.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'user-invites\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('user-invites'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /test/services/users-candos.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const app = require('../../server/app'); 3 | 4 | describe('\'users-candos\' service', () => { 5 | it('registered the service', () => { 6 | const service = app.service('users-candos'); 7 | 8 | assert.ok(service, 'Registered the service'); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /server/hooks/is-moderator.js: -------------------------------------------------------------------------------- 1 | // Check if user is moderator 2 | const errors = require('@feathersjs/errors'); 3 | 4 | module.exports = () => hook => { 5 | if(!hook.params || !hook.params.user || !['admin','moderator'].includes(hook.params.user.role)) { 6 | throw new errors.Forbidden('You don\'t have moderator rights.'); 7 | } 8 | return hook; 9 | }; 10 | -------------------------------------------------------------------------------- /email-templates/account/verify-email/de/text.hbs: -------------------------------------------------------------------------------- 1 | Bitte bestätige deine E-Mail-Adresse 2 | 3 | Hallo {{ name }}, bitte bestädige deine E-Mail-Adresse durch klick auf den unteren Link. 4 | 5 | Es ist wichtig das wir deine Korrekte E-Mail-Adresse um dein Konto zu schützen. 6 | 7 | Bestätige deine E-Mail-Adresse unter der folgenden URL: 8 | {{ link }} 9 | 10 | — Human Connection 11 | -------------------------------------------------------------------------------- /email-templates/account/identity-change/en/text.hbs: -------------------------------------------------------------------------------- 1 | Please confirm these changes 2 | 3 | Hi {{ name }}, your user information was just changed. Please verify that you made these changes. 4 | 5 | {{#each changes}} 6 | {{ this.label }}: {{ this.value }} 7 | {{/each}} 8 | 9 | I accept the changes: {{ link }} 10 | 11 | If you didn't request this change please let us know! 12 | 13 | — Human Connection -------------------------------------------------------------------------------- /email-templates/account/verify-email/en/text.hbs: -------------------------------------------------------------------------------- 1 | Please confirm your email address 2 | 3 | Hi {{ name }}, please confirm your email address by clicking the link below. 4 | 5 | We may need to send you critical information about our service and it is important that we have an accurate email address. 6 | 7 | Confirm email address by following this link: 8 | {{ link }} 9 | 10 | — Human Connection 11 | -------------------------------------------------------------------------------- /email-templates/layout/footer.hbs: -------------------------------------------------------------------------------- 1 | 2 |
9 | 10 | 11 |