Thank you for your interest in contributing to AgroVest! This document provides guidelines and instructions for contributing.
- Node.js 18 or later
- npm (comes with Node.js)
- A Web3 wallet (e.g., MetaMask)
- Reown Project ID (for wallet connection)
-
Fork the repository
-
Clone your fork:
git clone https://github.com/<your-username>/AgroVest-Frontend.git cd AgroVest-Frontend
-
Install dependencies:
npm install
-
Copy the environment variables template:
cp .env.example .env.local
-
Fill in your values in
.env.local:NEXT_PUBLIC_PROJECT_ID- Get from Reown Cloud- Contract addresses - Use the deployed addresses or your own
- Pinata keys - Get from Pinata
-
Start the development server:
npm run dev
Open http://localhost:3000 in your browser.
- Check existing issues first
- Use the Bug Report issue template
- Include steps to reproduce, expected behavior, and screenshots if applicable
- Use the Feature Request issue template
- Describe the problem and your proposed solution
- Create a branch from
main:git checkout -b feat/your-feature-name
- Make your changes
- Commit your changes (pre-commit hooks will run linting and formatting automatically):
git commit -m "feat: add new feature" - Push to your fork:
git push origin feat/your-feature-name
- Open a Pull Request against
main
Use descriptive prefixes:
feat/- New featuresfix/- Bug fixesdocs/- Documentation changeschore/- Maintenance tasksrefactor/- Code refactoring
We follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentationchore:- Maintenancerefactor:- Code refactoringstyle:- Formatting (no code change)test:- Adding tests
- Formatting: Prettier runs automatically on commit via Husky + lint-staged
- Linting: ESLint runs automatically on commit
- Tailwind CSS: Classes are auto-sorted by the Prettier plugin
- Run manually if needed:
npm run format # Format all files npm run lint # Run ESLint npm run type-check # Run TypeScript type checking
app/ # Next.js App Router pages and layouts
(guest)/ # Public pages (home, investment, marketplace)
user/ # Authenticated pages (dashboard, portfolio, etc.)
components/ # React components
dashboard/ # Dashboard-specific components
guest/ # Public page components
shared/ # Shared components
ui/ # Base UI components (shadcn/ui)
config/ # Wallet and app configuration
constants/ # Contract addresses and chain config
context/ # React context providers
hooks/ # Custom hooks
ReadHooks/ # Blockchain read operations
WriteHooks/ # Blockchain write operations
abis/ # Smart contract ABIs
lib/ # Utility functions
utils/ # Helpers (IPFS, metadata, etc.)
public/ # Static assets
styles/ # Global CSS
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run type-check |
Run TypeScript type checking |
npm run format |
Format all files with Prettier |
npm run format:check |
Check formatting without writing |
Please read our Code of Conduct before contributing.
For security vulnerabilities, please see our Security Policy. Do not open public issues for security vulnerabilities.