Skip to content

sgcodes7471/carbon-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CarbonX

About CarbonX

To read all the documentations and work flow refer to the 'docs' directory

πŸ’» TechStack Used

  • JavaScript
  • Solidity
  • Circom
  • ReactJS
  • TailwindCSS
  • NodeJS
  • Web3.js
  • MongoDB
  • IPFS
  • PinataSDK
  • GraphQL
  • SocketIO
  • ZK Snarks
  • Redis

πŸš€ Features

βš™οΈ Setting up the Project locally

Prerequisites

Node.js should be installed on your system

An account on IPFS and PinataSDK

Either MongoDB should be available on your local or make a account in MongoAtlas to use it without dowloading

Account on Cloudinary for saving uploaded files

Should have a crypto wallet(like Metamask) with some sepolia in it

An ESP32 microcontroller setup connected to a computer for running the Arduino code

An Account in the HiveMQ-A MQTT Broker Cloud

Arduino IDE installed on the computer with which the ESP32 microcontroller will be connected using MicroUSB cable

A free account on Redis Cloud

Setting up the frontend

cd app/client
npm install

Setting up the backend

cd app/server
npm install

πŸŽͺ Setting up .env Variables

First we need to configure a .env file for secret variables used in the sever side of this project

You need to add following variables in your .env file in the server folder:

PORT= " the port where your server-side express application will run"
URL= "URL of the client side website"

PINATA_API_KEY= " received from the official website of Pinata "
PINATA_SECRET_API_KEY= " received from the official website of Pinata "
GATEWAY_URL= " received from the official website of Pinata "
PINATA_JWT= " received from the official website of Pinata "

MQTT_BROKER_HOSTNAME= " received from the official website of HiveMQ "
MQTT_BROKER_PORT= " received from the official website of HiveMQ "
MQTT_BROKER_USERNAME= " received from the official website of HiveMQ "
MQTT_BROKER_PASSWORD= " received from the official website of HiveMQ "

EMAIL_ADDRESS= "a outlook email address for sending emails"
EMAIL_PASSWORD= "password of that account"

MONGODB_URI= " URL of the cloud database setup on MongoAtlas "

api_secret= " credentials of cloudinary "
api_key= " credentials of cloudinary "
cloud_name= " credentials of cloudinary "

REDIS_HOST = "get from redis cloud" ,
REDIS_PORT = "get from redis cloud" ,
REDIS_PASSWORD = "get from redis cloud",

Starting the project locally

in app/client, below starts the client-side React+Vite application

npm run build
npm run prod

in app/server, below starts the server-side Node+Express application

npm run dev

πŸ“‚ Directory Structure

β”œβ”€β”€ README.md                   <- Project overview and instructions
β”œβ”€β”€ .gitignore                  <- Files/folders not pushed on github

β”œβ”€β”€arduino-code                 <- Code to be run on ESP32 microcontroller
    └── code.h

β”œβ”€β”€ docs                        <- Documentation and project demo
β”‚   └── demo.mp4                <- Walk-through video, covering setup, UI, and functionality
β”‚   └── apis                    <- Includes the API defination and practices followed in the application
β”‚   └── architecture            <- Includes the entire system architecture and implementations
β”‚   └── contracts               <- Includes the solidity contracts and thier outline
β”‚       └── main.sol            <- Solidity Contract for NFT-minting and listing credits
β”‚       └── iot.sol             <- Includes the solidity contracts and thier outline
β”‚   └── ui                      <- Glimpses of UI and their outline
β”‚   └── zksnarks                <- Implementation of ZK Snarks along with all the necessary files
β”‚       └── purchase            <- Includes the files generated for ZK Proof for Buy-side
β”‚       └── sell                <- Includes the files generated for ZK Proof for Sell-side

β”œβ”€β”€ listing                     <- Auto generated folder for building and deploying the subgraphs. Consists the schema and events   

β”œβ”€β”€ app                         <- Main directory consisting of the source code of the application
β”‚   └── AdminDashboard          <- Consists the UI made on ReactJS of the admin dashboard used to verify the documents of the businesses before their onchain onboarding 
β”‚   └── client                  <- Consists the source-code for the main UI interface of the application
β”‚       └── src    
β”‚           └── apis
β”‚           └── assests
β”‚           └── components
β”‚           └── configs
β”‚           └── context
β”‚           └── graphql
β”‚           └── page
β”‚           └── styles   
β”‚           └── App.jsx    
β”‚           └── index.css    
β”‚           └── main.jsx   
β”‚   └── server                  <- Consists the source-code for the server side application, following a monolithic standard of Models-Controllers-Routes with Express Framework
β”‚       └── public              <- Includes the static files required for ZK proof generation in the client side
β”‚       └── uploads             <- Temporarily stores the files/docs uploaded for verification
β”‚       └── src                 
β”‚           └── config      
β”‚           └── controllers               
β”‚           └── db      
β”‚           └── middlewares           
β”‚           └── models           
β”‚           └── routes         
β”‚           └── services            
β”‚           └── utils                 
β”‚           └── constants.js         
β”‚           └── index.js        <- Start point of server-side application        

πŸ› Bug Reporting

Feel free to open an issue on GitHub if you find any bug.


⭐ Feature Suggestion

Feel free to open an issue on GitHub if you have feature idea to be added πŸ™Œ.

Thanks for visiting my repository 😊!! Please give a star ⭐ if you liked our project.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors