This project is designed to integrate a blockchain-based stablecoin system with a main app, utilizing Solana for token implementation and a dedicated admin dashboard for management and visualizations. It is split into three main components:
- API (Backend Integration): This folder contains the backend logic and APIs for interacting with the blockchain and integrating with the main application.
- Mint (Blockchain Token Implementation): This folder is responsible for the creation and management of Solana-based tokens, including minting, transfers, and wallet management.
- SBT Board (Admin Dashboard): This folder contains the admin dashboard used for managing the system, visualizing the tokens, and providing admin privileges.
The project is organized into three main modules:
This folder contains the backend integration and API logic to handle requests from the main app and manage Solana transactions. It includes endpoints for:
- Creating user wallets
- Sending token transactions
- Retrieving wallet balances
This folder is dedicated to the blockchain implementation of the tokens. It handles:
- SbtToken minting: Creating new stablecoins.
- SbtReward minting: Creating new reward coins.
- SbtNft minting: Creating sbt tier nfts.
This folder contains the admin dashboard for visualization and management of the stablecoin system. Key features include:
- Admin authentication and privileges.
- Visualization of token balances and transactions.
To run the project locally, you need the following:
- Node.js (v14 or above)
- npm or yarn
- Solana CLI (for local/devnet blockchain setup)
-
Clone the repository:
git clone https://github.com/jorshimayor/stradebasesbt.git cd your-repository -
Set up environment variables: Create a
.envfile in the root of each folder with the necessary variables (e.g., private keys, API URLs, Solana configuration).Example for
api/.env:SOLANA_NETWORK=https://api.devnet.solana.com PAYER_PRIVATE_KEY=[your-payer-private-key] -
Run the application:
-
For
api/(for backend dev):cd api -
For
mint/(only if needed for minting tokens by blockchain dev):cd mint -
For
sbtBoard/(Admin Dashboard):cd sbtBoard
This will start the API, the minting process, and the admin dashboard. You should now be able to interact with the blockchain and visualize/manage the system through the dashboard.
-
-
Create Wallet:
POST request to/create-wallet.
Returns the user's wallet details (public/private keys). -
Send Transaction:
POST request to/send-transaction.
Initiates a transfer of tokens between two wallets. -
Get Balance:
POST request to/get-balance.
Retrieves the balance of a given wallet.
-
Mint Tokens:
This will allow you to mint tokens to a specific wallet address. The implementation handles the interaction with the Solana blockchain. -
Token Transactions:
Use the blockchain functions for sending, receiving, and managing tokens. The system integrates directly with Solana to mint and manage token flows.
-
View Token Balances:
Displays the token balances of all users in real-time. -
Admin Privileges:
Administrators can make transactions, manage wallet creations, and perform other critical operations.
- Full blockchain integration with Solana.
- Stablecoin minting and management.
- Admin dashboard for visualizing token data.
- Secure user wallet creation and transaction handling.
You can test the API using tools like Postman:
-
POST
/create-walletGenerate a new wallet for a user. -
POST
/send-transaction:
Send tokens from one wallet to another. -
POST
/get-balance:
Retrieve the balance of a wallet.
Create Wallet:
POST /create-wallet
{}Send Transaction:
POST /send-transaction
{
"userPrivateKey": [/* user's private key array */],
"recipientPublicKey": "recipientPublicKeyHere",
"amount": 0.1
}Get Balance:
POST /get-balance
{
"publicKey": "userPublicKeyHere"
}We welcome contributions to improve the project! Please follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Open a pull request.