Skip to content

Commit d5a74ce

Browse files
committed
Cleaning repository and updating README
1 parent 2727724 commit d5a74ce

5 files changed

+53
-63
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package.json
2+
package-lock.json
3+
node_modules/
4+
Available-Accounts.txt

Available-Accounts.txt

-12
This file was deleted.

README.md

+48-48
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
# Ethereum Student Attendance Tracking DAO
1+
# Student Attendance Tracking DAO
22

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.
44

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
66

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.
811

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.
1217

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+
```
1624

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.
1929

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).
2233

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
3035

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.
3439

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.
3942

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.
4146

42-
1. Clone the repository:
47+
4. **View Attendance by Course:**
48+
- Select a course from the dropdown to view attendance results.
4349

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.
4753

48-
2. Install dependencies:
54+
2. **Select Form to Answer:**
55+
- Choose a form from the dropdown to answer.
4956

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.
5659

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.
5863
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

html/attendanceDashboard.html renamed to attendanceDashboard.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Attendance DAO - Student Dashboard</title>
77
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>
8-
<script src="../js/attendanceDashboard.js"></script>
8+
<script src="./attendanceDashboard.js"></script>
99
</head>
1010
<body id="dashboardContainer">
1111
</body>

js/attendanceDashboard.js renamed to attendanceDashboard.js

-2
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ const contractABI = [
495495
];
496496

497497
/*------------------------------------- CODE ----------------------------*/
498-
499498
var contract = null;
500499
var accounts = null;
501500
var accountId = null;
@@ -512,7 +511,6 @@ document.addEventListener('DOMContentLoaded', async () => {
512511
} else {
513512
web3 = new Web3(new Web3.providers.WebsocketProvider("ws://127.0.0.1:8545/")); //for events
514513
}
515-
// web3.eth.defaultAccount = "0x175B72d85c0AecfE5069397094B46D330d15A74A";
516514

517515
contract = new web3.eth.Contract(contractABI, contractAddress);
518516

0 commit comments

Comments
 (0)