Skip to content

Web3-Warriors/MonFund_DApps

Repository files navigation

MonFund - Web3 Crowdfunding Platform

MonFund adalah platform crowdfunding berbasis blockchain yang dirancang khusus untuk mendukung program-program kampus dan inisiatif mahasiswa. Platform ini menggunakan teknologi Web3 untuk memastikan transparansi, keamanan, dan desentralisasi dalam proses penggalangan dana.

πŸš€ Fitur Utama

  • Crowdfunding Terdesentralisasi: Menggunakan smart contract Ethereum untuk transparansi penuh
  • Manajemen Program: Admin dapat membuat dan mengelola program crowdfunding
  • Kontribusi Aman: Sistem kontribusi yang aman menggunakan ETH
  • Penarikan Terkontrol: Dana hanya dapat ditarik setelah program berakhir
  • Riwayat Transparan: Semua transaksi tercatat di blockchain
  • UI Modern: Interface yang responsif dan user-friendly

πŸ›  Teknologi yang Digunakan

  • Frontend: React 18 + TypeScript + Vite
  • Styling: Tailwind CSS + shadcn/ui components
  • Web3: Wagmi + RainbowKit + Viem
  • Blockchain: Ethereum/Foundry (Anvil untuk development)
  • State Management: TanStack Query
  • Routing: React Router DOM

πŸ“‹ Prerequisites

Sebelum menjalankan project, pastikan Anda memiliki:

  • Node.js (versi 18 atau lebih baru)
  • npm atau bun
  • MetaMask atau wallet Web3 lainnya
  • Foundry (untuk menjalankan local blockchain)

πŸ— Setup Development

1. Clone Repository

git clone https://github.com/Web3-Warriors/MonFund_DApps.git
cd MonFund

2. Install Dependencies

npm install
# atau jika menggunakan bun
bun install

3. Setup Local Blockchain

# Install Foundry jika belum ada
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Jalankan Anvil (local blockchain)
anvil

4. Deploy Smart Contract

Smart contract untuk project ini tersedia di: https://github.com/Web3-Warriors/SmartContract

# Clone smart contract repository terlebih dahulu
git clone https://github.com/Web3-Warriors/SmartContract.git

# Deploy contract ke local blockchain
# (Sesuaikan dengan setup smart contract dari repository)
forge create --rpc-url http://127.0.0.1:8545 --private-key <PRIVATE_KEY> src/CrowdFundingContract.sol:CrowdFundingContract

5. Update Contract Address

Update alamat contract di src/config/contract.ts:

export const CROWDFUNDING_CONTRACT_ADDRESS = "0x..."; // Alamat contract yang baru di-deploy

6. Jalankan Development Server

npm run dev
# atau
bun dev

Server akan berjalan di http://localhost:8080 (atau port lain jika sudah digunakan).

πŸ”§ Konfigurasi

Environment Variables

Buat file .env di root project (opsional):

VITE_CHAIN_ID=31337
VITE_RPC_URL=http://127.0.0.1:8545

Contract Configuration

File src/config/contract.ts berisi:

  • Alamat smart contract
  • ABI (Application Binary Interface)
  • Type definitions untuk Program dan status

πŸ‘€ User Roles

Admin

  • Dapat membuat program crowdfunding baru
  • Mengelola program yang sudah ada (edit, hapus, update status)
  • Mengawasi seluruh aktivitas platform
  • Membatalkan program & melakukan refound dana donasi

PIC (Person In Charge)

  • Bertanggung jawab atas program tertentu
  • Dapat menarik dana setelah program berakhir
  • Mengelola dan memantau progress program yang ditugaskan

Regular Users

  • Melihat semua program yang tersedia
  • Berkontribusi pada program aktif
  • Melihat riwayat kontribusi mereka

πŸ— Struktur Project

