Installation
Knowledge Needed
A good understanding of docker, docker-compose & nginx
Prerequisites
Docker
Installation instructions for Docker can be found here.
Run docker -v
in terminal to check if docker
has been installed correctly:
Docker Compose
Installation instructions can be found here.
Run docker compose version
in the terminal to check if docker compose
has been installed correctly:
Backend Setup
Getting Code for Backend
Clone the repo
This will create a demo-education-registry folder in the current working directory. Goto that folder
Setting up a Registry Instance
In the demo-education-folder, run the following command
This will start all the required services. Once all the services are started, Go to the browser and open http://localhost:8080/auth/. This will open up the keycloak admin portal. Use username as admin
and password as admin
.
Once logged in, navigate to clients
. Select admin-api
. Go to credentials
tab and click on regenerate secret. Copy this secret. Create a .env file in the project repo and add KEYCLOAK_SECRET
it as an environment variable with the value of the secret in the following format
KEYCLOAK_SECRET=<copied_secret>
Recreate the registry so that it reflects the keycloak secret. This can be done using
If any service has not started you can recreate that service with the same command
Check if all the services are started
Setting up Keycloak
Adding Roles
Open http://localhost:8080/auth/ in the browser and navigate to roles in the left side pane. Click on Add Role.
Create admin
, scholarship
, trial-scholarship
roles
Create admin
user in keycloak
Update the credential for the admin
user. Ex: abcd@123
Assign admin
role to this user
Now you can use the admin
user to create issuers, create schemas, issue VCs and view issued VCs
You can follow the following jupyter notebook which has all the APIs.
Note:-
Schemas for EER are present in the following location
Assign `admin` role to the issuer
An issuer will require
admin
role to create schemas in the registry.Goto keycloak admin console, http://localhost:8080/auth/
Goto
Groups
and double-click onIssuer
If
Issuer
group is not found, then you need to create an issuer first. The APIs to create the issuer is documented in the above jupyter notebook.Goto
Role Mappings
and selectadmin
fromAvailable Roles
and clickAdd Selected
The issuer will require the same roles that are configured in the schema configuration to issue VCs for that schema. In the below sample schema, ScholarshipForTopClassStudents
it requires a user to have scholarship
role. Only if the issuer contains that role then he will be able to issue VC. Similar to the above steps, you can assign the scholarship
roles to the issuer to get access.
Setting up Redash
How to configure
Once all the services are up and running, run the following command
This command will run migrations for redash
Once this is successful, open the http://localhost:5678 in the browser. The following screen should be displayed
You can create the admin user on this screen. Once you create the admin user, the admin user will be displayed. Here you can create a dashboard, queries etc. Create a dashboard and queries here
Connect to the data source
On the home page click on
Connect a Data Source
Search for
Clickhouse
Add these details on the form to set up a connection with Clickhouse
Now that you have connected to Clickhouse, you can create queries. Once a query is created, you can add your visualization for the same.
Create a query and visualization
Create a visualization showing the total number of VCs issued for PreMatricScholarship
schema.
Goto
Queries
tabClick on
Create your first Query
Paste the below query and click on
Save
select count(*) as count from default.prematricscholarship
Rename this query
New Query
toTotal PreMatricScholarship VC Issued
Click on
Save
and click onPublish
Click on
Show Data Only
At the bottom click on
Blue Play Button
Click on
+ New Visualization
Create a visualization with the below values. And click on
Save
Click on
Create
and click onDashboard
. You can give a name to your dashboard and click onSave
Click on
Add Widget
and select the new visualization created. And clickAdd to Dashboard
Click on
Done editing
and click onPublish
Now the dashboard can be shared with other members. Click on
Share
and enablepublic access
and copy the URL and share it with others for viewing the dashboard
Frontend Setup
Navigate to this repository and create a fork & clone https://github.com/Sunbird-RC/federated-education-registry
Navigate to the federated-education-registry folder
Make sure your node and npm versions are - node v16.13.1 (npm v8.1.2)
You can also manage these versions using Node Version Manager
Last updated