This project is a proof of concept for a digital certificate system using Algorand blockchain.
Explore the website »
Report Bug
·
Request Feature
Table of Contents
Our project is a proof of concept for a digital certificate system using Algorand blockchain. The main goal of this project is to provide a secure and reliable way to issue and verify digital certificates. The project is composed of two parts: the website and the blockchain. The website is used to issue and verify certificates. The blockchain is used to store the certificates and to verify the authenticity of the certificates.And this solution is unique because of several reasons:
Here's why:
-
We are trying to think outside the box by innovating a brand new E-Certificate solution, which will replace both automatic signature and traditional signature to introduce blockchain and web 3.0 in this product.
-
We are trying to solve the problem of certificate forgery by using blockchain technology.
-
In terms of performance and ease, adopting this solution will help university staff reduce the time spent signing and reviewing diplomas generated for thousands of students each year.
We are thriving to see the next generation of our major IRISI, for computer science and networking, to finish this piece of art with more features and a better user experience. And why not witnessing someday our University being the first to use this technology in the Kingdom of Morocco.
Here are the main technologies used in this project:
In this section, we will explain how to setup the project locally.
You should have installed nodejs and npm on your machine. You can download them from here, and the versions used in this project are > 14.0 and > 8.0 respectively. or yarn
-
node
node -v
-
npm
npm -v
-
yarn
yarn -v
The next thing to make sure you have is mysql or postgres installed in your machine . postgres v14 or mysql > 5
Below you will be instructed how to setup the project locally.Our project is divided into three parts
- Frontend
- Backend
- Local-server
-
Create a folder locally named e-certificate-fstg
-
Clone the repo for frontend
git clone https://github.com/abderox/e-certificate-signature-algorand
-
Install NPM packages (If you are facing issues with npm , use yarn)
npm install
or
yarn install
-
Go to
utils/global-constants.js
and uncomment this line to work locally .//const BASE_URL_API = "http://127.0.0.1:7000/api"; const BASE_URL_API = "https://thawing-lake-25095.herokuapp.com/api";
-
Now clone the backend repository
git clone https://github.com/kaoutar-ou/e-certificate-signature-algorand-backend
- Note : the branch named mysql contains the backend project , the branch renowned local-server , contains the code for retrieving the mac address from your laptop (We will explain that later)
-
Install NPM packages (ensure you are in the mysql branch)
npm install
or
yarn install
-
Go to
config/db.js
and change the database credentials to your local database credentials. -
copy
.env.example
to.env
and change the database credentials to your local database credentials. -
Go to
app.js
and changeforce:false
toforce:true
sequelize.authenticate().then(() => { console.log('Connected to database'); sequelize.sync({ force: true }).then(() => { console.log('Database synchronized'); initial(); } ); }).catch((error) => { console.error('Unable to connect to the database', error); });
! Note : this step is important because it will create the tables in your database . Do it once and make sure the tables have been created in your database . After that change force:true to force:false. - In order to avoid dropping the tables each time you run the project
-
Now switch to local-server (We prefer to open in a separate project , it should be running all the time )
+ Note : We prefer to use PM2 , so it could be running even after booting your laptop.
- If you are good with node command go ahead
node index.js
-
PM2 is a process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
-
Check this :
and this
https://www.tecmint.com/enable-pm2-to-auto-start-node-js-app/
-
Install PM2
npm install pm2 -g
-
Start the local-server
pm2 start index.js
-
Check the logs
pm2 logs
-
Stop the local-server
pm2 stop index.js
- Database configuration
If you are using MySQL
- Run mysql server in your XAMPP or WOMP server
- Go to phpmyadmin
- Create a database named what you have have called it in the
.env
file .
If you are using Postgres
- Go to pgadmin
- Create a database named what you have have called it in the
.env
file .
- Now you can run the project locally by running the following commands in three different terminals:
Run node backend server
npm run start
Run react frontend server
npm start
Run local-server
pm2 start index.js or node index.js
If everything is working fine , you should be able to see the following page :
The first time running the project , make sure your tables are created successfully.
! Note : This may not be the last version of our database , it is just to make things evident as clear as day. the screenshot below was taken from pgAdmin.
-
app.js : The main file of the project , it contains the main logic of the project , it is the entry point of the project.
-
config : Contains the database configuration file
-
.env : contains environment variables for from database configuration to blockchain configuration .
-
controllers : Contains the controllers of the project , each controller is responsible for a specific common tasks. for example
- auth.controller.js : Contains the logic of the authentication process , it is responsible for the login and register process.
- process.controller.js : Contains the logic of the certificate process , it is responsible for the creation and verification process.
- blockchain.controller.js : Contains the logic of the blockchain process , it is responsible for the blockchain creation and verification process.
-
middlewares : Contains the middlewares of the project , each middleware is responsible for a specific task . For instance
- auth.js : Contains the logic of the authentication process , it is responsible for the login and register process.
- upload.js : contains the logic of excel files uploading .
-
models : Contains the models of the project , each model is responsible for a specific task . Fo example
- User.js : Contains the logic of the user model .
- Etudaint.js : Contains the logic of the Etudaint model .
- University.js : Contains the logic of the University model .
-
routes : Contains the routes of the project , each route is responsible for a specific task . For example .
- algo.js : Contains the logic of the blockchain process .
- process.js : Contains the logic of the certificate process , it is responsible for the creation and verification process.
-
utils : Contains the utils of the project , each util is responsible for a specific task . For example
- user.js : Contains commonly used methods , like password or email generation .
- index.js : Contains the logic of the certificate process pure methods , like QR generation , certificate generation .
-
- canvas : Contains the templates for certificates (currently we are using the
certif_7.png
andcertif_8.png
)
- canvas : Contains the templates for certificates (currently we are using the
-
- index.hbs : is the default html template engine we have created to inject data (student information) dynamically into the certificate.
- hbs : stands for handlebars
- index.hbs : is the default html template engine we have created to inject data (student information) dynamically into the certificate.
- index.js : Nothing biggy , Only to make sure the user roles are created before registering new users.
-
-
src : Contains the source code of the project , it is the entry point of the project.
-
- Nothing doggy , it Contains the logic of communication with the server using REST API , thanks to axios lirary.
-
- Contains the logic of the hooks , each hook is responsible for a specific task . For example *For this project luckily , there is only one simple hook , No need to disturb yourself with this folder 😉
-
- Contains the logic of the layout , each layout is responsible for a specific task . like sidebar , profile section , wallet section ...
-
- Just to make things clear and neat . Using the same menu component , we can specify for each actor (user with roles) , the authorized features and functionalities he is able to see and use . For example 🔽
the super admin can create both admins and students so ⬇️
the admin can only create students ⬇️
-
- In this folder we have specified for each actor , the authorized paths he could access , depending on his roles.
- This is easy to manipulate and modify , You need just to understand a bit the architecture we been following.
-
- In this project we have been manipulating the concept of centralized store for state management and we have chosen Redux
- The
actions.js
file contains all the constants for the actions . - The files which end with
***Action.js
contains the logic of the action.js. - The files which end with
***Reducer.js
contains the logic of the reducer. reducer.js
combine all the reducers of the applicationindex.js
for store creation .
-
- contains the reusable components like loaders , accordions , cards ...
-
- Contains boiler-plate functions and global constants ...
-
- Contains the views (pages ) it is what the end user see, (combines all of the components , actions , assets .. etc)
-
-
- package.json : contains the dependencies of the project.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/Enhancement
) - Commit your Changes (
git commit -m 'Add some Enhancements'
) - Push to the Branch (
git push origin feature/Enhancement
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Links:
We would like to thank our (teacher| client) Mr. Omar Bencharef for his support and guidance throughout the project.
We acknowledge these following (open-source| free) use technologies for their contributions to the open source community.
And not to mention the special thanks for the outstanding community stackoverflow for its survival tips and guidance throughout this project.