This project implements a decentralized school management system on the Solana blockchain using Program Derived Addresses (PDAs). It allows for student enrollment, class registration, and book distribution, all managed through blockchain technology and NFTs.
- School account management with administrator controls
- Student enrollment with unique NFT-based student IDs
- Class registration system using PDAs
- Digital book distribution through NFTs and PDAs
- Enrollment fee management
authority
: Public key of the school administratorbaseEnrollmentFee
: Cost to enroll in the school (in SOL or lamports)classCount
: Number of registered classesbookCount
: Number of registered booksstudentCount
: Number of Students registeredname
: School nameshoolType
: HighSchool, College or University,FeeMultiplier
: Calculate the overall school fee based on the schoolType and baseEnrollmentFee.bump
For easy identification of the school PDA account.
name
: Name of the CoursenftMetadata
: Address of the class NFT metadatacapacity
: Maximum number of studentsenrolledStudentsCount
: Current number of enrolled studentstuitionFee
: Cost to attend a courseschool
: School providing this course
name
: Name of the booknftMetadata
: Address of the book NFT metadatatotalSupply
: Total number of copiesavailableCopies
: Number of available copies
studentId
: Unique identifier for the studentstudentNft
: Address of the student's ID NFTenrolledClasses
: List of class PDAs the student is enrolled inownedBooks
: List of book PDAs the student owns
Initializes the main School account.
Adds a new class to the school, creating a new PDA for the class.
Adds a new book to the school, creating a new PDA for the book.
Allows a student to enroll in the school.
Enables a student to register for a class using the class PDA.
Allows a student to request a book using the book PDA.
Retrieves information about a specific class using its PDA.
Retrieves information about a specific book using its PDA.
- Rust and Cargo
- Solana CLI tools
- Anchor framework
-
Clone the repository:
git clone https://github.com/yourusername/solana-blockchain-school.git cd solana-blockchain-school
2. Install dependencies:
```bash
anchor build
- Update the program ID in
lib.rs
andAnchor.toml
with your program ID:solana address -k target/deploy/blockchain_school-keypair.json
- Implement the functions described above in
lib.rs
. - Build the program:
anchor build
- Deploy the program to your desired Solana cluster:
anchor deploy
- Interact with the program using a client application or Anchor tests.
To run the tests:
anchor test
- Implement a grading system
- Add functionality for issuing blockchain-based certificates or diplomas
- Develop a front-end application for easy interaction with the school system
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
This is an experimental project. Ensure compliance with educational regulations and data privacy laws when implementing in a real-world scenario.