Skip to content

jishjitsu/SmartBidPro

Repository files navigation

SmartBid-PRO

A revolutionary technology aimed to digitise the hassle of tenders through analog means.

SBP achieves this using a secure smart contract based backend, and an AI validation model which comprehensively checks for compliance of a Certain tender, and regulations to be followed.

Built using Next.js and Actix Web

Tech Stack

Frontend

  • Next.js 16 - React framework with App Router
  • shadcn/ui - Beautiful, accessible UI components
  • Tailwind CSS - Utility-first CSS framework
  • TypeScript - Type-safe development

Backend

  • Actix Web (Rust) - Fast, secure web framework
  • MongoDB - NoSQL database for flexible data storage
  • JWT Authentication - Secure token-based auth
  • bcrypt - Password hashing

Project Structure

smartbidpro/
├── app/                    # Next.js pages
│   ├── login/             # Login page
│   ├── dashboard/         # Dashboard page
│   └── page.tsx           # Home page (redirects)
├── components/ui/         # shadcn/ui components
│   ├── button.tsx
│   ├── card.tsx
│   └── input.tsx
├── lib/                   # Utility functions
│   └── utils.ts
├── backend/               # Rust backend
│   ├── src/
│   │   ├── main.rs       # Entry point
│   │   ├── auth.rs       # JWT authentication
│   │   ├── db.rs         # MongoDB connection
│   │   ├── models.rs     # Data models
│   │   └── routes/       # API endpoints
│   │       ├── auth.rs   # Auth routes
│   │       └── auctions.rs # Auction CRUD
│   └── Cargo.toml        # Rust dependencies
├── package.json          # Node dependencies
├── contracts/             # Solidity Smart Contracts (Foundry)
│   ├── src/
│   │   └── TenderNotary.sol
│   └── foundry.toml
├── fabric/                # Hyperledger Fabric Go Chaincode (In Progress)

Getting Started

Prerequisites

  • Node.js 20+ installed
  • Rust toolchain installed
  • MongoDB running locally or connection URI

Backend Setup

  1. Navigate to the backend directory:
cd backend
  1. Create a .env file with your configuration:
# Database (If using WSL to connect to Windows MongoDB, use the Windows Host IP and add ?directConnection=true)
MONGODB_URI=mongodb://localhost:27017/smartbidpro
JWT_SECRET=your-secret-key-change-this-in-production
ACTIX_PORT=8000
ACTIX_ADDRESS=0.0.0.0

# Gemini API Key for AI Compliance Checking
GEMINI_API_KEY=your-gemini-api-key

# Ethereum Notary (Anvil)
ETH_RPC_URL=http://127.0.0.1:8545
ETH_NOTARY_CONTRACT_ADDRESS=your-notary-contract-address
ETH_PRIVATE_KEY=your-ethereum-private-key
  1. Build and run the backend:
cargo build
cargo run

The Actix server will start on http://localhost:8000 z

Frontend Setup

  1. Navigate to the project root:
cd ..
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev

Blockchain Setup (Ethereum Notary)

The project uses a Hybrid Web2.5 architecture. You must deploy the TenderNotary contract to a local Ethereum node to enable the public audit trail.

  1. Start a Local Node In a separate terminal, start the Anvil development chain (included with Foundry):
anvil

Keep this running. It provides the RPC endpoint and 10 pre-funded test accounts.

  1. Deploy the Notary Contract Navigate to the contracts/ directory and run the deployment command. Replace <PRIVATE_KEY> with the first private key provided by Anvil (usually starts with 0xac09...).
cd contracts
forge create src/TenderNotary.sol:TenderNotary \
  --rpc-url http://127.0.0.1:8545 \
  --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
  --broadcast
  1. Update Environment Variables Once deployed, the terminal will output a Deployed to: address. Copy this value and update your backend/.env:
ETH_NOTARY_CONTRACT_ADDRESS=<YOUR_NOTARY_ADDRESS>  # Replace with your actual address
ETH_RPC_URL=http://127.0.0.1:8545
ETH_PRIVATE_KEY=<YOUR_ANVIL_PRIVATE_KEY>

The Next.js app will start on http://localhost:3000

Development

To make changes:

  1. Backend: Edit files in backend/src/, rebuild with cargo build
  2. Frontend: Edit files in app/ or components/, changes hot-reload automatically
  3. Populating Users: Run /scripts/create-test-user.js using node to seed users into your database

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors