Code Monkey home page Code Monkey logo

politicatransparente's Introduction

PoliticaTransparente

The objective is to create a web application where we will have several users, these users can be anonymous in case they are not registered, citizen in case the user proceeds to register, if the user is created by the administrator, then the user is accredited which guarantees other privileges and finally the administrator for managing members. If the user has an account on the Platform, he can view the relationships and cast votes, otherwise he will only be able to view, if the user has privileges (is accredited), he can insert relationships.

Administrator

  1. Create users (administrator, politician and accredited user type);
  2. Consult users;
  3. Edit users;
  4. Delete users;
  5. Consult records;

Anonymous (unregistered citizen)

  1. Create account;
  2. Consult records.

Accredited user

  1. Register Entities (Politicians, Companies, …);
  2. Record relationships between entities (reasons, events, contract values, …);
  3. Consult relationships;
  4. Insert votes in the lists made (do not allow voting for the same).

Registered citizen

  1. Delete account (deactivate);
  2. Consult your own data;
  3. Edit your own data;
  4. Consult relationships;
  5. Insert votes in the relationships made.

Website:

Tools references:

The React Framework for Production, Vercel: https://nextjs.org/ A JavaScript library for building user interfaces, React: https://reactjs.org/ Simple, unobtrusive authentication for Node.js, Passaport.js: https://www.passportjs.org/ MongoDB is a document database designed for ease of development and scaling, MongoDB: https://www.mongodb.com/

Architecture

image

On Chain and Off Chain data

Imagem7

Security

Screenshot_2

Hyperledger Fabric Network Configuration

Hyperledger Fabric network:

References:

Creating a Hyperledger Fabric network from scratch — Part IV SDK and Rest API, Iván Alberquilla : https://medium.com/coinmonks/creating-a-hyperledger-fabric-network-from-scratch-part-iv-sdk-and-rest-api-29594e89fefa Hyperledger Fabric SDK for Node.js, Hyperledger: https://github.com/hyperledger/fabric-sdk-node  Configuração multi-organizacional microfab, IBM-Blockchain: https://github.com/IBM-Blockchain/microfab

Screenshot_3

hla

To configure our network, we enter the project directory through WSL and execute the following code.

export MICROFAB_CONFIG='{"port": 8080,"endorsing_organizations":[{"name": "Admin"},{"name": "Credenciado"},{"name": "Cidadao"},{"name": "Anonimo"}],"channels":[{"name":"mychannel","endorsing_organizations":["Admin","Credenciado","Cidadao","Anonimo"]}]}'

And then we create the image in Docker

docker run -e MICROFAB_CONFIG -p 8080:8080 ibmcom/ibp-microfab:0.0.11

The smart contracts can be fund on contract folder

Check the references above.

To run the next project:

Install project:

install nvm sudo apt install curl curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

install node v12.13.1 install node v12.22.0 at least(need to run project) nvm install v12.13.1 nvm install v12.22.0

git clone https://github.com/SergioRCarvalho/PoliticaTransparente.git

open project

nvm use v12.13.0 npm install

now you can run project: npm use v12.22.0 next dev

Interfaces

Home page

Imagem8

Login

Imagem9

Recover password

Imagem10

Citizen registration

Imagem11

List of created relations

Imagem12

Vote registration, to cancel the vote the user needs to click again on the button

Imagem13

Search box with autocomplete

Imagem14

Relation details

Imagem15

Relation Comments

Imagem16

User profile part 1

Imagem17

User profile part 2

Imagem18

In case a user tries to vote without having an account

Imagem19

If a user tries to comment without having an account

Imagem20

If the user is accredited, he can add relationships from the FAB

Imagem21

In case the relationship belongs to the user accredited by editing or removing

Imagem22

Edit Relation

Imagem23

Remove Relation

Imagem24

Administrator page

Imagem25

User activity graphs

Imagem26

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.