{"id":17965388,"url":"https://github.com/dkv204p/blockweaver-blockchain-app","last_synced_at":"2026-04-14T14:31:59.431Z","repository":{"id":260044682,"uuid":"880136329","full_name":"dkv204p/BlockWeaver-Blockchain-App","owner":"dkv204p","description":"BlockWeaver is a secure blockchain app for decentralized data management. Users can submit transactions, mine blocks, and view the blockchain. Built with Flask, PostgreSQL, and Bootstrap, it offers a simple interface and strong backend for transparent and reliable data handling.","archived":false,"fork":false,"pushed_at":"2024-10-29T07:33:33.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T20:18:40.318Z","etag":null,"topics":["blockchain","css","flask","html","js","postgresql","python","web"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkv204p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-29T07:22:41.000Z","updated_at":"2024-10-29T07:45:30.000Z","dependencies_parsed_at":"2024-10-29T08:18:20.689Z","dependency_job_id":null,"html_url":"https://github.com/dkv204p/BlockWeaver-Blockchain-App","commit_stats":null,"previous_names":["dkv204p/blockweaver-blockchain-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkv204p%2FBlockWeaver-Blockchain-App","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkv204p%2FBlockWeaver-Blockchain-App/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkv204p%2FBlockWeaver-Blockchain-App/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkv204p%2FBlockWeaver-Blockchain-App/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkv204p","download_url":"https://codeload.github.com/dkv204p/BlockWeaver-Blockchain-App/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247070925,"owners_count":20878586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","css","flask","html","js","postgresql","python","web"],"created_at":"2024-10-29T13:00:28.826Z","updated_at":"2026-04-14T14:31:59.394Z","avatar_url":"https://github.com/dkv204p.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlockWeaver - Blockchain Explorer v1.2\n\nBlockWeaver is a blockchain explorer built using Flask and PostgreSQL. The application allows users to submit transactions, mine new blocks, and view the blockchain in a user-friendly interface enhanced with Bootstrap. In version 1.2, we have introduced user authentication, improved data storage, and added a RESTful API for interacting with the blockchain programmatically.\n\n## New Features in v1.2\n\n- **User Authentication**: Users can register, log in, and log out. Only authenticated users can submit transactions and mine blocks.\n- **Improved Data Storage**: Transactions are now stored in the database with each block, allowing for better data management and querying.\n- **RESTful API**: Added endpoints for programmatic interaction with the blockchain.\n- **Enhanced Frontend**: Improved form validation, authentication checks, and detailed transaction views for each block.\n- **Docker Support**: Added Docker configuration for easy setup and deployment.\n\n## Technologies Used\n\n- **Backend**: Python, Flask\n- **Database**: PostgreSQL\n- **Frontend**: HTML, Bootstrap\n- **Authentication**: Flask-Login, Flask-Bcrypt\n- **Environment Management**: python-dotenv\n\n## Setup Instructions\n\n### Prerequisites\n\n- Python 3.6 or higher\n- PostgreSQL\n- Docker (optional, for Docker setup)\n\n### Installation\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/dkv204p/BlockWeaver-Blockchain-App.git\n   cd BlockWeaver-Blockchain-App\n   ```\n\n2. **Create a virtual environment**:\n   ```bash\n   python -m venv .venv\n   ```\n\n3. **Activate the virtual environment**:\n   - On Windows:\n     ```bash\n     .venv\\Scripts\\activate.ps1\n     ```\n   - On macOS/Linux:\n     ```bash\n     source .venv/bin/activate\n     ```\n\n4. **Install the required packages**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n5. **Set up the database**:\n   - Create a PostgreSQL database (e.g., `blockweaver_db`).\n   - Run the following SQL to create the necessary tables:\n     ```sql\n     CREATE TABLE blocks (\n         id SERIAL PRIMARY KEY,\n         timestamp TIMESTAMP WITHOUT TIME ZONE NOT NULL,\n         proof INT NOT NULL,\n         previous_hash TEXT NOT NULL\n     );\n\n     CREATE TABLE transactions (\n         id SERIAL PRIMARY KEY,\n         block_id INT REFERENCES blocks(id) ON DELETE CASCADE,\n         sender TEXT NOT NULL,\n         recipient TEXT NOT NULL,\n         amount FLOAT NOT NULL\n     );\n\n     CREATE TABLE users (\n         id SERIAL PRIMARY KEY,\n         username TEXT UNIQUE NOT NULL,\n         password_hash TEXT NOT NULL\n     );\n     ```\n\n6. **Configure the application**:\n   - Create a `.env` file based on the `.env.example` file and update it with your database connection details:\n     ```plaintext\n     SECRET_KEY=your_secret_key\n     DB_NAME=blockweaver_db\n     DB_USER=your_username\n     DB_PASSWORD=your_password\n     DB_HOST=localhost\n     DB_PORT=5432\n     ```\n\n### Running the Application\n\n1. **Start the Flask application**:\n   ```bash\n   python app.py\n   ```\n\n2. **Open your browser and navigate to `http://localhost:5000`** to access the application.\n\n### Using Docker\n\n1. **Build the Docker image**:\n   ```bash\n   docker build -t blockweaver .\n   ```\n\n2. **Run the Docker container**:\n   ```bash\n   docker run -d -p 5000:5000 --env-file .env blockweaver\n   ```\n\nThe application should now be accessible at `http://localhost:5000`.\n\n## RESTful API Endpoints\n\n- **GET /api/chain**: Retrieve the full blockchain.\n- **POST /api/transactions/new**: Submit a new transaction. Requires a JSON payload with `sender`, `recipient`, and `amount`.\n- **GET /api/mine**: Mine a new block. Authenticated users only.\n\n## Usage\n\n- **Register and Login**: Create an account or log in to submit transactions and mine blocks.\n- **Submit Transaction**: Fill out the form with sender, recipient, and amount, then click \"Submit Transaction.\"\n- **Mine New Block**: Click the \"Mine Block\" button to mine a new block.\n- **View Blockchain**: Click the \"View Blockchain\" button to see the entire blockchain.\n\n## Running Tests\n\n1. **Install testing dependencies** (if not already installed):\n   ```bash\n   pip install pytest\n   ```\n\n2. **Run the tests**:\n   ```bash\n   pytest\n   ```\n\n## Security Notes\n\n- Ensure that the `.env` file is not committed to version control.\n- Use a strong `SECRET_KEY` for the Flask app.\n\n## License\n\nThis project is licensed under the Creative Commons CC0 1.0 Universal license - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgements\n\n- [Flask](https://flask.palletsprojects.com/)\n- [PostgreSQL](https://www.postgresql.org/)\n- [Bootstrap](https://getbootstrap.com/)\n- [Flask-Login](https://flask-login.readthedocs.io/en/latest/)\n- [Flask-Bcrypt](https://flask-bcrypt.readthedocs.io/en/latest/)\n- [Docker](https://www.docker.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkv204p%2Fblockweaver-blockchain-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkv204p%2Fblockweaver-blockchain-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkv204p%2Fblockweaver-blockchain-app/lists"}