|
1 |
| -# Ethereum Student Attendance Tracking DAO |
| 1 | +# Student Attendance Tracking DAO |
2 | 2 |
|
3 |
| -## Overview |
| 3 | +Welcome to the Student Attendance Tracking DAO project! This decentralized application (DAO) utilizes blockchain technology to streamline the process of tracking student attendance. Below are the steps to set up and run the project. |
4 | 4 |
|
5 |
| -The Ethereum Student Attendance Tracking DAO is a decentralized application (DApp) built on the Ethereum blockchain. It provides a secure and transparent way for teachers to create and track student attendance through smart contracts. The system ensures accuracy and reliability by leveraging Ethereum's blockchain technology. |
| 5 | +## Getting Started |
6 | 6 |
|
7 |
| -## Features |
| 7 | +### Prerequisites |
| 8 | +1. [Ganache](https://www.trufflesuite.com/ganache) installed and running. |
| 9 | +2. [Remix IDE](https://remix.ethereum.org/) for compiling and deploying the smart contract. |
| 10 | +3. [Node.js](https://nodejs.org/) installed for web3 dependencies. |
8 | 11 |
|
9 |
| -- **Teacher Functionality:** |
10 |
| - - Teachers can create and post attendance forms on the blockchain. |
11 |
| - - Only teachers are authorized to create attendance forms. |
| 12 | +### Installation Steps |
| 13 | +1. **Compile and Deploy the Smart Contract:** |
| 14 | + - Open `AttendanceDAO.sol` in Remix IDE. |
| 15 | + - Compile the contract. |
| 16 | + - Deploy the contract using Ganache as the provider. |
12 | 17 |
|
13 |
| -- **Student Functionality:** |
14 |
| - - Students can answer attendance forms during the specified date and time. |
15 |
| - - Absence is determined based on voting results and predefined rules. |
| 18 | +2. **Install Node.js and Configure Web3 Dependencies:** |
| 19 | + - Install Node.js from [https://nodejs.org/](https://nodejs.org/). |
| 20 | + - Open a terminal and run the following command to install web3 dependencies: |
| 21 | + ```bash |
| 22 | + npm install web3 ganache-cli |
| 23 | + ``` |
16 | 24 |
|
17 |
| -- **Results Storage:** |
18 |
| - - Final attendance results are securely stored on the Ethereum blockchain. |
| 25 | +3. **Configure the JavaScript Dashboard:** |
| 26 | + - Open `attendanceDashboard.js` and modify the following constants: |
| 27 | + - `contractAddress`: Set this to the deployed contract address. |
| 28 | + - `contractABI`: Set this to the contract ABI generated by Remix. |
19 | 29 |
|
20 |
| -- **Access Control:** |
21 |
| - - Only authorized users (teachers, students, or administrators) can view attendance statistics. |
| 30 | +4. **Run the Dashboard:** |
| 31 | + - Open `attendanceDashboard.html` in your preferred browser. |
| 32 | + - Input a number between 0 and 9 to assign an address (0 for the teacher, others for students). |
22 | 33 |
|
23 |
| -## Smart Contract Structure |
24 |
| - |
25 |
| -The project uses Ethereum smart contracts written in Solidity. The primary components include: |
26 |
| - |
27 |
| -- **AttendanceForm Struct:** |
28 |
| - - Stores details of each attendance form. |
29 |
| - - Includes course name, teacher address, date, duration, students list, and votes list. |
| 34 | +## Usage |
30 | 35 |
|
31 |
| -- **AttendanceResult Struct:** |
32 |
| - - Stores final attendance results. |
33 |
| - - Includes course name, teacher address, date, duration, and final results list. |
| 36 | +### Teacher Dashboard |
| 37 | +1. **Add Course:** |
| 38 | + - Enter a course name in the "Add Course" section and click the "Add" button. |
34 | 39 |
|
35 |
| -- **Functions:** |
36 |
| - - Teachers can create attendance forms. |
37 |
| - - Students can answer attendance forms. |
38 |
| - - Final results are calculated based on predefined rules. |
| 40 | +2. **Create New Form:** |
| 41 | + - Select a course, enter student addresses (comma-separated), and click the "Create Form" button. |
39 | 42 |
|
40 |
| -## Installation |
| 43 | +3. **View and Close Forms:** |
| 44 | + - Select a form from the dropdown to view details. |
| 45 | + - Click the "Close Form" button to calculate attendance results. |
41 | 46 |
|
42 |
| -1. Clone the repository: |
| 47 | +4. **View Attendance by Course:** |
| 48 | + - Select a course from the dropdown to view attendance results. |
43 | 49 |
|
44 |
| - ```bash |
45 |
| - git clone https://github.com/your-username/ethereum-attendance-dao.git |
46 |
| - ``` |
| 50 | +### Student Dashboard |
| 51 | +1. **Select Course:** |
| 52 | + - Choose a course from the dropdown to view attendance. |
47 | 53 |
|
48 |
| -2. Install dependencies: |
| 54 | +2. **Select Form to Answer:** |
| 55 | + - Choose a form from the dropdown to answer. |
49 | 56 |
|
50 |
| - ```bash |
51 |
| - Copy code |
52 |
| - cd ethereum-attendance-dao |
53 |
| - npm install |
54 |
| - Deploy the smart contract using Remix IDE or your preferred Ethereum development environment. |
55 |
| - ``` |
| 57 | +3. **Submit Form:** |
| 58 | + - Check the students you want to mark as present and click the "Submit Form" button. |
56 | 59 |
|
57 |
| -## Usage |
| 60 | +## Notes |
| 61 | +- The teacher's address is set to 0, and other addresses (1 to 9) represent student addresses. |
| 62 | +- Ensure that Ganache is running and the correct contract address and ABI are set in the JavaScript file. |
58 | 63 |
|
59 |
| -Deploy the smart contract on the Ethereum blockchain. |
60 |
| - |
61 |
| -Interact with the DApp through the provided HTML pages: |
62 |
| -* Teacher Page: Create and post attendance forms. |
63 |
| -* Student Page: Answer attendance forms. |
64 |
| -* Statistics Page: View attendance statistics. |
65 |
| -Ensure MetaMask or another Ethereum wallet is connected to the DApp for transaction signing. |
| 64 | +## Contributors |
| 65 | +- Henry Marie MONT |
0 commit comments