A networking, knowledge sharing and collaboration platform for the Circular Economy 100 network, an Ellen MacArthur Foundation programme.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
fixtures
migrations
mock-data
public
rollback
server
tags
templates
test
.env.template
.eslintignore
.gitignore
.travis.yml
LICENSE
Procfile
README.md
android-icon-144x144.png
android-icon-192x192.png
android-icon-36x36.png
android-icon-48x48.png
android-icon-72x72.png
android-icon-96x96.png
apple-icon-114x114.png
apple-icon-120x120.png
apple-icon-144x144.png
apple-icon-152x152.png
apple-icon-180x180.png
apple-icon-57x57.png
apple-icon-60x60.png
apple-icon-72x72.png
apple-icon-76x76.png
apple-icon-precomposed.png
apple-icon.png
browserconfig.xml
callMigrations.js
favicon-16x16.png
favicon-32x32.png
favicon-96x96.png
favicon.ico
manifest.json
migrations.js
ms-icon-144x144.png
ms-icon-150x150.png
ms-icon-310x310.png
ms-icon-70x70.png
package.json
technical.md

README.md

cello

Build Status codecov dependencies Status devDependencies Status

See here for the technical readme!

A networking, knowledge sharing and collaboration platform for the Circular Economy 100 network, an Ellen MacArthur Foundation programme.

Why?

To connect the members of the CE100!

Who?

see: https://www.ellenmacarthurfoundation.org/ce100

What?

A micro-social network focussed on connecting people in the Circular Economy.

How? (Implementation Notes)

This project uses the following technologies:

Running the Project Locally

Clone the GitHub Repository

git clone https://github.com/emfoundation/ce100-app.git

Run & create the following Postgres Databases

//run database using
postgres -D /usr/local/var/postgres
//create the following databases
create database ce100;
create database ce100_test

Run Redis

redis-server

Ensure you have the required .env file, then run:

npm i
npm start

Required Environment Variables

If you are unsure what an Environment Variable is, see: https://github.com/dwyl/learn-environment-variables

create a file in the root of the project called .env

JWT_SECRET=
TEMPLATE_DIRECTORY=./server/email-templates
SENDER_EMAIL_ADDRESS=
AWS_REGION=eu-west-1
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
ROOT_URL=
S3_REGION=
S3_BUCKET=

remember to add the appropriate values to these keys.

Note: if you are a team member ask for access to the .env Google Doc!

Running the Tests

To run the tests locally you will need to have a running Redis instance. Then simply open a terminal window and type and run the following command:

npm test

Executing a Single Test

If you are attempting to debug or extend a single test, you can run a single test file by executing it as node script. e.g:

node test/auth/auth.test.js

HTTP/HTTPS (Admin)

Once the domain's HTTP/TCP protocol has been decided on, it might make sense to change isSecure: false on line5 of server/auth.js

Questions?

If you have any questions, please raise an issue: https://github.com/emfoundation/ce100-app/issues

Features

Browse types of tag and tags

  • /orgs/tags
  • /challenges/tags
  • /insights/tags

Display all the tags by categories (or type of tags): image

Clicking on a category will display the list of tags linked to this category: image

Each tag is a link to the filter organisations or challenges pages

Browse insights, organisations and challenges

  • /orgs
  • /challenges
  • /insights

Clicking on 'Explore' in the left side of the bottom-nav, will take you to a page where, by default, all orgs will be displayed. Both active and inactive orgs/insights will be displayed to admin, but only active orgs and insights will be displayed to primary and secondary users. This view displays only the organisation names; for more information, click on the name of an organisation, and you will be taken to their profile.

If the connected user is an admin the view displays on the left a green or red button which indicates if the organisation is active or inactive

To view and browse challenges or insights instead, click on the 'Challenges' or 'Insights' navigation option; this will take you to a page where all challenges/insights will be displayed. Active and archived challenges from active organisations will be displayed to both admin and the primary user of a given organisation. Secondary? Challenges will list the title and company it was shared by. Clicking on a challenge title will take the user to that challenge's view.

Filter organisation and challenges by selected tag

  • /orgs?tag=id_of_the_filter_tag
  • /challenges?tag=id_of_the_filter_tag
  • /insights?tag=id_of_the_filter_tag

Selecting one of the tags from the browse tag view will filter the organisations or challenges depending on the type of the page the user is on. The list of organisations (or challenges) are all the items where the tag selected is also linked on:

If no organisations or challenges are linked to the selected tag the view will inform the user that no items have been found:

Edit tags linked to an organisation

  • /orgs/{idOrg}/tags

This view allows a user to change the tags linked to an organisation by selecting or unselecting them.

Permissions: Only an admin and the primary user of the organisation can change the tags linked to the organisation.

View all users

  • /people

Clicking on 'People' in the right side of the top-nav, will take you to a page where all users will be displayed. Both active and inactive users will be displayed for admin, but only active users will show for primary users.

Edit Challenge (Title, description, tags)

  • /challenges/{id}/edit

The title and description of a challenge can be edited. You must either be the primary user of the organisation or an admin to do this. If you have editing rights, you will see a 'pencil icon' at the top right corner of each challenge card. Clicking this will allow you to view your current challenge details, but also edit and submit an update on the challenge title and description.

Admin adds a user

  • /people/add

Admins can create a new user by clicking on the + Add. They can input details about the new user, upload a profile photo for them, select the user type, and 'link' them to an organisation. The user types are admin, content-owners, primary and secondary. Admins and content-owners are not connected to organisations. An organisation can only have one primary user but can have as many secondary users as they wish.

Edit a user

  • /people/{id}/edit

Primary users and admins have different scopes of editing permissions. Primary users can only edit their profile. Admins can edit any user's profile. Primary users can edit their first name, last name, job title and phone. Admin users can also edit email.

primary user edit settings page 1

primary user edit settings page 2

admin edit a user's settings page 1

admin edit a user's settings page 2

Archive/Unarchive challenges

  • /challenges/{id}/toggle-archive

Primary users and admins can make a challenge visible/invisible to other members of the platform by clicking on 'Archive/Unarchive Challenge', on editing your challenge.

Archived challenges

  • /orgs/{id}/archived-challenges

Primary and secondary users can navigate to their organisation's archived challenges from their organisation's profile view, admins can do this for any organisation from the organisation profile:

Archived challenges are displayed in case the primary user or admin wants to unarchive and make them accessible to other members:

If there are no archived challenges:

Activate Account

  • /people/activate/{id}

After a user is created by an admin, they will be sent an email with a link to the account activation page where the user has to create a password.

activate-view

Request password reset email

  • /password-reset

From login or user settings, a user can request to change their password. They need to enter their email and will be sent a link to the reset password view. The link will only remain active for 5 minutes.

request-password-reset

Add new challenge

  • /challenges/add

A new challenge can be created on behalf of an existing organisation, by the primary user of that organisation. Admins cannot create new challenges. On clicking the 'Add Challenge' button in the centre of the bottom nav, users will be directed to a page to write the title, description and to add tags to a challenge. When they then click Save & Publish the challenge will be visible by other users.

Insights (adding, editing, archiving and viewing)

  • /insights
  • /insights/tags

Insights come from the DAM API. They can be viewed by all users.

Maintenance Mode (Admin)

If the DAM API is down for maintenance, Admins can turn on maintenance mode, using the admin settings page. This will display a message to users explaining that insights cannot currently be shown. Tags will still work, as we are caching them using Redis.

Admin Settings

Redash, the data management dashboard

We have set our data up on Redash as an MVP dashboard (see #897). To view the project data you must view an existing query or create a new one.

To create a new query

Queries should be written in SQL to extract the desired information. Note: queries are directly with the live data source, so if you edited/add/delete anything you are impacting the live data. The results / data from all queries can be downloaded into excel or csv files which may be safer alternative if you're concerned about changing the live data.

To set up a new query go to: image

Give your query a name and a description to help others understand what it does. Then write your SQL in the text area e.g. SELECT * FROM your-table-name; to get all of the data from a given table: image Conveniently, Redash provides you with the schema of your database so you can look up table and column names by exploring the box on the left hand side.

Once you've written your query click 'Execute' and then wait until the results of your query are displayed below:

image

If you wish to keep your query so it can be rerun in the future click 'Save', it will then appear in your list of queries. You can also see the option to download this content as a .csv or excel file on the right in case you wish to share the results with others.