ProfileBlocks is a blockchain-based platform for secure education credentials built with Django and Ethereum smart contracts. This project enables secure issuance, management, and verification of digital academic certificates using a modular backend and smart contracts deployed on the Ethereum Sepolia testnet.
Follow the instructions below to set up your local environment, run the server, and start developing or testing.
git clone https://github.com/TheCoder0215/fyp24111
cd profileblocks_v2It is highly recommended to use a Python virtual environment to manage dependencies and keep your system clean.
Create a virtual environment named venv:
python3 -m venv venvActivate the virtual environment:
-
macOS/Linux:
source venv/bin/activate -
Windows (PowerShell):
.\venv\Scripts\Activate.ps1
-
Windows (Command Prompt):
.\venv\Scripts\activate.bat
Upgrade pip first, then install the required packages from requirements.txt:
pip install --upgrade pip
pip install -r requirements.txtA .env file is included in the project root directory. This file contains essential environment variables such as blockchain RPC URLs and other configuration.
For validated personnels who wish to test using the projects Metamask Account, please contact u3578912@connect.hku.hk to obtain the CONTRACT_OWNER_PRIVATE_KEY.
- Do not commit your
.envfile to public repos. - Review and update any placeholders or sensitive data in the
.envas necessary.
The project includes a pre-populated SQLite database file db.sqlite3 with testing data.
-
If you want to apply migrations (for schema updates or if starting fresh), run:
python manage.py migrate
-
To create a superuser for Django admin access:
python manage.py createsuperuser
Start the Django development server:
python manage.py runserverBy default, the server will be accessible at http://127.0.0.1:8000/.
profileblocks_v2/
├─ accounts/ # User authentication, key management, services, tests
├─ blockchain/ # Ethereum smart contract interaction services and tests
├─ certificates/ # Certificate issuance, management, templates, and templatetags
├─ institutions/ # Institution models and services
├─ profiles/ # Student profile management, services, templates
├─ static/ # Static files (JS)
├─ verification/ # Verification portal templates and tests
├─ manage.py # Django management script
.env # Environment variables file (sensitive)
db.sqlite3 # SQLite database with testing data
requirements.txt # Python dependencies
smart_contracts/ # Solidity contracts and Hardhat scripts/tests
-
Blockchain Integration:
The backend interacts with Ethereum Sepolia testnet smart contracts using Web3.py. Ensure your.envcontains correct RPC endpoints and private keys. -
Security:
Sensitive data is managed via.envand never committed to version control. The system uses role-based access control and cryptographic verification. -
Frontend:
Uses Django templates with Bootstrap 5 for responsive UI. -
Testing Data:
The includeddb.sqlite3contains sample data for quick testing and development.
For questions, issues, or contributions, please contact u3578912@connect.hku.hk or refer to the project documentation.