β”œβ”€β”€ public/                    # Static assets
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ logo-long.png
β”‚   β”œβ”€β”€ placeholder.svg
β”‚   └── robots.txt
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/               # Image assets
β”‚   β”‚   β”œβ”€β”€ contrib-img.webp
β”‚   β”‚   β”œβ”€β”€ hero-img.webp
β”‚   β”‚   └── program-img.webp
β”‚   β”œβ”€β”€ components/           # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ animations/       # Animation components
β”‚   β”‚   β”‚   β”œβ”€β”€ AnimatedCard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AnimatedSection.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ HoverAnimation.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”‚   └── PageTransition.tsx
β”‚   β”‚   β”œβ”€β”€ ui/              # shadcn/ui components
β”‚   β”‚   β”‚   β”œβ”€β”€ button.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ card.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ input.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FeatureCard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ NavigationButton.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ StatusBadge.tsx
β”‚   β”‚   β”‚   └── ... (other UI components)
β”‚   β”‚   β”œβ”€β”€ Footer.tsx       # Footer component
β”‚   β”‚   β”œβ”€β”€ Header.tsx       # Navigation header
β”‚   β”‚   └── ProgramCard.tsx  # Program display card
β”‚   β”œβ”€β”€ config/              # Configuration files
β”‚   β”‚   └── contract.ts      # Smart contract config
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ use-mobile.tsx   # Mobile detection hook
β”‚   β”‚   β”œβ”€β”€ use-toast.ts     # Toast notifications
β”‚   β”‚   └── useIsOwner.ts    # Check if user is contract owner
β”‚   β”œβ”€β”€ lib/                 # Utility functions
β”‚   β”‚   └── utils.ts         # General utilities
β”‚   β”œβ”€β”€ pages/               # Application pages
β”‚   β”‚   β”œβ”€β”€ CreateProgram.tsx    # Create new program
β”‚   β”‚   β”œβ”€β”€ Index.tsx           # Landing page
β”‚   β”‚   β”œβ”€β”€ MyContributions.tsx # User contributions
β”‚   β”‚   β”œβ”€β”€ NotFound.tsx        # 404 page
β”‚   β”‚   β”œβ”€β”€ ProgramDetail.tsx   # Program details
β”‚   β”‚   └── Programs.tsx        # Program listing
β”‚   β”œβ”€β”€ providers/           # Context providers
β”‚   β”‚   └── Web3Provider.tsx # Web3 configuration
β”‚   β”œβ”€β”€ App.css             # App-specific styles
β”‚   β”œβ”€β”€ App.tsx             # Main App component
β”‚   β”œβ”€β”€ index.css           # Global styles
β”‚   β”œβ”€β”€ main.tsx            # App entry point
β”‚   └── vite-env.d.ts       # Vite environment types
β”œβ”€β”€ components.json          # shadcn/ui configuration
β”œβ”€β”€ eslint.config.js        # ESLint configuration
β”œβ”€β”€ index.html              # HTML template
β”œβ”€β”€ package.json            # Project dependencies
β”œβ”€β”€ postcss.config.js       # PostCSS configuration
β”œβ”€β”€ tailwind.config.ts      # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json           # TypeScript configuration
β”œβ”€β”€ tsconfig.app.json       # App-specific TypeScript config
β”œβ”€β”€ tsconfig.node.json      # Node-specific TypeScript config
└── vite.config.ts          # Vite configuration

πŸš€ Deployment

Build untuk Production

npm run build

Deploy ke Vercel/Netlify

# Build project
npm run build

# Deploy folder dist/ ke platform pilihan Anda

πŸ§ͺ Testing

# Run tests (jika ada)
npm test

# Lint code
npm run lint

🀝 Contributing

  1. Fork repository
  2. Buat feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push ke branch (git push origin feature/amazing-feature)
  5. Buat Pull Request

πŸ“„ License

Project ini menggunakan MIT License.

πŸ“ž Support

Jika mengalami masalah atau memiliki pertanyaan:

  1. Buka issue di GitHub repository
  2. Hubungi tim development

MonFund - Membangun masa depan kampus melalui crowdfunding yang transparan dan aman. πŸŽ“βœ¨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages