Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VCoS (Verify Certificates on Sui) - He thong Quan ly va Xac thuc Chung chi Hoc tap Phi tap trung

Gioi thieu

VCoS la he thong quan ly va xac thuc chung chi hoc tap phi tap trung duoc xay dung tren nen tang Sui Blockchain. He thong cho phep cac co so giao duc cap phat chung chi duoi dang NFT Soulbound (khong the chuyen nhuong), dam bao tinh minh bach, bao mat va khong the gia mao.

Muc luc

  1. Kien truc he thong
  2. Cong nghe su dung
  3. Cay thu muc
  4. Huong dan cai dat
  5. Cau hinh moi truong
  6. Chay ung dung
  7. Tai lieu tham khao

Kien truc he thong

Xem chi tiet tai: docs/architecture.md

Cong nghe su dung

1. Blockchain Layer

Cong nghe Phien ban Muc dich
Sui Network Testnet Nen tang blockchain chinh
Move Language 2024.beta Ngon ngu viet smart contract
Sui Framework testnet Thu vien chuan cua Sui

2. Frontend Layer

Cong nghe Phien ban Muc dich
Next.js 15.5.4 React framework
React 18.3.1 UI library
TypeScript 5.9.2 Ngon ngu lap trinh
TailwindCSS 3.4.17 CSS framework
@mysten/sui 1.45.0 Sui SDK
@mysten/dapp-kit 0.19.9 Sui dApp toolkit
@dynamic-labs/sdk-react-core 4.39.0 Wallet authentication
@dynamic-labs/sui 4.39.0 Sui wallet connector
@tanstack/react-query 5.90.10 Data fetching
Axios 1.12.2 HTTP client
SWR 2.3.6 Data fetching hooks

3. Backend Layer

Cong nghe Phien ban Muc dich
Node.js LTS Runtime environment
Express.js 4.21.2 Web framework
MSSQL 12.0.0 SQL Server driver
JWT (jsonwebtoken) 9.0.2 Authentication
JWKS-RSA 3.2.0 JWT key verification
Multer 1.4.5 File upload
CORS 2.8.5 Cross-origin resource sharing
Express Rate Limit 8.1.0 API rate limiting
Node-cache 5.1.2 In-memory caching

4. Storage Layer

Cong nghe Phien ban Muc dich
Microsoft SQL Server 2019+ Co so du lieu quan he
Pinata IPFS Cloud Luu tru phi tap trung
IPFS HTTP Client 60.0.0 IPFS interaction

5. Smart Contracts

Module Chuc nang
certificate_request Quan ly yeu cau chung chi
certificate Mint NFT Soulbound

Cay thu muc

suipj/
|
|-- contracts/                      # Smart contracts (Move)
|   |-- cert/
|   |   |-- certificate/            # Module mint NFT Soulbound
|   |   |   |-- Move.toml
|   |   |   |-- sources/
|   |   |   |   |-- certificate.move
|   |   |   |-- tests/
|   |   |   |   |-- certificate_tests.move
|   |   |   |-- build/
|   |   |
|   |   |-- certificate_request/    # Module quan ly yeu cau
|   |       |-- Move.toml
|   |       |-- sources/
|   |       |   |-- certificate_request.move
|   |       |-- tests/
|   |           |-- certificate_request_tests.move
|   |
|   |-- request/                    # Module request (deprecated)
|   |-- token/                      # Module token (reserved)
|
|-- ui/                         # Frontend (Next.js)
|   |-- components/
|   |   |-- account.tsx             # Component quan ly tai khoan
|   |   |-- audit_req.tsx           # Component gui audit len Bo
|   |   |-- create.tsx              # Component tao chung chi
|   |   |-- nft.tsx                 # Component mint NFT
|   |   |-- request.tsx             # Component yeu cau
|   |   |-- verify_request.tsx      # Component xac minh
|   |   |-- walletconnect.tsx       # Component ket noi vi
|   |
|   |-- pages/
|   |   |-- _app.tsx                # App configuration
|   |   |-- index.tsx               # Trang chu
|   |   |-- login.tsx               # Trang dang nhap
|   |   |-- root.tsx                # Trang quan tri Bo GD
|   |   |-- org.tsx                 # Trang quan tri Truong
|   |   |-- admin_org.tsx           # Trang quan tri Khoa
|   |   |-- user.tsx                # Trang sinh vien
|   |   |-- verify.tsx              # Trang xac minh chung chi
|   |
|   |-- styles/
|   |   |-- globals.css             # Global styles
|   |
|   |-- utils/
|   |   |-- sui.ts                  # Sui blockchain utilities
|   |   |-- ipfs.ts                 # IPFS utilities
|   |
|   |-- image/                      # Static images
|   |-- package.json
|   |-- tsconfig.json
|   |-- next.config.js
|   |-- tailwind.config.js
|   |-- postcss.config.js
|
|-- src/                            # Backend (Express.js)
|   |-- app.js                      # Entry point
|   |-- package.json
|   |
|   |-- config/
|   |   |-- db.js                   # Database configuration
|   |
|   |-- middleware/
|   |   |-- auth.js                 # JWT authentication
|   |
|   |-- routes/
|   |   |-- auth.js                 # Authentication routes
|   |   |-- certificates.js         # Certificate routes
|   |   |-- organizations.js        # Organization routes
|   |   |-- users.js                # User routes
|   |   |-- verify.js               # Verification routes
|   |
|   |-- services/
|   |   |-- cache.js                # Caching service
|   |   |-- db.js                   # Database service
|   |   |-- ipfs.js                 # IPFS service
|   |   |-- jwt.js                  # JWT service
|   |
|   |-- uploads/                    # Temporary uploads
|
|-- databse/                        # Database scripts
|   |-- db1.sql                     # Schema definition
|   |-- test.sql                    # Test data
|
|-- docs/                           # Documentation
|   |-- readme.md                   # This file
|   |-- architecture.md             # System architecture
|   |-- LICENSE                     # License file
|
|-- package.json                    # Root package
|-- tsconfig.json                   # TypeScript config
|-- .env                            # Environment variables (backend)
|-- .env.local                      # Environment variables (frontend)

Huong dan cai dat

Yeu cau he thong

  • Node.js 18.x hoac cao hon
  • npm hoac yarn
  • Sui CLI
  • Microsoft SQL Server 2019+
  • Git

Buoc 1: Cai dat Sui CLI

Windows (Chocolatey):

choco install sui

MacOS (Homebrew):

brew install sui

Kiem tra:

sui --version

Buoc 2: Clone repository

git clone https://github.com/dui14/dAPP-Sui-storage-doanchuyenganh.git
cd suipj

Buoc 3: Cai dat dependencies

# Root
npm install

# Frontend
cd ui
npm install

# Backend
cd ../src
npm install

Buoc 4: Cai dat database

  1. Tao database tren SQL Server
  2. Chay script databse/db1.sql de tao cac bang

Cau hinh moi truong

Frontend (.env.local trong thu muc public/)

NEXT_PUBLIC_DYNAMIC_ENV_ID=7e2c57a4-316f-467f-b11a-cafc5df99993
NEXT_PUBLIC_API_URL=http://localhost:5000

Backend (.env trong thu muc goc)

# Server
PORT=5000
FRONTEND_URL=http://localhost:3000

# Database
DB_USER=your_username
DB_PASSWORD=your_password
DB_SERVER=localhost
DB_NAME=edu

# JWT
JWT_PUBLIC_KEY_URL=https://app.dynamic.xyz/api/v0/sdk/7e2c57a4-316f-467f-b11a-cafc5df99993/.well-known/jwks

# Pinata IPFS 
PINATA_API_KEY=your_api_key
PINATA_SECRET_KEY=your_secret_key
PINATA_JWT=your_jwt_token

Chay ung dung

Buoc 1: Khoi dong SQL Server

Dam bao SQL Server dang chay va database da duoc tao.

Buoc 2: Khoi dong Backend

cd src
node app.js

Backend se chay tai: http://localhost:5000

Buoc 3: Khoi dong Frontend

cd ui
npm run dev

Frontend se chay tai: http://localhost:3000

Cac vai tro trong he thong

Vai tro Mo ta Trang
admin_root Bo Giao duc va Dao tao /root
org Truong Dai hoc /org
admin_org Khoa/Phong ban /admin_org
user Sinh vien /user

Quy trinh cap chung chi

1. Sinh vien gui yeu cau --> Khoa duyet
2. Khoa duyet --> Truong tao chung chi + Upload IPFS
3. Truong ky on-chain (verify_by_university)
4. Bo GD duyet on-chain (approve_by_ministry)
5. Truong mint NFT Soulbound cho sinh vien

API Endpoints

Authentication

  • POST /api/auth/login
  • POST /api/auth/logout

Users

  • GET /api/users/me
  • PUT /api/users/wallet

Organizations

  • GET /api/organizations
  • POST /api/organizations
  • PUT /api/organizations/:id
  • DELETE /api/organizations/:id

Certificates

  • GET /api/certificates/requests
  • POST /api/certificates/requests
  • PUT /api/certificates/requests/:id
  • PUT /api/certificates/requests/:id/blockchain
  • PUT /api/certificates/requests/:id/nft-minted

Smart Contract Functions

certificate_request module

  • create_request() - Tao yeu cau chung chi
  • verify_by_university() - Truong xac nhan va tra phi
  • approve_by_ministry() - Bo GD phe duyet
  • reject_by_ministry() - Bo GD tu choi

certificate module

  • mint_certificate() - Mint NFT Soulbound
  • revoke_certificate() - Thu hoi chung chi

Tai lieu tham khao

License

MIT License - Xem chi tiet tai LICENSE

Tac gia

  • Repository: dui14/dAPP-Sui-storage-doanchuyenganh
  • Branch: main

About

VCoS is a decentralized certificate management and verification system built on the Sui Blockchain. The system enables educational institutions to issue certificates as Soulbound NFTs, ensuring transparency, security, and preventing certificate forgery.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages