Skip to content

Latest commit

Β 

History

History
284 lines (224 loc) Β· 7.5 KB

File metadata and controls

284 lines (224 loc) Β· 7.5 KB

StellarCert - Wave Program Certificate System A decentralized certificate program management system built on the Stellar blockchain using React, NestJS, and Stellar SDK. This system allows for issuing, verifying, and managing digital certificates program credentials in a secure, transparent, and immutable manner.

🌟 Features Core Features Certificate Issuance: Authorized issuers can create digital certificates credentials

Real-time Verification: Anyone can verify the authenticity of certificates using Stellar transactions

Certificate Revocation: Issuers can revoke certificates when needed

Issuer Management: Admin can authorize/remove certificate issuers

Expiry Management: Automatic expiration of certificates based on Stellar sequence numbers

Statistics Dashboard: Track total certificates, active certificates, and issuer activity

Soroban Smart Contract Integration: On-chain certificate operations with multi-signature support

Rate Limiting: IP-based rate limiting on public verification endpoints for security

Technical Features React Frontend: Modern, responsive UI with real-time updates

NestJS Backend: Scalable API with JWT authentication

Soroban Smart Contracts: Decentralized certificate management on Stellar blockchain

Stellar Integration: Smart contract-like functionality using Stellar transactions

Security Features: Rate limiting, authentication, and authorization

QR Code Generation: Easy certificate sharing and verification

PDF Export: Download certificates as PDF documents

πŸ—οΈ Project Structure

stellarcert/ β”œβ”€β”€ frontend/ # React Application β”‚ β”œβ”€β”€ public/ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ components/ # Reusable components β”‚ β”‚ β”‚ β”œβ”€β”€ Certificate/ β”‚ β”‚ β”‚ β”œβ”€β”€ Dashboard/ β”‚ β”‚ β”‚ β”œβ”€β”€ Issuer/ β”‚ β”‚ β”‚ └── Shared/ β”‚ β”‚ β”œβ”€β”€ contexts/ # React contexts (Auth, Stellar) β”‚ β”‚ β”œβ”€β”€ hooks/ # Custom React hooks β”‚ β”‚ β”œβ”€β”€ pages/ # Page components β”‚ β”‚ β”‚ β”œβ”€β”€ Home/ β”‚ β”‚ β”‚ β”œβ”€β”€ Verify/ β”‚ β”‚ β”‚ β”œβ”€β”€ Issue/ β”‚ β”‚ β”‚ β”œβ”€β”€ Dashboard/ β”‚ β”‚ β”‚ └── Admin/ β”‚ β”‚ β”œβ”€β”€ services/ # API and Stellar services β”‚ β”‚ β”œβ”€β”€ utils/ # Helper functions β”‚ β”‚ β”œβ”€β”€ types/ # TypeScript definitions β”‚ β”‚ └── styles/ # CSS/SCSS files β”‚ β”œβ”€β”€ package.json β”‚ └── vite.config.ts # or webpack.config.js β”‚ β”œβ”€β”€ backend/ # NestJS Application β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ modules/ β”‚ β”‚ β”‚ β”œβ”€β”€ auth/ # Authentication β”‚ β”‚ β”‚ β”œβ”€β”€ certificate/# Certificate management β”‚ β”‚ β”‚ β”œβ”€β”€ issuer/ # Issuer management β”‚ β”‚ β”‚ β”œβ”€β”€ stellar/ # Stellar integration β”‚ β”‚ β”‚ └── user/ # User management β”‚ β”‚ β”œβ”€β”€ common/ β”‚ β”‚ β”‚ β”œβ”€β”€ guards/ # Auth guards β”‚ β”‚ β”‚ β”œβ”€β”€ filters/ # Exception filters β”‚ β”‚ β”‚ β”œβ”€β”€ interceptors/# Interceptors β”‚ β”‚ β”‚ └── decorators/ # Custom decorators β”‚ β”‚ β”œβ”€β”€ config/ # Configuration files β”‚ β”‚ β”œβ”€β”€ contracts/ # Smart contract ABIs (if using Soroban) β”‚ β”‚ β”œβ”€β”€ database/ # Database models and migrations β”‚ β”‚ β”‚ β”œβ”€β”€ entities/ β”‚ β”‚ β”‚ β”œβ”€β”€ migrations/ β”‚ β”‚ β”‚ └── repositories/ β”‚ β”‚ └── utils/ # Utility functions β”‚ β”œβ”€β”€ test/ # Test files β”‚ β”œβ”€β”€ package.json β”‚ β”œβ”€β”€ nest-cli.json β”‚ └── tsconfig.json β”‚ β”œβ”€β”€ stellar-contracts/ # Stellar Soroban Smart Contracts β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ lib.rs # Main certificate contract β”‚ β”‚ β”œβ”€β”€ multisig.rs # Multi-signature operations β”‚ β”‚ β”œβ”€β”€ crl.rs # Certificate revocation lists β”‚ β”‚ β”œβ”€β”€ types.rs # Shared types and data structures β”‚ β”‚ └── admin_multisig.rs # Admin multisig functionality β”‚ β”œβ”€β”€ tests/ # Contract tests β”‚ └── Cargo.toml β”‚ β”œβ”€β”€ shared/ # Shared code between frontend/backend β”‚ β”œβ”€β”€ types/ # Shared TypeScript types β”‚ β”œβ”€β”€ constants/ # Shared constants β”‚ └── utils/ # Shared utilities β”‚ β”œβ”€β”€ docker/ # Docker configuration β”‚ β”œβ”€β”€ Dockerfile.frontend β”‚ β”œβ”€β”€ Dockerfile.backend β”‚ └── docker-compose.yml β”‚ β”œβ”€β”€ docs/ # Documentation β”‚ β”œβ”€β”€ api/ # API documentation β”‚ β”œβ”€β”€ stellar/ # Stellar integration docs β”‚ └── deployment/ # Deployment guides β”‚ β”œβ”€β”€ scripts/ # Utility scripts β”‚ β”œβ”€β”€ setup-stellar.js β”‚ β”œβ”€β”€ deploy-contracts.js β”‚ └── seed-database.js β”‚ β”œβ”€β”€ .env.example # Environment variables template β”œβ”€β”€ .gitignore β”œβ”€β”€ package.json # Root package.json (workspace) β”œβ”€β”€ README.md # This file β”œβ”€β”€ LICENSE └── docker-compose.yml # Full stack docker compose

πŸ“‹ Prerequisites Required Software Node.js (v18 or higher)

npm or yarn or pnpm

Docker & Docker Compose (optional, for containerization)

Stellar CLI Tools (for contract deployment)

PostgreSQL (or Docker for database)

Stellar Requirements Stellar Testnet/Livenet account

Stellar SDK (@stellar/stellar-sdk)

Friendbot (for testnet funding)

πŸš€ Installation

  1. Clone the Repository bash git clone https://github.com/Servora/StellarCert.git cd stellarcert
  2. Setup Backend bash cd backend cp .env.example .env

Edit .env with your configuration

npm install npm run db:migrate npm run seed 3. Setup Frontend bash cd ../frontend cp .env.example .env npm install 4. Setup Stellar (Optional - for contract deployment) bash cd ../stellar-contracts rustup target add wasm32-unknown-unknown cargo install --locked soroban-cli πŸƒβ€β™‚οΈ Running the Application Development Mode Option A: Using Docker Compose (Recommended) bash

From root directory

docker-compose up --build Option B: Running Separately Backend:

bash cd backend npm run start:dev Frontend:

bash cd frontend npm run dev Production Mode bash

Build all services

npm run build

Start in production

npm start πŸ§ͺ Testing Backend Tests bash cd backend npm test # Unit tests npm run test:e2e # E2E tests npm run test:cov # Test coverage Frontend Tests bash cd frontend npm test # Unit tests npm run test:e2e # E2E tests Stellar Contract Tests bash cd stellar-contracts cargo test πŸ”§ Configuration Environment Variables Backend (.env):

env

Database

DATABASE_URL=postgresql://user:password@localhost:5432/stellarwave

Stellar

STELLAR_NETWORK=TESTNET STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org STELLAR_SECRET_KEY=your_secret_key

JWT

JWT_SECRET=your_jwt_secret JWT_EXPIRY=24h

Server

PORT=3000 CORS_ORIGIN=http://localhost:5173 Frontend (.env):

env VITE_API_URL=http://localhost:3000/api VITE_STELLAR_NETWORK=TESTNET VITE_HORIZON_URL=https://horizon-testnet.stellar.org πŸ“‘ Stellar Integration Key Components Transaction Builder: Creates Stellar transactions for certificate operations

Account Manager: Handles issuer and user accounts

Memo Fields: Uses memo fields to store certificate metadata

Operations:

Issue: Creates trustlines and sends assets

Verify: Checks transaction history

Revoke: Updates account flags

Smart Contract Flow (Soroban) rust // Example Soroban contract function fn issue_certificate( env: Env, issuer: Address, recipient: Address, cert_data: Bytes ) -> Result<(), Error>; 🀝 Contributing Fork the repository

Create a feature branch (git checkout -b feature/AmazingFeature)

Commit changes (git commit -m 'Add some AmazingFeature')

Push to branch (git push origin feature/AmazingFeature)

Open a Pull Request

πŸ“„ License This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Support For support open an issue in the GitHub repository.