This repository contains a blockchain-based expense tracker web application. It leverages blockchain technology to log and manage expenses securely and transparently. The project uses Ethereum's blockchain network via Ganache, Metamask for wallet integration, and a Python Flask application for the user interface.
- Features
- Technologies Used
- Setup and Installation
- Application Workflow
- Smart Contract Details
- Screenshots
- User Authentication: Login system to access the application.
- Expense Logging: Add expenses with category, description, and amount.
- Blockchain Integration: Securely stores expense data on the blockchain.
- Expense Retrieval: View expenses logged on the blockchain.
- Account Management: Displays Ether balance and deducts total expenses.
- Python (Flask): For web application development.
- Web3.py: To interact with the Ethereum blockchain.
- Ganache: Local Ethereum blockchain for development.
- HTML/CSS: For the web interface.
- Bootstrap: For responsive design.
- Solidity: Smart contract development.
- Remix IDE: To write and deploy smart contracts.
- Metamask: Ethereum wallet for transactions.
- Python 3.7 or above
- Ganache (Local Blockchain Network)
- Node.js (for Metamask integration)
- Metamask (Browser Wallet)
-
Clone the repository:
git clone https://github.com/SirineMaaroufi/Expense-Tracker-Blockchain-WebApp.git cd expense-tracker
-
Install Python dependencies:
pip install -r requirements.txt
-
Start Ganache and note the RPC server URL (e.g.,
http://127.0.0.1:7545
). -
Deploy the smart contract using Remix IDE:
- Load the
ExpenseTracker.sol
file. - Deploy it to your Ganache network.
- Copy the deployed contract address.
- Load the
-
Update the contract details in
app.py
:- Replace
contract_address
with your deployed contract's address. - Replace
ABI.json
with your deployed contract's ABI. - Replace the private key with one from your Ganache accounts.
- Replace
-
Start the Flask application:
python app.py
-
Access the app in your browser at
http://127.0.0.1:5000
.
- Login: Authenticate using a username and password.
- Log Expense: Add an expense with category, description, and amount.
- Blockchain Storage: Expense data is securely stored on the blockchain.
- View Expenses: Retrieve and display logged expenses from the blockchain.
- Manage Finances: View account balance and total expenses.
- logExpense: Logs an expense with category, description, and amount.
- getExpense: Retrieves a specific expense by index.
- getExpenseCount: Returns the total number of expenses logged.
This project is licensed under the MIT License - see the LICENSE file for details.