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
- Create users (administrator, politician and accredited user type);
- Consult users;
- Edit users;
- Delete users;
- Consult records;
Anonymous (unregistered citizen)
- Create account;
- Consult records.
Accredited user
- Register Entities (Politicians, Companies, …);
- Record relationships between entities (reasons, events, contract values, …);
- Consult relationships;
- Insert votes in the lists made (do not allow voting for the same).
Registered citizen
- Delete account (deactivate);
- Consult your own data;
- Edit your own data;
- Consult relationships;
- 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
On Chain and Off Chain data
Security
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
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
Login
Recover password
Citizen registration
List of created relations
Vote registration, to cancel the vote the user needs to click again on the button
Search box with autocomplete
Relation details
Relation Comments
User profile part 1
User profile part 2
In case a user tries to vote without having an account
If a user tries to comment without having an account
If the user is accredited, he can add relationships from the FAB
In case the relationship belongs to the user accredited by editing or removing
Edit Relation
Remove Relation
Administrator page
User activity graphs