WeGuard is a full-stack application designed to help farmers and agricultural professionals identify and manage crop diseases effectively. The platform leverages AI-powered image recognition to detect diseases from crop images, provides a comprehensive database of crop diseases, and offers expert advice and agricultural tips.
- AI Crop Scanner: Upload an image of a crop to get an AI-powered analysis and disease identification.
- Disease Database: A comprehensive and searchable database of crop diseases with detailed information.
- Expert Help: Connect with agricultural experts to get personalized advice and solutions.
- Farming Tips: A collection of tips and best practices for sustainable and effective farming.
- Treatment Calendar: Schedule and manage recommended treatments to stay on top of crop health.
- Marketplace: Discover and purchase essential agricultural products and tools directly through the app.
- Admin Dashboard: A dedicated dashboard for administrators to manage diseases, farming tips, and expert profiles...
- Chat Bot: AI power chat bot for get instance answers.
- Multi-language Support: The user interface is available in multiple languages to cater to a diverse user base.
- 3D Interactive Models: Engaging 3D models to visualize and understand crop-related concepts.
- Framework: React, Vite
- UI Components: shadcn/ui, Radix UI
- State Management: TanStack React Query
- 3D Rendering: Three.js, @react-three/fiber, @react-three/drei
- Routing: React Router
- Styling: Tailwind CSS
- Language: TypeScript
- Framework: Node.js, Express
- Database: MongoDB, Mongoose
- Auth: Firebase auth
- AI: Google Generative AI (Gemini)
- API: RESTful API -- Language: TypeScript
- Node.js (v18 or higher)
- npm, yarn, or pnpm
- MongoDB instance (local or cloud)
- Google Generative AI API Key (for AI features)
-
Clone the repository:
git clone https://github.com/Maleesha101/vGurad_main.git cd vGurad_main -
Install backend dependencies:
cd backend npm install -
Install frontend dependencies:
cd ../frontend npm install
Create a .env file in the backend directory and add the following variables:
PORT=5001
MONGODB_URI=<your_mongodb_uri>
GEMINI_API_KEY=<your_gemini_api_key>
-
Start the backend server:
cd backend npm run dev -
Start the frontend development server:
cd ../frontend npm run dev
The application will be available at http://localhost:5173.
vGurad_main/
├── backend/
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── models/ # Mongoose schemas
│ │ ├── routes/ # API routes
│ │ ├── app.ts # Express app setup
│ │ └── database.ts # MongoDB connection
│ └── package.json
├── frontend/
│ ├── src/
│ │ ├── assets/ # Static assets
│ │ ├── components/ # Reusable React components
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # Utility functions
│ │ ├── pages/ # Page components
│ │ ├── translations/ # Language files
│ │ ├── App.tsx # Main App component
│ │ └── main.tsx # React entry point
│ └── package.json
└── README.md
The backend provides a RESTful API with the following endpoints:
GET /api/diseases: Get a list of all crop diseases.GET /api/diseases/:id: Get details of a specific disease.POST /api/questions: Submit a question to an expert.GET /api/tips: Get a list of all farming tips.POST /api/gemini/generate: Get AI-powered analysis of a crop image.
- Build the backend:
cd backend npm run build - Start the production server:
npm start
- Build the frontend:
cd frontend npm run build - Serve the
distdirectory using a static file server.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.