This project consists of a Django Backend (API & Admin) and a React Frontend (User Interfaces). Follow the steps below to run the complete system.
- Python 3.10+
- Node.js 16+
- PostgreSQL (Optional, defaults to SQLite)
- Secure Authentication: JWT-based auth with Role-Based Access Control (RBAC).
- Strict Verification Workflow:
- Student Registration: Uploads ID cards, account starts as
PENDING. - Faculty Registration: Teachers/HODs register, account starts as
PENDING. - Approval System: Accounts must be approved by the respective authority (Class Teacher/HOD) before login is allowed.
- Student Registration: Uploads ID cards, account starts as
- Audit Logging: Immutable logs for sensitive actions (viewing, approving, rejecting) ensuring data integrity.
- Improved Department Management:
- Archival System: Archive unused departments instead of deleting them.
- Manual Code Entry: Flexibility to define custom department codes.
- Role-Based Dashboards:
- HOD: Class & Faculty management, Department-wide oversight.
- Teachers: Verification Queue, Class management.
- Students: Verification status, Voting interface.
- Admin: Global stats, System configuration.
- Blockchain Integration: Store specialized data verifying student identity hash on-chain.
- Modern UI: Polished, responsive React frontend with real-time validation and feedback.
- Backend: Django REST Framework (DRF)
- Frontend: React + Vite + Tailwind CSS
- Database: SQLite (Dev) / PostgreSQL (Prod)
- Authentication:
SimpleJWT(Django)
OffChain_Verification/
├── evoting_backend/ # Django Project Root
│ ├── accounts/ # User authentication & role management
│ ├── audit/ # Logging & system audit trails
│ ├── blockchain/ # Blockchain integration (Web3.py)
│ ├── dashboards/ # Role-specific dashboard views
│ ├── elections/ # Election management logic
│ ├── verification/ # Identity verification workflows
│ ├── manage.py # Django management script
│ └── requirements.txt # Python dependencies
│
└── evoting_frontend/ # React Project Root (Vite)
├── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Page views (Admin, Student, Faculty)
│ ├── context/ # Global state (Auth, Theme)
│ └── services/ # API integration using Axios
├── package.json # Node dependencies
└── vite.config.js # Vite configuration
Open a terminal in evoting_backend/.
# 1. Create & Activate Virtual Environment (if not already done)
python -m venv venv
venv\Scripts\Activate
# 2. Install Dependencies
pip install -r requirements.txt
# 3. Apply Migrations
python manage.py makemigrations
python manage.py migrate
# 4. Populate Demo Data (Users, Roles, Elections)
python manage.py populate_data
# 5. Start Server
python manage.py runserverBackend runs at: http://127.0.0.1:8000
Open a new terminal in evoting_frontend/.
# 1. Install Dependencies
npm install
# 2. Start Dev Server
npm run devFrontend runs at: http://localhost:5173
The populate_data script creates the following default users:
| Role | Password | |
|---|---|---|
| Super Admin | admin@college.edu |
adminpass |
| HOD (CS) | shalupk@college.edu |
123123123 |
| Teacher (CS) | shamalam@college.edu |
123123123 |
| Student | student.alice@college.edu |
studentpass |
- Initial Setup: Admin creates Departments and assigns HODs.
- Registration:
- Students: Sign up -> Upload IDs -> Status:
PENDING. - Faculty: Sign up -> Select Department -> Status:
PENDING.
- Students: Sign up -> Upload IDs -> Status:
- Verification:
- HOD approves Faculty.
- Teachers/HOD approve Students.
- Operations:
- HODs manage classes and view audits.
- Admins oversee the entire system.
Note
For a detailed step-by-step guide on how to operate the system, please refer to the Operations Guide.