Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #20 from zimmerman-team/develop
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
stephanoshadjipetrou authored Dec 17, 2020
2 parents ccc4747 + 0826bb3 commit 754d068
Show file tree
Hide file tree
Showing 53 changed files with 4,652 additions and 2,929 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ workflows:
- deploy
filters:
branches:
only: master
only:
- master
- develop
# adf
18 changes: 18 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 98 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,111 @@
## What is the Insinger Monitoring & Evaluation Tool?
# VIRA

This tool allows you to easily generate reports on the basis of projects that have been co-funded by the Insinger Foundation. After logging in, acces is granted to project information and progress can be reported. These reports allow the Insinger Foundation to monitor the effectiveness of contributions more effectively. The project is split into a front and back-end repository for sake of clear development.
</a>
[![CircleCI](https://circleci.com/gh/zimmerman-team/VIRA.svg?style=svg&circle-token=f1c9c39b17f9c53166ffa2440e707cd75aaab5d5)](https://circleci.com/gh/zimmerman-team/VIRA)

## What VIRA?

This tool allows you to easily generate reports on the basis of projects that have been co-funded by your foundation. After signing in, access is granted to project information and the progress can be reported. These reports allow your foundation to monitor the effectiveness of contributions more effectively.

## About the project

- Website: Private
- Authors: <a href="https://www.zimmerman.team/" target="_blank">Zimmerman</a>
* License: AGPLv3
- Github Backend Repo: <a href="https://github.com/zimmerman-zimmerman/insinger-backend" target="_blank">github.com/zimmerman-zimmerman/insinger-backend</a>
- Github Frontend Repo: <a href="https://github.com/zimmerman-zimmerman/insinger-frontend" target="_blank">github.com/zimmerman-zimmerman/insinger-frontend</a>
- Authors: <a href="https://www.zimmerman.team" target="_blank">Zimmerman</a>
- License: AGPLv3
- Github Backend Repo: <a href="https://github.com/zimmerman-team/VIRA" target="_blank">github.com/zimmerman-team/VIRA</a>
- Github Frontend Repo: <a href="https://github.com/zimmerman-team/VIRA.frontend" target="_blank">github.com/zimmerman-team/VIRA.frontend</a>

---

## Requirements

For development, you will only need Node.js and a node global package, Yarn, installed in your environement.

### Node

- #### Node installation on Windows

Just go on [official Node.js website](https://nodejs.org/) and download the installer.
Also, be sure to have `git` available in your PATH, `npm` might need it (You can find git [here](https://git-scm.com/)).

- #### Node installation on Ubuntu

You can install nodejs and npm easily with apt install, just run the following commands.

$ sudo apt install nodejs
$ sudo apt install npm

- #### Other Operating Systems
You can find more information about the installation on the [official Node.js website](https://nodejs.org/) and the [official NPM website](https://npmjs.org/).

If the installation was successful, you should be able to run the following command.

$ node --version
vX.X.X

$ npm --version
X.X.X

If you need to update `npm`, you can make it using `npm`! Cool right? After running the following command, just open again the command line and be happy.

$ npm install npm -g

###

### Yarn installation

After installing node, this project will need yarn too, so just run the following command.

$ npm install -g yarn

###

### MongoDB installation

You can follow the official [documentation](https://docs.mongodb.com/manual/installation/#mongodb-community-edition-installation-tutorials) to install MongoDB in your preferred OS.
Just make sure that you install version 4.x.x of MongoDB

---

## Install

$ git clone https://github.com/zimmerman-team/VIRA.git
$ cd VIRA
$ yarn install

## Configure app

Create an `.env` file in the root directory and add the following:

```
REACT_APP_AE_API_CLIENT_ID=<Auth0 Authentication Extension API client id>
REACT_APP_AUTH_DOMAIN=<Auth0 tenant custom domain>
REACT_APP_AE_API_CLIENT_SECRET=<Auth0 Authentication Extension API client secret>
REACT_APP_AE_API_URL=<Auth0 Authentication Extension API URL>
REACT_APP_POSTMARK_CLIENT_ID=<Postmark client id>
REACT_APP_POSTMARK_TEMPLATE_WELCOME=<Postmark welcome email template id>
REACT_APP_POSTMARK_TEMPLATE_RESET=<Postmark reset password template id>
REACT_APP_POSTMARK_TEMPLATE_NOTIFICATION=<Postmark project notification email template id>
REACT_APP_PROJECT_URL=<http://localhost:3000 for running locally | https://something.com for deployed runs>
REACT_APP_BACKEND_PORT=4200
REACT_APP_BACKEND_URL=http://localhost:4200
REACT_APP_MONGO_DB_URL=mongodb://localhost:27017/vira
REACT_APP_DATA_FILE=<name of the data file in server/scripts, must be a csv file>
```

## Parse data

$ yarn import-data

## Installing
## Create and invite users based on data

REPLACE WITH STEFANOS INSTRUCTIONS INCLUDING :
$ yarn check-invite-new-users

- NEED FOR THAT FRONT_END
- IMPORT OF DATA FILE TO POPULATE
- AUTH0 WORKINGS
- CRONJOBS FOR THEM E-MAILS
## Running the project

## Can I contribute?
$ yarn start

Yes! We are mainly looking for coders to help on the project. If you are a coder feel free to _Fork_ the repository and send us Pull requests!
## Run tests

$ yarn start-test-api
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@
},
"release": {
"branches": [
"master"
"master",
{
"name": "develop",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down
100 changes: 55 additions & 45 deletions server/api-routes.ts
Original file line number Diff line number Diff line change
@@ -1,77 +1,87 @@
const router = require('express').Router();
const SDG = require('./models/sdg');
const Pillar = require('./models/pillar');
const PolicyPriority = require('./models/policyPriority');
const orgController = require('./controllers/OrgController');
const projectController = require('./controllers/ProjectController');
const orgTypeController = require('./controllers/OrgTypeController');
const projectCategoryController = require('./controllers/ProjectCategoryController.ts');
const responsiblePersonController = require('./controllers/ResponsiblePersonController');
// const SearchController = require('./controllers/SearchController');
// const VizController = require('./controllers/VizController');
import { uploadFiles } from './utils/upload';

router.get('/', (req: any, res: any) => {
res.json({ status: 200, message: 'api working' });
});

// router.route('/search').get(SearchController.generalSearchAPI);
router.route('/organisation').get(orgController.allOrg);

router
.route('/organisation')
.get(orgController.allOrg)
.post(orgController.AddOrg);
router.route('/organisation/:_id').get(orgController.oneOrg);

router
.route('/organisation/:_id')
.get(orgController.oneOrg)
.put(orgController.UpdateOrg)
.delete(orgController.DelOrg);
router.route('/project').get(projectController.allProject);

router
.route('/project')
.get(projectController.allProject)
.post(projectController.addProject);
router.route('/project/:_id').get(projectController.oneProject);

router
.route('/project/:_id')
.get(projectController.oneProject)
.put(projectController.UpdateProject)
.delete(projectController.DelProject);
router.route('/org_type').get(orgTypeController.allOrgType);

router
.route('/org_type')
.get(orgTypeController.allOrgType)
.post(orgTypeController.addOrgType);

router
.route('/org_type/:_id')
.get(orgTypeController.oneOrgType)
.put(orgTypeController.UpdateOrgType)
.delete(orgTypeController.DelOrgType);
router.route('/org_type/:_id').get(orgTypeController.oneOrgType);

router
.route('/project_category')
.get(projectCategoryController.allProjectCategory)
.post(projectCategoryController.addProjectCategory);
.get(projectCategoryController.allProjectCategory);

router
.route('/project_category/:_id')
.get(projectCategoryController.oneProjectCategory)
.put(projectCategoryController.UpdateProjectCategory)
.delete(projectCategoryController.DelProjectCategory);
.get(projectCategoryController.oneProjectCategory);

router
.route('/responsible_person')
.get(responsiblePersonController.allPerson)
.post(responsiblePersonController.AddPerson);
router.route('/responsible_person').get(responsiblePersonController.allPerson);

router
.route('/responsible_person/:_id')
.get(responsiblePersonController.onePeron)
.put(responsiblePersonController.UpdatePerson)
.delete(responsiblePersonController.DelPerson);
.get(responsiblePersonController.onePeron);

router.route('/sdgs').get((req: any, res: any) => {
SDG.get((err: any, sdgs: any) => {
if (err) {
res.json({
status: 'error',
message: err.message,
});
}
res.json({
data: sdgs,
});
});
});

router.route('/upload').post(uploadFiles);
router.route('/policy-priorities').get((req: any, res: any) => {
PolicyPriority.get((err: any, pp: any) => {
if (err) {
res.json({
status: 'error',
message: err.message,
});
}
res.json({
data: pp,
});
});
});

// router.route('/getpp').get(VizController.getPolicyPriorityBarChartAPI);
router.route('/pillars').get((req: any, res: any) => {
Pillar.get((err: any, pillars: any) => {
if (err) {
res.json({
status: 'error',
message: err.message,
});
}
res.json({
data: pillars,
});
});
});

router.route('/upload').post(uploadFiles);

module.exports = router;

Expand Down
33 changes: 26 additions & 7 deletions server/assets/mock/policyPriorities.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
export const policyPriorities: { label: string; value: string }[] = [
{ label: 'charts.items.refugees', value: 'Refugees' },
{ label: 'charts.items.drug_use', value: 'Drug use' },
{ label: 'charts.items.elderly', value: 'The Elderly' },
{ label: 'charts.items.prostitution', value: 'Prostitution' },
{ label: 'charts.items.refugees', value: 'Helping refugees' },
{
label: 'charts.items.drugs',
value: 'Reducing drug abuse & helping drug addicts',
},
{ label: 'charts.items.sustainability', value: 'Sustainability' },
{ label: 'charts.items.prostitution', value: 'Reducing forced prostitution' },
{
label: 'charts.items.poverty',
value: 'Poverty reduction with a focus on youth and children',
value: 'Poverty reduction',
},
{
label: 'charts.items.emancipation',
value: 'Emancipation of women and girls',
},
{ label: 'charts.items.homelessness', value: 'Homelessness' },
{
label: 'charts.items.prisoner',
value: 'Prisoner rehabilitation / reintegration',
value: 'Prisoner rehabilitation',
},
{
label: 'charts.items.children_youth_engagement',
value: 'Children & Youth engagement',
},
{
label: 'charts.items.vulnerable_groups',
value:
'Vulnerable groups in society (i.e. lower-income, elderly, disabled)',
},
{
label: 'charts.items.heritage',
value: 'Cultural heritage',
},
];
19 changes: 19 additions & 0 deletions server/assets/mock/sdgColors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const sdgColors = {
1: '#E5243D',
2: '#DDA73B',
3: '#4CA146',
4: '#C7212F',
5: '#EF402E',
6: '#28BFE6',
7: '#FBC412',
8: '#A31C44',
9: '#F26A2E',
10: '#E01383',
11: '#F89D2A',
12: '#BF8D2C',
13: '#407F46',
14: '#1F96D4',
15: '#59BA47',
16: '#136A9F',
17: '#14496B',
};
9 changes: 9 additions & 0 deletions server/assets/mock/targetGroupColors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const targetGroupColors = {
'Children & youth (up to +/- 30 years)': '#DBA74A',
'The Elderly (65+)': '#DD1481',
'Women & Girls': '#A01D45',
Refugees: '#54A353',
'People with lower income': '#E12540',
'Homeless people': '#EB4137',
'People with disabilities': '#C42233',
};
1 change: 1 addition & 0 deletions server/assets/static/pillars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["Pillar 1: Social good", "Pillar 2: Cultural heritage"]
11 changes: 11 additions & 0 deletions server/assets/static/policyPriorities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
"Poverty reduction",
"Children & Youth engagement",
"Vulnerable groups in society",
"Helping refugees",
"Reducing forced prostitution",
"Reducing drug abuse & helping drug addicts",
"Emancipation of women and girls",
"Prisoner Rehabilitation",
"Sustainability"
]
Loading

0 comments on commit 754d068

Please sign in to comment.