Giter Site home page Giter Site logo

hasadna / open_pension Goto Github PK

View Code? Open in Web Editor NEW
17.0 24.0 18.0 77.19 MB

:chart_with_upwards_trend: Open Pension is a "Hasadna" project, that aimed to revealing the secrets behind the Israeli pension market.

License: BSD 3-Clause "New" or "Revised" License

Python 0.77% TypeScript 50.00% JavaScript 25.50% HTML 0.40% Shell 2.11% Dockerfile 0.56% Go 11.77% SCSS 8.90%

open_pension's Introduction

Open Pension

Open pension is a project which aims to provide an easy way for people to explore where the money from the pension funds invested is invested. The project belong to the "Hasadna" project - an NPO which thrives for clreance and opening the data.

Revealing where the money is invested and by whom helps to find out which hidden motives play roles in managing the money.

Project structure

diagram-improved

The project uses a microservice's architecture:

Front

This is the site which allow the users to watch where the money is invested, graphs to present data, links to the articles and more. The service uses NextJS which help us to use static pages when needed and SSR when need to display live content (like graphs and more).

Monthly

The monthly process XML files and process them to data which we can process later on. The data is processed on a MySQL server. We're using NodeJS, GraphQL and Prisma.io for that.

Storage

Since we don't know where we're going to host the service (AWS, google cloud, azure...), the service receives files, or listen to kafka events for download files from other services, and store them on a physical drive. Each file get a storage ID which helps us to track where the file was stored or what data which processed is relates to. The service is written in go and use MySQL for store the data.

Backoffice

The service help us to orchestrate the other services: upload new files for processing, create users, manage content and more. The service is using react for the content, mongo for storing users and other data and allow us to see how a file was processed.

Backoffice backend

This is the backend for the backoffice. Written in NodeJS, GraphQL, MongoDB.

Pre requirements:

You'll need to install:

  • Docker
  • nvm - Most of the servies works with node version of 14.17.3
  • Go lang

Start working with the services:

The docker machine are already ready for development. You can have two options:

Turn on all the services

This will fire up all the services. This one is a good options if you need to run them all:

docker-compose up -d```  
  
### Turn on a specific service:  
There are a couple of services that we are handling: `monthly`, `storage`, `monthly`, `backoffice`, `backoffice_bakend`  
  
For that all you need to do:  
```bash  
docker-compose up -d monthly # But you can go with the other service which mentioned above.

Developing the front

For now, the front has a couple of technical issues to be developed under a docker instance. So you need to go to the front folder and install. It's basically goes like this:

cd front
npm inpm run dev

Data seed

After everything is all set up, you need to have two thing: a user to admin and some dummy data in the monthly DB.

Creating user

login to the backoffice backend:

docker-compose up exec backoffice_backend bashnpm run cli:createUser

You would then go through questions for the credentials of the user. Remember, this must be a very strong password.

Seeding the monthly DB

Unlike the admin user, the seeding data is good for playing around with the monthly service. It's not a must but good
when we need to develop the project:

docker-compose up exec monthly bashnpm run dummySeed

Accessing the services:

  • backoffice - http://backoffice.localhost/
  • backoffice_backend - http://backoffice-api.localhost/
  • monthly - http://monthly.localhost/
  • storage - http://storage.localhost

Cheatsheets:

Here are some couple of command lines snippets which can help you work with the services:

Kafka

./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --whitelist '.*'./bin/kafka-topics.sh --bootstrap-server localhost:9092 --list

Debugging

If you need to debug, you can run your local backend with the next mongo address:
mongodb://localhost:27017/open_pesion_dashboard

open_pension's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open_pension's Issues

Fix the router.

  • Upgrade to RC3.
  • Fix the router.
  • Add a child route for managing-bodies component.

Handling CORS

Can't do a get request from angular, get a cross-origin error.

Adding semantic ui front end.

https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css
https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.js

Research css architecture options

in this tutorial they include the component's styling in a file that they import in the component:

screen shot 2016-05-28 at 10 56 59 am

I like the idea, it makes the idea of reusable components stronger
Do we want to work like this too?

they also use something like shadow css (i think.... or what is the :host selector)
would be nice if someone can research this option

screen shot 2016-05-28 at 10 59 37 am

Refactor ManagingBody model.

  • Move the ManagingBody model to a separate file (from ManagingBody.service).
  • Change it from export interface.. to export class...

Finish create Docker.

  • Container for the database - PostgreSQL.
  • Container for the back end - Django.
  • Container for the front end - Angular 2.
  • Container for the server - Nginx.

Refactor ManagingBody.

  • Move managing-body-list, managing-body, managing-body-detail, to one directory called managing-bodies.

Handle translation on the managing body endpoint

Since the label field is now translated on the Managing Body model, we should return all the available translations on the endpoint.

@nirgn975
Not sure if we should return all translations or just the relevant one dependent on the user request ...

Create a wiki

Write a wiki with Moses, and docs for the models.

Miscellaneous

  • In every component, delete the element selectors we don't use.
  • Delete the provider from managing-body-list and add it to the app.ts.
  • move the managing-body-list component from the component directory to the app directory (delete the components directory).
  • Add a space between the import of the components (like from {Observable} to { Observable }) In link
  • Make sure every component selector start with op-.

Create a "Send Feedback" link.

Create a "send feedback" Popup (/Modal dialog) with a name, email and text inputs, for people send us email with feedback about the website.
Don't forget to add there a "Send" button to send it to us.

Just create the dialog component and the logic to pop it up, don't worry about sending an email, we'll handle it later (in another issue).

Refactor to use moduleId

  • Use moduleId: module.id, as the first selector in each component.
  • Remove the app/... from the templateUrl, etc..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.