Skip to content

unicef/giga-blocks

Repository files navigation

Giga logo

GigaBlocks

GitHub repo size GitHub stars Twitter Follow License

Table of Contents

  1. About Giga
  2. About GigaBlocks
  3. Usage
  4. Getting Started
  5. Contribution Guidelines
  6. Code Design
  7. Code of Conduct
  8. License
  9. Contact
  10. Contributors
  11. Acknowledgements

About Giga

Giga is a UNICEF-ITU global initiative to connect every school to the Internet and every young person to information, opportunity, and choice. By connecting all schools to the Internet, we ensure that every child has a fair shot at success in an increasingly digital world.

About GigaBlocks

GigaBlocks is the world’s largest decentralized database of schools.

The GigaBlocks project represents a transformative approach to harnessing the collective power of the global community to crowd-source data collection, validation and data updating for schools and in the process creating the largest decentralized school database using NFTs.

GigaBlocks aims to solve this problem by crowdsourcing the collection and curation of this missing data and creating a comprehensive database of school information, comparable to a Wikipedia page for each school. By enabling the community surrounding each school to curate and update the data on the NFTs, GigaBlocks hopes to gather accurate and up-to-date information on schools around the world. This will allow Giga to map the need for connectivity more granularly and will help Giga to more effectively connect schools to the internet and provide digital access to young people. Simultaneously, GigaBlocks will create a way for anyone to contribute data to schools, validate and update this data, and become a Giga Supporter.

Project Objective

  • To use the data that's collected to help accelerate connectivity
  • To create a "digital passport" for every school in the world, using NFTs
  • To create a crowdsourcing mechanism for collecting missing school data
  • To engage the public and local communities in Giga countries in the cause of connecting schools to the internet

GigaBlocks System flow Diagram

Giga blocks flow

GigaBlocks School DataBase platform consists of 3 applications:
  • GigaBlocks Admin.
  • GigaBlocks Public.
  • GigaBlocks Backend.

The Backend provides api service for both public and admin sites. Public sites are used by the general public. GigaBlocks Admin will be used by the admins selected by Giga. GigaBlocks Backend uses Prisma service with Next.js. Redis is used for the queueing process. There will be two databases i.e GigaBlocks database and NewsLetter database. GigaBlocks database consists of all school data and contributed data and users registered in GigaBlocks as contributor or admin. Newsletter database is designed to store the records of the user who wants to join the developer community.

Public site and GigaBlocks Admin site is designed using Nest.js frameWork. React- Carbon UI is used for UI design in public sites whereas Material UI is used for UI design in admin sites.

Hosted Subgraph service is used for caching the blockchain transactions and data. Admin and Public site will query blockchain related data from subgraph.

SmartContracts are deployed in Polygon MainNet.

Github Repositories of GigaBlocks

Built With

Our Tech Stacks

  • Database: PostgreSQL

  • UI: CSS/Javascript with Carbon UI framework,CSS/Javascript with Carbon UI framework, React.js, Ethers.js, NextJs

  • Programming Language: JavaScript, Typescript

  • Server: NestJs

  • Third Party Services: Subgraph

  • Wallet: Metamask

  • Blockchain: EVM, Infura, Solidity

Usage

Homepage of GigaBlocks

Giga blocks homepage

School Database Page

Giga blocks database

School Contribution Page

Giga blocks contribution page

Getting Started

System Requirements:

  • OS: Linux/Unix, Windows with WSL
  • Node Version 18.x

Setup and Running

We are using pnpm as a package manager so we must install it as a global dependency:

npm install -g pnpm

Since this is a monorepo, there is only one package.json in the root directory of the Repository. So we can directly manage all the dependencies in a single node_modules folder. Command to install dependencies:

pnpm install

Installing packages in root of repo

pnpm i

Make sure postgresql and redis-server are running. Copy .env.example to .env. And Make prisma migrations first:

pnpm run api:prisma:migrate

For running specific apps

npx nx <command(serve)> <app name>

For adding packages

pnpm add <package name> -w

For running build or lint or test for all apps at once

pnpm run build/test/lint/serve

If you want to add new libraries in libs, then simply add library and initialize it inside the library directory with:

pnpm init

And add it to pnpm package using:

pnpm add ./libs/<library name> -w

For running nx for specific apps or library you can write following syntax:

npx nx <command(build,lint,test,serve)> <apps/libs name>

Contract Addresses deployed for testing in stage server(Ethereum Sepolia):

NFT_Content_Address:0x8062e38a0051820e53B74B7f946260852be62B04
School_NFT_Contract_Address:0xa404c99947391EADD22b82133174F6dc7da75Bcd
Collector_NFT_Contract_Address:0x4239E657FEDD95e0836Cd4667E1B5bDc4Cf9C6a5
Giga_Minter_Contract_Address:0x5E2016e9fb8AF9feA34c61916F975a1dB2475a44       
Escrow_Contract_Address:0x5b4088b76797859d8d168b35F347cDa3120ed518
Giga_Seller_Contract_Address:0x32308109F16Cf57BB7817BE3a578cd8938d74372
ART SCRIPT Contract are auto deployed during nft content deployment

Contribution Guidelines

Thank you for considering contributing to Giga Blocks! We value your input and aim to make the contribution process as accessible and transparent as possible. Whether you're interested in reporting bugs, discussing code, submitting fixes, proposing features, becoming a maintainer, or engaging with the Giga Blocks community, we welcome your involvement.

Click here for detailed Contribution Guidelines

Code Design

Monorepo Structure

The project employs a monorepo structure using pnpm workspaces and nx for efficient management and caching. This structure allows multiple packages to coexist in a single repository, promoting code reuse and simplifying dependency management.

Project Organization

  1. Apps: Contains main applications (e.g., public site, admin dashboard, backend API).

  2. Libs: Shared libraries used across different applications.

  3. Config Files: Includes various configuration files for Docker, environment settings, and package management.

Key Technologies

  • pnpm: A performant package manager, ensuring efficient dependency handling.

  • nx: A powerful build system providing advanced features like computation caching and distributed task execution.

  • Docker: Containerization for consistent development and deployment environments.

  • PostgreSQL and Redis: Essential services for database and caching.

  • Prisma: An ORM for type-safe database interaction.

Deployment and Testing

The repository includes scripts for deploying smart contracts on Ethereum's Sepolia testnet, facilitating NFT content deployment and management. The deployment addresses are included for reference and testing.

Development Workflow

  1. Installing Dependencies: pnpm install

  2. Running Migrations: pnpm run api:prisma:migrate

  3. Running Applications: npx nx serve

  4. Building and Testing: pnpm run build/test/lint/serve

Adding Packages

To add new packages or libraries, use the following commands:

  • Global Package Addition: pnpm add -w

  • Library Initialization: pnpm init within the library directory

  • Library Addition: pnpm add ./libs/ -w

Code of Conduct

At Giga Blocks, we're committed to maintaining an environment that's respectful, inclusive, and harassment-free for everyone involved in our project and community. We welcome contributors and participants from diverse backgrounds and pledge to uphold the standards.

Click here for detailed Code of Conduct

License

Distributed under the AGPL-3.0 License. See LICENSE for more information.

Contact

Blockchain Team Lead: Gerben Kijne: [email protected]

Blockchain Team Member: Vladimir Trkulja: [email protected]

Giga Website: https://giga.global/contact-us/

Contributors🚀

Thanks to the following people who have contributed to this project:


Acknowledgments💜

  • Thanks to Rumsan for helping build this application!