Skip to content

OrlS15/winechain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WineChain πŸ·πŸ”—

WineChain is a university project developed for the Data Security course at the University of Salerno. This project leverages blockchain technology (Ethereum) to ensure the transparency and security of wine production. Administrators can create wine batches and add detailed information to the blockchain, while users can scan a QR code on the wine bottle to access the stored blockchain data. πŸ‡

Table of Contents

Features

  • Blockchain Integration: Securely stores wine batch information on the Ethereum blockchain. πŸ”’
  • QR Code Verification: Allows users to scan the QR code on the wine bottle to retrieve blockchain data. πŸ“±
  • Admin Management: Administrators can create and manage wine batches with detailed data. πŸ‘©β€πŸ’»
  • User Authentication: Implements secure authentication using Better-auth with an SQLite database. πŸ”‘
  • Modern UI: Built with Nuxt, TailwindCSS, and NuxtUI v3 for a responsive and sleek user experience. 🎨

Technologies

  • Nuxt: Server-side rendering framework for Vue.js.
  • TailwindCSS: Utility-first CSS framework.
  • NuxtUI v3: UI component library for Nuxt.
  • Better-auth: Lightweight authentication library using SQLite.
  • Hardhat: Ethereum development environment for compiling, deploying, and testing smart contracts.

Installation

  1. Clone the Repository

    git clone https://github.com/OrlS15/winechain.git

    Clones the WineChain repository to your local machine.

  2. Install Dependencies

    pnpm install

    Installs all required packages and dependencies for the project.

Running the Project

Setting Up the Blockchain

  1. Compile Smart Contracts

    pnpm run hardhat:compile

    Compiles the Ethereum smart contracts using Hardhat.

  2. Start the Local Blockchain

    pnpm run hardhat:start

    Starts a local Ethereum blockchain network. The terminal will display important configuration details required for later steps.

  3. Deploy Smart Contracts

    pnpm run hardhat:deploy

    Deploys the compiled smart contracts to the local blockchain network.

Setting Up the Application

  1. Run Database Migrations

    pnpm run db:migrate

    Executes the database migration scripts to set up the necessary schema.

  2. Seed Default User

    pnpm run db:seed-user

    Seeds the database with a default administrative user (email: admin@winechain.com, password: admin123).

  3. Create and Configure the Environment Variables

    • Create a .env file in the root directory of the project.
    • Insert the necessary values (these can be taken from the output of pnpm run hardhat:start).

    Example .env file:

    ### BLOCKCHAIN ###
    NUXT_PUBLIC_BC_URL=http://127.0.0.1:8545
    NUXT_PUBLIC_BC_CONTRACT_ADDRESS=
    NUXT_BC_PRIVATE_KEY=
  4. Start the Development Server

    pnpm run dev

    Launches the Nuxt development server, making the WineChain application accessible locally.

About

🍷 WineChain is a university project that uses Ethereum blockchain to track wine production. Admins register batches, users scan a QR code to verify them. πŸ”—πŸ“±

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors