How kommurusashank/agrizen-frontend works
AgriZen is a React smart-farming frontend. Farmers register or sign in, then reach protected farm-management pages through the router; the dashboard combines crop and expense data, and reports can be downloaded as PDFs. The source tree also identifies weather, crop recommendations, disease detection, yield prediction, and AI assistance. Sampled code shows routing, dashboard data loading, report generation, and several API integrations; other feature-page and service connections are not asserted because their source was not sampled.
Main entry points: AppRoutes.jsx Route and access control · Reports.jsx Reports page · Dashboard.jsx Farm dashboard · expenseService.js Expense API client
Components 28
Application shell
- React app
src/App.jsx - Route and access control
src/routes/AppRoutes.jsx - Home page
src/pages/Home/Home.jsx
Farmer access
- Registration
src/pages/Register/Register.jsx - Login
src/pages/Login/Login.jsx - Farmer profile
src/pages/Profile/Profile.jsx
Farm operations
- Farm dashboard
src/pages/Dashboard/Dashboard.jsx - Add crop
src/pages/AddCrop.jsx - Edit crop
src/pages/EditCrop.jsx - Expense tracking
src/pages/Expenses.jsx
Farm insights
- Weather
src/pages/weather.jsx - Crop recommendations
src/pages/CropRecommendation.jsx - Disease detection
src/pages/DiseaseDetection.jsx - Yield prediction
src/pages/YieldPrediction.jsx - AI assistant
src/pages/AIAssistant.jsx - Reports page
src/pages/Reports.jsx
Service layer
- Crop API client
src/services/cropService.js - Expense API client
src/services/expenseService.js - Profile API client
src/services/profileService.js - PDF report generator
src/services/reportService.js - AI service
src/services/aiService.js - Dashboard service
src/services/dashboardService.js - Disease service
src/services/diseaseService.js - Recommendation service
src/services/recommendService.js - Weather service
src/services/weatherService.js - Yield service
src/services/yieldService.js
Other components
- Farmer
- HTTP API
Connections 25
- Farmer → Route and access control: navigates
src/routes/AppRoutes.jsx - React app → Route and access control: renders
src/App.jsx - Route and access control → Home page: routes to
src/routes/AppRoutes.jsx - Route and access control → Login: routes to
src/routes/AppRoutes.jsx - Route and access control → Registration: routes to
src/routes/AppRoutes.jsx - Route and access control → Farm dashboard: protects route
src/routes/AppRoutes.jsx - Route and access control → Farmer profile: protects route
src/routes/AppRoutes.jsx - Route and access control → Add crop: protects route
src/routes/AppRoutes.jsx - Route and access control → Edit crop: protects route
src/routes/AppRoutes.jsx - Route and access control → Expense tracking: protects route
src/routes/AppRoutes.jsx - Route and access control → Weather: protects route
src/routes/AppRoutes.jsx - Route and access control → Crop recommendations: protects route
src/routes/AppRoutes.jsx - Route and access control → Disease detection: protects route
src/routes/AppRoutes.jsx - Route and access control → Yield prediction: protects route
src/routes/AppRoutes.jsx - Route and access control → AI assistant: protects route
src/routes/AppRoutes.jsx - Route and access control → Reports page: protects route
src/routes/AppRoutes.jsx - Registration → HTTP API: registers via HTTP
src/pages/Register/Register.jsx - Farm dashboard → Crop API client: loads and deletes crops
src/pages/Dashboard/Dashboard.jsx - Farm dashboard → Expense API client: loads expenses
src/pages/Dashboard/Dashboard.jsx - Reports page → Profile API client: loads profile
src/pages/Reports.jsx - Reports page → Expense API client: loads expenses
src/pages/Reports.jsx - Reports page → PDF report generator: generates PDF
src/pages/Reports.jsx - Crop API client → HTTP API: requests crop data
src/services/cropService.js - Expense API client → HTTP API: requests expenses
src/services/expenseService.js - Profile API client → HTTP API: requests profile
src/services/profileService.js