A complete React-based platform to inspire society about farming and connect farmers, experts, admins, and the public. Converted from HTML with full authentication and AI assistant.
- User Authentication: Real credential validation with signup/login
- Role-Based Access: Admin, Farmer, Expert, Public portals
- Dashboard: Personalized content after login
- AI Assistant: Floating chat bot with farming knowledge
- Information Modules:
- Pesticides Guide (10 crops with pest/pesticide info)
- Seeds Database (varieties and propagation methods)
- Water Requirements (irrigation data for major crops)
- Seasonal Crops (Kharif, Rabi, Zaid seasons)
- Modern green/earth-tone theme
- Scrolling ticker with government agriculture links
- Glass-morphism effects
- Blinking action buttons
- Responsive design
- Poppins font family
- Install dependencies
npm install- Run dev server
npm run dev- Build for production
npm run build
npm run preview- Username:
Mohankrishna| Password:Mohan2006@(Farmer role) - Username:
Akhil| Password:Akhil123(Expert role)
- Signup creates new users stored in
localStorage - Login validates against stored credentials
- Session persists across page reloads
- Only registered users can access protected content
src/
components/
AIChat.jsx # Floating AI assistant
Card.jsx # Reusable card component
Footer.jsx # Footer with links
Navbar.jsx # Top navigation (hidden on home)
ProtectedRoute.jsx # Route guard
data/
farmingData.js # CROPS, SEEDS, WATER_DATA, AI logic
mockData.js # Legacy data (news, resources, threads)
pages/
Home.jsx # Main platform (converted from HTML)
auth/
Login.jsx # Login page
Signup.jsx # Signup page
dashboards/ # Role-specific dashboards
Resources.jsx # Resource library
News.jsx # Farming news
Community.jsx # Q&A forum
Messages.jsx # User messaging
Profile.jsx # User profile
Contact.jsx # Contact form
state/
AuthContext.jsx # Authentication state
DataContext.jsx # App data state
- Framework: React 18 + Vite
- Styling: Tailwind CSS
- Routing: React Router v6
- State: Context API
- Animations: Framer Motion
- Font: Poppins (Google Fonts)
- First Visit: See user roles on home page
- Click "Open Portal": Prompted to login
- Login/Signup: Use demo accounts or create new user
- Dashboard: Access modules (Pesticides, Seeds, Water, Seasonal)
- AI Assistant: Click floating "AI" button for farming queries
- Quick Tools: Use sidebar shortcuts for fast navigation
- Colors: Edit
tailwind.config.js(primary, earth tones) - Data: Update
src/data/farmingData.jsfor crops/seeds/water - Roles: Modify role content in
Home.jsxRoleContentSection - AI Responses: Enhance
generateAIResponse()infarmingData.js
- Client-side only: Auth stored in
localStorage(demo purposes) - Production: Integrate backend API for real authentication
- AI: Currently rule-based; integrate OpenAI/Gemini for smarter responses
- Images: Using Unsplash URLs; replace with local assets for production
- Backend API integration
- Real-time chat between users
- Advanced AI with NLP
- Multi-language support (Español shortcut ready)
- Admin panel for content management
- Mobile app version
Built with ❤️ for farmers and agricultural communities