diff --git a/.gitbook.yaml b/.gitbook.yaml new file mode 100644 index 000000000..16680a37a --- /dev/null +++ b/.gitbook.yaml @@ -0,0 +1,3 @@ +structure: + readme: README.md + summary: SUMMARY.md diff --git a/.gitbook/assets/grafik (1).png b/.gitbook/assets/grafik (1).png new file mode 100644 index 000000000..8fabb8555 Binary files /dev/null and b/.gitbook/assets/grafik (1).png differ diff --git a/.gitbook/assets/grafik-1 (1).png b/.gitbook/assets/grafik-1 (1).png new file mode 100644 index 000000000..cc5dade55 Binary files /dev/null and b/.gitbook/assets/grafik-1 (1).png differ diff --git a/.gitbook/assets/grafik-1.png b/.gitbook/assets/grafik-1.png new file mode 100644 index 000000000..cc5dade55 Binary files /dev/null and b/.gitbook/assets/grafik-1.png differ diff --git a/.gitbook/assets/grafik-4.png b/.gitbook/assets/grafik-4.png new file mode 100644 index 000000000..dab3eef27 Binary files /dev/null and b/.gitbook/assets/grafik-4.png differ diff --git a/.gitbook/assets/grafik.png b/.gitbook/assets/grafik.png new file mode 100644 index 000000000..8fabb8555 Binary files /dev/null and b/.gitbook/assets/grafik.png differ diff --git a/.gitbook/assets/graphql-playground (1).png b/.gitbook/assets/graphql-playground (1).png new file mode 100644 index 000000000..32396a577 Binary files /dev/null and b/.gitbook/assets/graphql-playground (1).png differ diff --git a/.gitbook/assets/graphql-playground.png b/.gitbook/assets/graphql-playground.png new file mode 100644 index 000000000..32396a577 Binary files /dev/null and b/.gitbook/assets/graphql-playground.png differ diff --git a/.gitbook/assets/humanconnection (1).png b/.gitbook/assets/humanconnection (1).png new file mode 100644 index 000000000..f0576413f Binary files /dev/null and b/.gitbook/assets/humanconnection (1).png differ diff --git a/.gitbook/assets/humanconnection.png b/.gitbook/assets/humanconnection.png new file mode 100644 index 000000000..f0576413f Binary files /dev/null and b/.gitbook/assets/humanconnection.png differ diff --git a/lets_get_together_2.png b/.gitbook/assets/lets_get_together.png similarity index 100% rename from lets_get_together_2.png rename to .gitbook/assets/lets_get_together.png diff --git a/.gitbook/assets/screenshot (1).png b/.gitbook/assets/screenshot (1).png new file mode 100644 index 000000000..b4ff4b2f9 Binary files /dev/null and b/.gitbook/assets/screenshot (1).png differ diff --git a/.gitbook/assets/screenshot-forking-nitro-backend.png b/.gitbook/assets/screenshot-forking-nitro-backend.png new file mode 100644 index 000000000..6d52dd130 Binary files /dev/null and b/.gitbook/assets/screenshot-forking-nitro-backend.png differ diff --git a/.gitbook/assets/screenshot-forking-nitro.png b/.gitbook/assets/screenshot-forking-nitro.png new file mode 100644 index 000000000..ebece0d36 Binary files /dev/null and b/.gitbook/assets/screenshot-forking-nitro.png differ diff --git a/.gitbook/assets/screenshot-neo4j-download-center-current-releases.png b/.gitbook/assets/screenshot-neo4j-download-center-current-releases.png new file mode 100644 index 000000000..8d9033864 Binary files /dev/null and b/.gitbook/assets/screenshot-neo4j-download-center-current-releases.png differ diff --git a/.gitbook/assets/screenshot-styleguide (1).png b/.gitbook/assets/screenshot-styleguide (1).png new file mode 100644 index 000000000..d8e009394 Binary files /dev/null and b/.gitbook/assets/screenshot-styleguide (1).png differ diff --git a/.gitbook/assets/screenshot-styleguide (2).png b/.gitbook/assets/screenshot-styleguide (2).png new file mode 100644 index 000000000..d8e009394 Binary files /dev/null and b/.gitbook/assets/screenshot-styleguide (2).png differ diff --git a/.gitbook/assets/screenshot-styleguide.png b/.gitbook/assets/screenshot-styleguide.png new file mode 100644 index 000000000..d8e009394 Binary files /dev/null and b/.gitbook/assets/screenshot-styleguide.png differ diff --git a/.gitbook/assets/screenshot.png b/.gitbook/assets/screenshot.png new file mode 100644 index 000000000..b4ff4b2f9 Binary files /dev/null and b/.gitbook/assets/screenshot.png differ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 19f3854c1..b331a1736 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -40,7 +40,5 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/) -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0da2958ea..01c963187 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,40 +1,39 @@ -Thanks so much for thinking of contributing to the Human Connection project, we really appreciate it! :-) +# CONTRIBUTING -### Getting Set Up +Thanks so much for thinking of contributing to the Human Connection project, we really appreciate it! :-\) -Instructions for how to install all the necessary software can be found in our [documentation](https://docs.human-connection.org/nitro/) +## Getting Set Up -We recommend that new folks should ideally work together with an existing developer. Please join our discord instance to chat with developers or just ask them in tickets in [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f/boards?repos=152252353): +Instructions for how to install all the necessary software can be found in our [documentation](https://docs.human-connection.org/human-connection/) + +We recommend that new folks should ideally work together with an existing developer. Please join our discord instance to chat with developers or just ask them in tickets in [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f/boards?repos=152252353):  Here are some general notes on our development flow: -### Development +## Development * Currently operating in two week sprints * We are using ZenHub to coordinate - - estimating time per issue is the crucial feature of [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f) that Github does not have - - "up-for-grabs" links to [Github project](https://github.com/orgs/Human-Connection/projects/10?card_filter_query=label%3A%22good+first+issue) - - ordering on ZenHub not necessarily reflected on github projects - + * estimating time per issue is the crucial feature of [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f) that Github does not have + * "up-for-grabs" links to [Github project](https://github.com/orgs/Human-Connection/projects/10?card_filter_query=label%3A"good+first+issue) + * ordering on ZenHub not necessarily reflected on github projects * AgileVentures run open pairing sessions at 10:30am UTC each week on Tuesdays and Thursdays - * Core team - - all the people who are hired by HC non-profit corporation - - you can Meet-the-team [every two weeks in German](https://human-connection.org/veranstaltungen/) and [every month in English](https://human-connection.org/en/events/). - - 9 people - - 2 core developers (Robert [@roschaefer](https://github.com/roschaefer) and Greg [@appinteractive](https://github.com/appinteractive)) - - 3 marketeers Jasi, Dennis and Sensi - - Hardy doing business development - - Martin head of IT and previously data protection officer - - Victor doing accounting and controlling - - Nicolas is the community manager (reviews content in the network) reflects community opinion back to the core team - + * all the people who are hired by HC non-profit corporation + * you can Meet-the-team [every two weeks in German](https://human-connection.org/veranstaltungen/) and [every month in English](https://human-connection.org/en/events/). + * 9 people + * 2 core developers \(Robert [@roschaefer](https://github.com/roschaefer) and Greg [@appinteractive](https://github.com/appinteractive)\) + * 3 marketeers Jasi, Dennis and Sensi + * Hardy doing business development + * Martin head of IT and previously data protection officer + * Victor doing accounting and controlling + * Nicolas is the community manager \(reviews content in the network\) reflects community opinion back to the core team * when can folks pair with Robert - - 10am UTC until 5pm UTC every working day + * 10am UTC until 5pm UTC every working day -### Philosophy +## Philosophy We practise [collective code ownership](http://www.extremeprogramming.org/rules/collective.html) rather than strong code ownership, which means that: @@ -45,28 +44,25 @@ We practise [collective code ownership](http://www.extremeprogramming.org/rules/ Everyone feel free to request merges or answers to issues from the project managers -But what do we do when waiting for merge into master (wanting to keep PRs small) - --> Robert recommends creating a pull request for each step - - programming is also about thinking about other people - empathy for your co-workers - - but what about when you are waiting for merge? - - solutions - - 1) put 2nd PR into branch that the first PR is hitting - but requires update after merging - - 2) prefer to leave exiting PR until it can be reviewed, and instead go and work on some other part of the codebase that is not impacted by the first PR +But what do we do when waiting for merge into master \(wanting to keep PRs small\) --> Robert recommends creating a pull request for each step -### Notes +* programming is also about thinking about other people - empathy for your co-workers + * but what about when you are waiting for merge? + * solutions + * 1\) put 2nd PR into branch that the first PR is hitting - but requires update after merging + * 2\) prefer to leave exiting PR until it can be reviewed, and instead go and work on some other part of the codebase that is not impacted by the first PR -question: when you want to pick a task - (find out priority) - is it in discord? is it in AV slack? --> Robert says you can always ask in discord - group channels are the best +## Notes -Robert shares: [Zenhub board](https://app.zenhub.com/workspaces/nitro-embed-5c0154ecc699f60fc92cf11f/boards?repos=112590397,152252353,152252578,157710732,163305928) -Robert says the order of tickets are preserved in ZenHub and reflect their priority (most important at the top) and so check out the current milestones +question: when you want to pick a task - \(find out priority\) - is it in discord? is it in AV slack? --> Robert says you can always ask in discord - group channels are the best -Matt - question about who can work on [ticket 100](https://app.zenhub.com/workspaces/nitro-embed-5c0154ecc699f60fc92cf11f/issues/human-connection/human-connection/100) --> Robert - in rare occasions it might be exclusive to someone with admin permissions -Robert: notes greg just pushed this today: https://github.com/Human-Connection/Nitro-Deployment +Robert shares: [Zenhub board](https://app.zenhub.com/workspaces/nitro-embed-5c0154ecc699f60fc92cf11f/boards?repos=112590397,152252353,152252578,157710732,163305928) Robert says the order of tickets are preserved in ZenHub and reflect their priority \(most important at the top\) and so check out the current milestones + +Matt - question about who can work on [ticket 100](https://app.zenhub.com/workspaces/nitro-embed-5c0154ecc699f60fc92cf11f/issues/human-connection/human-connection/100) --> Robert - in rare occasions it might be exclusive to someone with admin permissions Robert: notes greg just pushed this today: [https://github.com/Human-Connection/Nitro-Deployment](https://github.com/Human-Connection/Nitro-Deployment) Matt makes point that new stories will have to be taken off the "New Issues" and Robert says that's fine, if you don't like the first one, then you can take the next one. Volunteeers have no commitment except their own self development and their awesomeness by contributing to free and open-source software projects. Robert notes that everyone is invited to join the kickoff meetings -Robert - difference between "important" (creates a lot of value) and "beginner friendly" (easy to implement) - +Robert - difference between "important" \(creates a lot of value\) and "beginner friendly" \(easy to implement\) diff --git a/LICENSE.md b/LICENSE.md index 9d4508b38..646ae3a6d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,21 +1,12 @@ +# LICENSE + MIT License -Copyright (c) 2018 Human-Connection gGmbH +Copyright \(c\) 2018 Human-Connection gGmbH -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: +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: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. -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. diff --git a/README.md b/README.md index 77ac8dd4b..3f92be96d 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,25 @@ -
- # Human-Connection - [](https://travis-ci.com/Human-Connection/Human-Connection) +[](https://github.com/Human-Connection/Nitro-Backend/blob/backend/LICENSE.md) +[](https://discord.gg/6ub73U3) -Human Connection is a free and open-source social network for active citizenship. +Human Connection is a nonprofit social, action and knowledge network that connects information to action and promotes positive local and global change in all areas of life. + +* **Social**: Interact with other people not just by commenting their posts, but by providing **Pro & Contra** arguments, give a **Versus** or ask them by integrated **Chat** or **Let's Talk** +* **Knowledge**: Read articles about interesting topics and find related posts in the **More Info** tab or by **Filtering** based on **Categories** and **Tagging** or by using the **Fulltext Search**. +* **Action**: Don't just read about how to make the world a better place, but come into **Action** by following provided suggestions on the **Action** tab provided by other people or **Organisations**. + + [](https://human-connection.org) **Technology Stack** -- [VueJS](https://vuejs.org/) -- [NuxtJS](https://nuxtjs.org/) -- [GraphQL](https://graphql.org/) -- [NodeJS](https://nodejs.org/en/) -- [Neo4J](https://neo4j.com/) + +* [VueJS](https://vuejs.org/) +* [NuxtJS](https://nuxtjs.org/) +* [GraphQL](https://graphql.org/) +* [NodeJS](https://nodejs.org/en/) +* [Neo4J](https://neo4j.com/) + ## Live demo @@ -22,18 +27,31 @@ Try out our deployed [staging environment](https://nitro-staging.human-connectio Logins: -| email | password | role | -| --- | --- | --- | -| `user@example.org` | 1234 | user | -| `moderator@example.org` | 1234 | moderator | -| `admin@example.org` | 1234 | admin | - +| email | password | role | +| :--- | :--- | :--- | +| `user@example.org` | 1234 | user | +| `moderator@example.org` | 1234 | moderator | +| `admin@example.org` | 1234 | admin | ## Documentation -Learn how to set up a local development environment in our [Docs](https://docs.human-connection.org/nitro). + +Learn how to set up a local development environment in our [Docs](https://docs.human-connection.org/human-connection/) :mag_right: ## Translations -Contributre translations on [lokalise.co](https://lokalise.co/public/556252725c18dd752dd546.13222042/). + +You can help translating the interface by joining us on [lokalise.co](https://lokalise.co/public/556252725c18dd752dd546.13222042/). +Thank you lokalise for providing us with a premium account :raised_hands:. ## Developer Chat -Join the open-source community on [Discord](https://discord.gg/6ub73U3). + +Join our friendly open-source community on [Discord](https://discord.gg/6ub73U3) :heart_eyes_cat: +Just introduce yourself at `#user-presentation` and mention `@@Mentor` to get you onboard :neckbeard: +Check out the [contribution guideline](./CONTRIBUTING.md), too! + + +## Attributions + +Locale Icons made by [Freepik](http://www.freepik.com/) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/) + +## License +See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT). diff --git a/SUMMARY.md b/SUMMARY.md new file mode 100644 index 000000000..cf9c463cf --- /dev/null +++ b/SUMMARY.md @@ -0,0 +1,32 @@ +# Table of contents + +* [Introduction](README.md) +* [Edit this Documentation](edit-this-documentation.md) +* [Installation](installation.md) +* [Backend](backend/README.md) + * [graphql-with-apollo](backend/graphql-with-apollo/README.md) + * [GraphQL with Apollo](backend/graphql-with-apollo/graphql-with-apollo/README.md) + * [Mocking](backend/graphql-with-apollo/graphql-with-apollo/mocking.md) + * [Seeding](backend/graphql-with-apollo/graphql-with-apollo/seeding.md) + * [Import](backend/data-import.md) + * [Middleware](backend/middleware.md) +* [Webapp](webapp/README.md) + * [COMPONENTS](webapp/components.md) + * [PLUGINS](webapp/plugins.md) + * [STORE](webapp/store.md) + * [PAGES](webapp/pages.md) + * [ASSETS](webapp/assets.md) + * [LAYOUTS](webapp/layouts.md) + * [Styleguide](webapp/styleguide.md) + * [STATIC](webapp/static.md) + * [MIDDLEWARE](webapp/middleware.md) +* [Testing Guide](testing.md) + * [End-to-end tests](cypress/README.md) + * [Frontend tests](webapp/testing.md) + * [Backend tests](backend/testing.md) +* [Contributing](CONTRIBUTING.md) +* [Deployment](deployment/README.md) +* [Feature Specification](cypress/features.md) +* [Code of conduct](CODE_OF_CONDUCT.md) +* [License](LICENSE.md) + diff --git a/backend/README.md b/backend/README.md index dd4c040e7..c3f581ef2 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,53 +1,17 @@ - +# Backend -# NITRO Backend -[](https://travis-ci.com/Human-Connection/Nitro-Backend) -[](https://github.com/Human-Connection/Nitro-Backend/blob/backend/LICENSE.md) -[](https://app.fossa.io/projects/git%2Bgithub.com%2FHuman-Connection%2FNitro-Backend?ref=badge_shield) -[](https://discord.gg/6ub73U3) -> This Prototype tries to resolve the biggest hurdle of connecting -> our services together. This is not possible in a sane way using -> our current approach. -> -> With this Prototype we can explore using the combination of -> GraphQL and the Neo4j Graph Database for achieving the connected -> nature of a social graph with better development experience as we -> do not need to connect data by our own any more through weird table -> structures etc. +## Installation with Docker -> -> #### Advantages: -> - easer data structure -> - better connected data -> - easy to achieve "recommendations" based on actions (relations) -> - more performant and better to understand API -> - better API client that uses caching -> -> We still need to evaluate the drawbacks and estimate the development -> cost of such an approach +Make sure you are on a [node](https://nodejs.org/en/) version >= `v10.12.0`: -## How to get in touch -Connect with other developers over [Discord](https://discord.gg/6ub73U3) - -## Quick Start - -### Requirements - -Node >= `v10.12.0` -``` +```text node --version ``` -### Forking the repository -Before you start, fork the repository using the fork button above, then clone it to your local machine using `git clone https://github.com/your-username/Nitro-Backend.git` - -### Installation with Docker - Run: -```sh + +```bash docker-compose up # create indices etc. @@ -61,12 +25,12 @@ docker-compose exec backend yarn run db:seed App is [running on port 4000](http://localhost:4000/) To wipe out your neo4j database run: -```sh + +```bash docker-compose down -v ``` - -### Installation without Docker +## Installation without Docker Install dependencies: @@ -75,11 +39,12 @@ Download [Neo4j Community Edition](https://neo4j.com/download-center/#releases) Download [Neo4j Apoc](https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases) and drop the file into the `plugins` folder of the just extracted Neo4j-Server Start Neo4j -``` + +```text neo4j\bin\neo4j start ``` -and confirm it's running [here](http://localhost:7474) +and confirm it's running [here](http://localhost:7474) ```bash yarn install @@ -88,9 +53,11 @@ npm install ``` Copy: -``` + +```text cp .env.template .env ``` + Configure the file `.env` according to your needs and your local setup. Start the GraphQL service: @@ -109,15 +76,13 @@ yarn start npm start ``` -This will start the GraphQL service (by default on localhost:4000) -where you can issue GraphQL requests or access GraphQL Playground in the browser: +This will start the GraphQL service \(by default on localhost:4000\) where you can issue GraphQL requests or access GraphQL Playground in the browser: - + ## Configure -Set your Neo4j connection string and credentials in `.env`. -For example: +Set your Neo4j connection string and credentials in `.env`. For example: _.env_ @@ -129,24 +94,11 @@ NEO4J_PASSWORD=letmein > You need to install APOC as a plugin for the graph you create in the neo4j desktop app! -Note that grand-stack-starter does not currently bundle a distribution -of Neo4j. You can download [Neo4j Desktop](https://neo4j.com/download/) -and run locally for development, spin up a [hosted Neo4j Sandbox instance](https://neo4j.com/download/), -run Neo4j in one of the [many cloud options](https://neo4j.com/developer/guide-cloud-deployment/), -[spin up Neo4j in a Docker container](https://neo4j.com/developer/docker/) or on Debian-based systems install [Neo4j from the Debian Repository](http://debian.neo4j.org/). -Just be sure to update the Neo4j connection string and credentials accordingly in `.env`. +Note that grand-stack-starter does not currently bundle a distribution of Neo4j. You can download [Neo4j Desktop](https://neo4j.com/download/) and run locally for development, spin up a [hosted Neo4j Sandbox instance](https://neo4j.com/download/), run Neo4j in one of the [many cloud options](https://neo4j.com/developer/guide-cloud-deployment/), [spin up Neo4j in a Docker container](https://neo4j.com/developer/docker/) or on Debian-based systems install [Neo4j from the Debian Repository](http://debian.neo4j.org/). Just be sure to update the Neo4j connection string and credentials accordingly in `.env`. -## Mock API Results +# Seed and Reset the Database -Alternatively you can just mock all responses from the api which let -you build a frontend application without running a neo4j instance. - -Just set `MOCK=true` inside `.env` or pass it on application start. - -## Seed and Reset the Database - -Optionally you can seed the GraphQL service by executing mutations that -will write sample data to the database: +Optionally you can seed the GraphQL service by executing mutations that will write sample data to the database: ```bash yarn run db:seed @@ -162,17 +114,20 @@ yarn db:reset npm run db:reset ``` -## Run Tests +# Testing **Beware**: We have no multiple database setup at the moment. We clean the database after each test, running the tests will wipe out all your data! -Run the **_jest_** tests: +Run the _**jest**_ tests: + ```bash yarn run test # -or- npm run test ``` -Run the **_cucumber_** features: + +Run the _**cucumber**_ features: + ```bash yarn run test:cucumber # -or- @@ -180,17 +135,3 @@ npm run test:cucumber ``` When some tests fail, try `yarn db:reset` and after that `yarn db:seed`. Then run the tests again -## Todo`s - -- [x] add jwt authentication -- [ ] get directives working correctly (@toLower, @auth, @role, etc.) -- [x] check if search is working -- [x] check if sorting is working -- [x] check if pagination is working -- [ ] check if upload is working (using graphql-yoga?) -- [x] evaluate middleware -- [ ] ignore Posts and Comments by blacklisted Users - - -## License -[](https://app.fossa.io/projects/git%2Bgithub.com%2FHuman-Connection%2FNitro-Backend?ref=badge_large) diff --git a/backend/data-import.md b/backend/data-import.md new file mode 100644 index 000000000..0f55b9e2d --- /dev/null +++ b/backend/data-import.md @@ -0,0 +1,38 @@ +# Import + +This guide helps you to import data from our legacy servers, which are using FeathersJS and MongoDB. + +## Prerequisites + +You need [docker](https://www.docker.com/) installed on your machine. Furthermore you need SSH access to the server and you need to know the following login credentials and server settings: + +| Environment variable | Description | +| :--- | :--- | +| SSH\_USERNAME | Your ssh username on the server | +| SSH\_HOST | The IP address of the server | +| MONGODB\_USERNAME | Mongo username on the server | +| MONGODB\_PASSWORD | Mongo password on the server | +| MONGODB\_AUTH\_DB | Mongo authentication database | +| MONGODB\_DATABASE | The name of the mongo database | +| UPLOADS\_DIRECTORY | Path to remote uploads folder | + +## Run the database migration + +Run `docker-compose` with all environment variables specified: + +```bash +SSH_USERNAME=username SSH_HOST=some.server.com MONGODB_USERNAME='hc-api' MONGODB_PASSWORD='secret' MONGODB_DATABASE=hc_api MONGODB_AUTH_DB=hc_api UPLOADS_DIRECTORY=/var/www/api/uploads docker-compose up +``` + +Download the remote mongo database: + +```bash +docker-compose exec db-migration-worker ./import.sh +``` + +Import the local download into Neo4J: + +```bash +docker-compose exec neo4j import/import.sh +``` + diff --git a/backend/graphql-with-apollo/README.md b/backend/graphql-with-apollo/README.md new file mode 100644 index 000000000..0d5e196cb --- /dev/null +++ b/backend/graphql-with-apollo/README.md @@ -0,0 +1,2 @@ +# graphql-with-apollo + diff --git a/backend/graphql-with-apollo/graphql-with-apollo/README.md b/backend/graphql-with-apollo/graphql-with-apollo/README.md new file mode 100644 index 000000000..7fe29fd72 --- /dev/null +++ b/backend/graphql-with-apollo/graphql-with-apollo/README.md @@ -0,0 +1,6 @@ +# GraphQL with Apollo + +GraphQL is a data query language which provides an alternative to REST and ad-hoc web service architectures. It allows clients to define the structure of the data required, and exactly the same structure of the data is returned from the server. + + + diff --git a/backend/graphql-with-apollo/graphql-with-apollo/mocking.md b/backend/graphql-with-apollo/graphql-with-apollo/mocking.md new file mode 100644 index 000000000..49c6fd1a7 --- /dev/null +++ b/backend/graphql-with-apollo/graphql-with-apollo/mocking.md @@ -0,0 +1,8 @@ +# Mocking + +## Mocking API Results + +Alternatively you can just mock all responses from the api which let you build a frontend application without running a neo4j instance. + +Just set `MOCK=true` inside `.env` or pass it on application start. + diff --git a/backend/graphql-with-apollo/graphql-with-apollo/seeding.md b/backend/graphql-with-apollo/graphql-with-apollo/seeding.md new file mode 100644 index 000000000..010607477 --- /dev/null +++ b/backend/graphql-with-apollo/graphql-with-apollo/seeding.md @@ -0,0 +1,20 @@ +# Seeding + +## Seeding The Database + +Optionally you can seed the GraphQL service by executing mutations that will write sample data to the database: + +{% tabs %} +{% tab title="Yarn" %} +```bash +yarn db:seed +``` +{% endtab %} + +{% tab title="NPM" %} +```bash +npm run db:seed +``` +{% endtab %} +{% endtabs %} + diff --git a/backend/middleware.md b/backend/middleware.md new file mode 100644 index 000000000..6a0bf2f57 --- /dev/null +++ b/backend/middleware.md @@ -0,0 +1,12 @@ +# Middleware + + + +## Middleware keeps resolvers clean + +A well-organized codebase is key for the ability to maintain and easily introduce changes into an app. Figuring out the right structure for your code remains a continuous challenge - especially as an application grows and more developers are joining a project. + +A common problem in GraphQL servers is that resolvers often get cluttered with business logic, making the entire resolver system harder to understand and maintain. + +GraphQL Middleware uses the [_middleware pattern_](https://dzone.com/articles/understanding-middleware-pattern-in-expressjs) \(well-known from Express.js\) to pull out repetitive code from resolvers and execute it before or after one of your resolvers is invoked. This improves code modularity and keeps your resolvers clean and simple. + diff --git a/backend/neo4j/Dockerfile b/backend/neo4j/Dockerfile index f6e71811b..a02d41f38 100644 --- a/backend/neo4j/Dockerfile +++ b/backend/neo4j/Dockerfile @@ -1,3 +1,3 @@ -FROM neo4j:3.5.0 +FROM neo4j:3.5.4 RUN wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5.0.1/apoc-3.5.0.1-all.jar -P plugins/ COPY migrate.sh /usr/local/bin/migrate diff --git a/backend/package.json b/backend/package.json index 2e0d7301a..a3f03f1fb 100644 --- a/backend/package.json +++ b/backend/package.json @@ -10,7 +10,7 @@ "dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js -e js,graphql", "lint": "eslint src --config .eslintrc.js", "test": "run-s test:jest test:cucumber", - "test:before:server": "cross-env GRAPHQL_URI=http://localhost:4123 GRAPHQL_PORT=4123 yarn run dev 2> /dev/null", + "test:before:server": "cross-env GRAPHQL_URI=http://localhost:4123 GRAPHQL_PORT=4123 yarn run dev", "test:before:seeder": "cross-env GRAPHQL_URI=http://localhost:4001 GRAPHQL_PORT=4001 DISABLED_MIDDLEWARES=permissions,activityPub yarn run dev", "test:jest:cmd": "wait-on tcp:4001 tcp:4123 && jest --forceExit --detectOpenHandles --runInBand", "test:cucumber:cmd": "wait-on tcp:4001 tcp:4123 && cucumber-js --require-module @babel/register --exit test/", @@ -70,7 +70,7 @@ "wait-on": "~3.2.0" }, "devDependencies": { - "@babel/cli": "~7.2.3", + "@babel/cli": "~7.4.3", "@babel/core": "~7.4.3", "@babel/node": "~7.2.2", "@babel/plugin-proposal-throw-expressions": "^7.2.0", @@ -94,4 +94,4 @@ "nodemon": "~1.18.11", "supertest": "~4.0.2" } -} +} \ No newline at end of file diff --git a/backend/src/middleware/passwordMiddleware.js b/backend/src/middleware/passwordMiddleware.js index 0aff222c8..16272421a 100644 --- a/backend/src/middleware/passwordMiddleware.js +++ b/backend/src/middleware/passwordMiddleware.js @@ -11,10 +11,11 @@ export default { } }, Query: async (resolve, root, args, context, info) => { - const result = await resolve(root, args, context, info) - return walkRecursive(result, ['password'], () => { + let result = await resolve(root, args, context, info) + result = walkRecursive(result, ['password', 'privateKey'], () => { // replace password with asterisk return '*****' }) + return result } } diff --git a/backend/src/middleware/permissionsMiddleware.js b/backend/src/middleware/permissionsMiddleware.js index 4ff334806..549499dcd 100644 --- a/backend/src/middleware/permissionsMiddleware.js +++ b/backend/src/middleware/permissionsMiddleware.js @@ -90,7 +90,8 @@ const permissions = shield({ }, User: { email: isMyOwn, - password: isMyOwn + password: isMyOwn, + privateKey: isMyOwn } }) diff --git a/backend/src/resolvers/user_management.spec.js b/backend/src/resolvers/user_management.spec.js index 1c21adac1..94ec04203 100644 --- a/backend/src/resolvers/user_management.spec.js +++ b/backend/src/resolvers/user_management.spec.js @@ -1,3 +1,4 @@ +import gql from 'graphql-tag' import Factory from '../seed/factories' import { GraphQLClient, request } from 'graphql-request' import jwt from 'jsonwebtoken' @@ -254,7 +255,7 @@ describe('change password', () => { } describe('should be authenticated before changing password', () => { - it('throws not "Not Authorised!', async () => { + it('throws "Not Authorised!"', async () => { await expect( request( host, @@ -309,3 +310,97 @@ describe('change password', () => { }) }) }) + +describe('do not expose private RSA key', () => { + let headers + let client + const queryUserPuplicKey = gql` + query($queriedUserSlug: String) { + User(slug: $queriedUserSlug) { + id + publicKey + } + }` + const queryUserPrivateKey = gql` + query($queriedUserSlug: String) { + User(slug: $queriedUserSlug) { + id + privateKey + } + }` + + const actionGenUserWithKeys = async () => { + // Generate user with "privateKey" via 'CreateUser' mutation instead of using the factories "factory.create('User', {...})", see above. + const variables = { + id: 'bcb2d923-f3af-479e-9f00-61b12e864667', + password: 'xYz', + slug: 'apfel-strudel', + name: 'Apfel Strudel', + email: 'apfel-strudel@test.org' + } + await client.request(gql` + mutation($id: ID, $password: String!, $slug: String, $name: String, $email: String) { + CreateUser(id: $id, password: $password, slug: $slug, name: $name, email: $email) { + id + } + }`, variables + ) + } + + // not authenticate + beforeEach(async () => { + client = new GraphQLClient(host) + }) + + describe('unauthenticated query of "publicKey" (does the RSA key pair get generated at all?)', () => { + it('returns publicKey', async () => { + await actionGenUserWithKeys() + await expect( + await client.request(queryUserPuplicKey, { queriedUserSlug: 'apfel-strudel' }) + ).toEqual(expect.objectContaining({ + User: [{ + id: 'bcb2d923-f3af-479e-9f00-61b12e864667', + publicKey: expect.any(String) + }] + })) + }) + }) + + describe('unauthenticated query of "privateKey"', () => { + it('throws "Not Authorised!"', async () => { + await actionGenUserWithKeys() + await expect( + client.request(queryUserPrivateKey, { queriedUserSlug: 'apfel-strudel' }) + ).rejects.toThrow('Not Authorised') + }) + }) + + // authenticate + beforeEach(async () => { + headers = await login({ email: 'test@example.org', password: '1234' }) + client = new GraphQLClient(host, { headers }) + }) + + describe('authenticated query of "publicKey"', () => { + it('returns publicKey', async () => { + await actionGenUserWithKeys() + await expect( + await client.request(queryUserPuplicKey, { queriedUserSlug: 'apfel-strudel' }) + ).toEqual(expect.objectContaining({ + User: [{ + id: 'bcb2d923-f3af-479e-9f00-61b12e864667', + publicKey: expect.any(String) + }] + })) + }) + }) + + describe('authenticated query of "privateKey"', () => { + it('throws "Not Authorised!"', async () => { + await actionGenUserWithKeys() + await expect( + client.request(queryUserPrivateKey, { queriedUserSlug: 'apfel-strudel' }) + ).rejects.toThrow('Not Authorised') + }) + }) +}) diff --git a/backend/testing.md b/backend/testing.md new file mode 100644 index 000000000..600973450 --- /dev/null +++ b/backend/testing.md @@ -0,0 +1,2 @@ +# Unit Testing + diff --git a/backend/yarn.lock b/backend/yarn.lock index a58f1f865..29de5d201 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -14,22 +14,22 @@ resolved "https://registry.yarnpkg.com/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.6.tgz#022209e28a2b547dcde15b219f0c50f47aa5beb3" integrity sha512-lqK94b+caNtmKFs5oUVXlSpN3sm5IXZ+KfhMxOtr0LR2SqErzkoJilitjDvJ1WbjHlxLI7WtCjRmOLdOGJqtMQ== -"@babel/cli@~7.2.3": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.2.3.tgz#1b262e42a3e959d28ab3d205ba2718e1923cfee6" - integrity sha512-bfna97nmJV6nDJhXNPeEfxyMjWnt6+IjUAaDPiYRTBlm8L41n8nvw6UAqUCbvpFfU246gHPxW7sfWwqtF4FcYA== +"@babel/cli@~7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.4.3.tgz#353048551306ff42e5855b788b6ccd9477289774" + integrity sha512-cbC5H9iTDV9H7sMxK5rUm18UbdVPNTPqgdzmQAkOUP3YLysgDWLZaysVAfylK49rgTlzL01a6tXyq9rCb3yLhQ== dependencies: commander "^2.8.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.1.0" glob "^7.0.0" - lodash "^4.17.10" + lodash "^4.17.11" mkdirp "^0.5.1" output-file-sync "^2.0.0" slash "^2.0.0" source-map "^0.5.0" optionalDependencies: - chokidar "^2.0.3" + chokidar "^2.0.4" "@babel/code-frame@^7.0.0": version "7.0.0" @@ -2149,7 +2149,7 @@ cheerio@~1.0.0-rc.3: lodash "^4.15.0" parse5 "^3.0.1" -chokidar@^2.0.3, chokidar@^2.1.5: +chokidar@^2.0.4, chokidar@^2.1.5: version "2.1.5" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.5.tgz#0ae8434d962281a5f56c72869e79cb6d9d86ad4d" integrity sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A== diff --git a/cypress/README.md b/cypress/README.md new file mode 100644 index 000000000..e55ff22af --- /dev/null +++ b/cypress/README.md @@ -0,0 +1,37 @@ +# End-to-End Testing + +## Run Tests + +To run the tests, make sure you are at the root level of the project, in your console and run the following command: + +```bash +$ yarn cypress:setup +``` + +After verifying that there are no errors with the servers starting, open another tab in your terminal and run the following command: + +```bash +$ yarn cypress:run +``` + + + +After the test runs, you will also get some video footage of the test run which you can then analyse in more detail. + +## Open Interactive Test Console + +If you are like me, you might want to see some visual output. The interactive cypress environment also helps at debugging your tests, you can even time travel between individual steps and see the exact state of the app. + +To use this feature, you will still run the `yarn cypress:setup` above, but instead of `yarn cypress:run` open another tab in your terminal and run the following command: + +```bash +$ yarn cypress:open +``` + + + +## Write some Tests + +Check out the Cypress documentation for further information on how to write tests: +[https://docs.cypress.io/guides/getting-started/writing-your-first-test.html\#Write-a-simple-test](https://docs.cypress.io/guides/getting-started/writing-your-first-test.html#Write-a-simple-test) + diff --git a/cypress/features.md b/cypress/features.md new file mode 100644 index 000000000..eb8292c3b --- /dev/null +++ b/cypress/features.md @@ -0,0 +1,279 @@ +# Network Specification + +Human Connection is a nonprofit social, action and knowledge network that connects information to action and promotes positive local and global change in all areas of life. + +* **Social**: Interact with other people not just by commenting their posts, but by providing **Pro & Contra** arguments, give a **Versus** or ask them by integrated **Chat** or **Let's Talk** +* **Knowledge**: Read articles about interesting topics and find related posts in the **More Info** tab or by **Filtering** based on **Categories** and **Tagging** or by using the **Fulltext Search**. +* **Action**: Don't just read about how to make the world a better place, but come into **Action** by following provided suggestions on the **Action** tab provided by other people or **Organisations**. + +## Features + +The following features will be implemented. This gets done in three steps: + +1. First we will implement a basic feature set and provide a test system to test the basic network functionality. +2. In a second step we will make our prototype publicly available with an advanced feature set including the technology and organizational structure to drive a bigger public social network. +3. In a third step all the remaining features will be implemented to build the full product. + +### User Account + +[Cucumber Features](./integration/user_account) + +* Sign-up +* Agree to Data Privacy Statement +* Agree to Terms of Service +* Login +* Logoff +* Change User Name +* Change Email Address +* Change Password +* Delete Account +* Download User's Content +* GDPR-Information about stored Content +* Choosing Interface Language \(e.g. German / English / French\) +* Persistent Links + +### User Profile + +[Cucumber Features](./integration/user_profile) + +* Upload and Change Avatar +* Upload and Change Profile Picture +* Edit Social Media Accounts +* Edit Locale information +* Show and delete Bookmarks \(later\) +* Show Posts of a specific User +* Show Comments of a specific User + +### Dashboard + +[Clickdummy](https://preview.uxpin.com/24a2ab8adcd84f9a763d87ed27251351225e0ecd#/pages/99768919/simulate/sitemap?mode=i) + +* Show Link to own Profile +* Show Friends Widget +* Show Favorites Widget +* Show Get Friends Widget +* Show popular Hashtags Widget +* Show Mini-Statistics Widget \(all time\) +* Show Chatrooms Widget +* Show List of Let's Talk requests with online status of requesting people + +### Posts + +[Cucumber Features](./integration/post/) + +* Creating Posts +* Persistent Links +* Upload Teaser Picture for Post +* Upload additional Pictures +* Editing Title and Content +* Allow embedded Conten \(Videos, Sound, ...\) +* Choosing a Category +* Adding Tags +* Choosing Language \(e.g. German / English / French\) +* Choosing Visibility \(Public / Friends / Private\) +* Shout Button for Posts +* Bookmark Posts \(later\) +* Optionally provide Let's Talk Feature +* Optionally provide Commenting Feature + +### Comments + +* Creating Comments +* Deleting Comments +* Editing Comments +* Upvote comments of others + +### Notifications +[Cucumber features](./integration/notifications) + +* User @-mentionings +* Notify authors for comments +* Administrative notifications to all users + +### Contribution List + +* Show Posts by Tiles +* Show Posts as List +* Filter by Category \(Health and Wellbeing, Global Peace & Non-Violence, ...\) +* Filter by Mood \(Funny, Happy, Surprised, Cry, Angry, ...\) +* Filter by Source \(Connections, Following, Individuals, Non-Profits, ...\) +* Filter by Posts & Tools \(Post, Events, CanDos, ...\) +* Filter by Format Type \(Text, Pictures, Video, ...\) +* Extended Filter \(Continent, Country, Language, ...\) +* Sort Posts by Date +* Sort Posts by Shouts +* Sort Posts by most Comments +* Sort Posts by Emoji-Count \(all Types\) + +### Blacklist + +[Video](https://www.youtube.com/watch?v=-uDvvmN8hLQ) + +* Blacklist Users +* Blacklist specific Terms +* Blacklist Tags +* Switch on/off Adult Content + +### Search + +[Cucumber Features](./integration/search) + +* Search for Categories +* Search for Tags +* Fulltext Search + +### CanDos + +* Creating CanDos +* Editing Title and Content +* Choosing a Category +* Adding Tags +* Choosing Language \(e.g. German / English / French\) +* Choosing Visibility \(Public / Friends / Private\) +* Choosing Difficulty +* Editing Why - why should you do this +* Editing Usefulness - what is it good for + +### Versus \(interaction on existing Post\) + +* Create / edit / delete Versus + +### Jobs + +* Create, edit and delete Jobs by an User +* Handle Jobs as Part of Projects +* Handle Jobs done by Organizations + +### Projects + +* Create, edit and delete Projects +* Edit Title and Description for the Project +* Set Project Type +* Set and Edit Timeline for the Project +* Add Media to the Project +* Chat about the Project + +### Pro & Contra + +* Create Pro and Con \(2-row\) +* Add Arguments on Pro or Con Side +* Rate up Arguments +* Add Tags +* Attach Media + +### Votes + +* Create Votes \(Surveys with two or more Choices\) +* Add Title and Description +* Let Users vote +* Add Tags + +### Bestlist + +* Create Bestlist +* Create Votes \(Surveys\) +* Add Title and Description +* Add Tags +* Let Users vote for Best Item +* Set Settings \(allow Uploads, allow Links, ...\) + +### Events + +* Create Events +* Add Title and Description +* Choose Date and Location +* Add Tags + +### More Info + +Shows autmatically releated information for existing post. + +* Show related Posts +* Show Pros and Cons +* Show Bestlist +* Show Votes +* Link to corresponding Chatroom + +### Take Action + +Shows automatically related actions for existing post. + +* Show related Organisations +* Show related CanDos +* Show related Projects +* Show related Jobs +* Show related Events +* Show Map + +### Badges System + +* Importing Badge Information \(CSV\) +* Showing Badges +* Badge Administration by Admins +* Choosing Badges to display by User + +### Chat + +* Basic 1:1 Chat functionality + +### Let's Talk + +* Request Let's talk with Author of Post +* Requestor can request private or public Let's Talk +* Requestor can choose the Chat format \(Video, Audio, Text\) +* Interact with interested People 1:1 +* Approve request from Requestor + +### Organizations + +* Propose Organizations by users +* Set Name and Details +* Set Homepage +* Set Region +* Set Topic +* Commit organizations by HC-Org-Team +* Panel for Organisation Handling by themselfes +* Choose/Mark Users as authorized to manage an Organization + +### Moderation + +[Cucumber Features](./integration/moderation) + +* Report Button for users for doubtful Content +* Moderator Panel +* List of reported Content \(later replaced by User-Moderation\) +* Mark verified Users as Moderators +* Show Posts to be moderated highlighted to User-Moderators +* Statistics about kinds of reported Content by Time +* Statistics about Decisions in Moderation + +### Administration + +* Provide Admin-Interface to send Users Invite Code +* Static Pages for Data Privacy Statement ... +* Create, edit and delete Announcements +* Show Announcements on top of User Interface + +### Invitation + +* Allow Users to invite others by Email +* Allow Users to register with Invite Code +* Double-opt-in by Email + +### Internationalization + +[Cucumber Features](./integration/internationalization) + +* Frontend UI +* Backend Error Messages + +### Federation + +* Provide Server-Server ActivityPub-API +* Provide User-Server Activitypub-API +* Receiving public addressed Article and Note Objects +* Receiving Like and Follow Activities +* Receiving Undo and Delete Activities for Articles and Notes +* Serving Webfinger records and Actor Objects +* Serving Followers, Following and Outbox collections + diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 4286849c0..6b04e8e4c 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -228,7 +228,7 @@ Then('I get redirected to {string}', route => { }) Then('the post was saved successfully', () => { - cy.get('.ds-card-header > .ds-heading').should('contain', lastPost.title) + cy.get('.ds-card-content > .ds-heading').should('contain', lastPost.title) cy.get('.content').should('contain', lastPost.content) }) diff --git a/cypress/integration/Internationalization.feature b/cypress/integration/internationalization/Internationalization.feature similarity index 100% rename from cypress/integration/Internationalization.feature rename to cypress/integration/internationalization/Internationalization.feature diff --git a/cypress/integration/notifications/mentions.feature b/cypress/integration/notifications/Mentionings.feature similarity index 100% rename from cypress/integration/notifications/mentions.feature rename to cypress/integration/notifications/Mentionings.feature diff --git a/cypress/integration/identifier/PersistentLinks.feature b/cypress/integration/post/PersistentLinks.feature similarity index 100% rename from cypress/integration/identifier/PersistentLinks.feature rename to cypress/integration/post/PersistentLinks.feature diff --git a/cypress/integration/WritePost.feature b/cypress/integration/post/WritePost.feature similarity index 100% rename from cypress/integration/WritePost.feature rename to cypress/integration/post/WritePost.feature diff --git a/cypress/integration/Search.feature b/cypress/integration/search/Search.feature similarity index 100% rename from cypress/integration/Search.feature rename to cypress/integration/search/Search.feature diff --git a/cypress/integration/settings/ChangePassword.feature b/cypress/integration/user_account/ChangePassword.feature similarity index 100% rename from cypress/integration/settings/ChangePassword.feature rename to cypress/integration/user_account/ChangePassword.feature diff --git a/cypress/integration/Login.feature b/cypress/integration/user_account/Login.feature similarity index 100% rename from cypress/integration/Login.feature rename to cypress/integration/user_account/Login.feature diff --git a/cypress/integration/AboutMeAndLocation.feature b/cypress/integration/user_profile/AboutMeAndLocation.feature similarity index 100% rename from cypress/integration/AboutMeAndLocation.feature rename to cypress/integration/user_profile/AboutMeAndLocation.feature diff --git a/deployment/README.md b/deployment/README.md index f8cff30eb..982a886ac 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -1,34 +1,29 @@ -# Human-Connection Nitro | Deployment Configuration -[](https://travis-ci.com/Human-Connection/Nitro-Deployment) +# Human-Connection Nitro \| Deployment Configuration -Todos: -- [x] check labels and selectors if they all are correct -- [x] configure NGINX from yml -- [x] configure Let's Encrypt cert-manager from yml -- [x] configure ingress from yml -- [x] configure persistent & shared storage between nodes -- [x] reproduce setup locally +We deploy with [kubernetes](https://kubernetes.io/). In order to deploy your own +network you have to [install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +and get a kubernetes cluster. + +We have tested two different kubernetes providers: [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) +and [Digital Ocean](https://www.digitalocean.com/). ## Minikube -There are many Kubernetes distributions, but if you're just getting started, -Minikube is a tool that you can use to get your feet wet. + +There are many Kubernetes providers, but if you're just getting started, Minikube is a tool that you can use to get your feet wet. [Install Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) Open minikube dashboard: -``` + +```text $ minikube dashboard ``` -This will give you an overview. -Some of the steps below need some timing to make ressources available to other -dependent deployments. Keeping an eye on the dashboard is a great way to check -that. -Follow the [installation instruction](#installation-with-kubernetes) below. -If all the pods and services have settled and everything looks green in your -minikube dashboard, expose the `nitro-web` service on your host system with: +This will give you an overview. Some of the steps below need some timing to make ressources available to other dependent deployments. Keeping an eye on the dashboard is a great way to check that. -```shell +Follow the [installation instruction](deployment.md#installation-with-kubernetes) below. If all the pods and services have settled and everything looks green in your minikube dashboard, expose the `nitro-web` service on your host system with: + +```text $ minikube service nitro-web --namespace=human-connection ``` @@ -36,9 +31,9 @@ $ minikube service nitro-web --namespace=human-connection 1. At first, create a cluster on Digital Ocean. 2. Download the config.yaml if the process has finished. -3. Put the config file where you can find it later (preferable in your home directory under `~/.kube/`) +3. Put the config file where you can find it later \(preferable in your home directory under `~/.kube/`\) 4. In the open terminal you can set the current config for the active session: `export KUBECONFIG=~/.kube/THE-NAME-OF-YOUR-CLUSTER-kubeconfig.yaml`. You could make this change permanent by adding the line to your `.bashrc` or `~/.config/fish/config.fish` depending on your shell. - + Otherwise you would have to always add `--kubeconfig ~/.kube/THE-NAME-OF-YOUR-CLUSTER-kubeconfig.yaml` on every `kubectl` command that you are running. 5. Now check if you can connect to the cluster and if its your newly created one by running: `kubectl get nodes` @@ -46,17 +41,21 @@ $ minikube service nitro-web --namespace=human-connection If you got the steps right above and see your nodes you can continue. First, install kubernetes dashboard: -```sh + +```bash $ kubectl apply -f dashboard/ $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml - ``` + Get your token on the command line: -```sh + +```bash $ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') ``` + It should print something like: -``` + +```text Name: admin-user-token-6gl6l Namespace: kube-system Labels:
-
-## Attributions
-
-
-
-## License
-[](https://app.fossa.io/projects/git%2Bgithub.com%2FHuman-Connection%2FNitro-Web?ref=badge_large)
+If you need to change something in the styleguide and want to see the effects on the frontend immediately, then we have you covered. You need to clone the styleguide to the parent directory `../Nitro-Styleguide` and run `yarn && yarn run dev`. After that you run `yarn run dev:styleguide` instead of `yarn run dev` and you will see your changes reflected inside the fronten!
diff --git a/webapp/assets/README.md b/webapp/assets.md
similarity index 99%
rename from webapp/assets/README.md
rename to webapp/assets.md
index 34766f934..06786539d 100644
--- a/webapp/assets/README.md
+++ b/webapp/assets.md
@@ -5,3 +5,4 @@
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
+
diff --git a/webapp/components/README.md b/webapp/components.md
similarity index 99%
rename from webapp/components/README.md
rename to webapp/components.md
index a079f1060..be43ae454 100644
--- a/webapp/components/README.md
+++ b/webapp/components.md
@@ -5,3 +5,4 @@
The components directory contains your Vue.js Components.
_Nuxt.js doesn't supercharge these components._
+
diff --git a/webapp/components/Category/Readme.md b/webapp/components/Category/Readme.md
new file mode 100644
index 000000000..50e07f966
--- /dev/null
+++ b/webapp/components/Category/Readme.md
@@ -0,0 +1,7 @@
+### Example
+
+Category "IT, Internet & Data Privacy" with icon "mouse-cursor"
+
+```
+