Aggrow is an AI powered crop disease detection and management system developed as part of Mini Project S6 - Model Engineering College Thrikkakkara
- Prerequisites
- Installation
- Running the Application
- Project Structure
- Development Workflow
- Testing
- Building for Production
- Contributing
- Troubleshooting
Before you begin, ensure you have the following installed:
- Clone the repository:
git clone https://github.com/Abhijith-2002/Aggrow.git
cd Aggrow- Install dependencies:
# Using pip
pip install Aggrow/requirements.txt
# Using yarn
yarnThis starts the development server with hot-reload enabled:
# Using python
python backend/app.py
# Using yarn
yarn devThe application will be available at http://localhost:5173 by default.
If you want to use mock API data during development:
# Using npm
npm run dev:mock
# Using yarn
yarn dev:mockAggrow/
├── public/ # Static assets that will be served as-is
├── src/ # Source code
│ ├── assets/ # Images, fonts, etc.
│ ├── components/ # Reusable React components
│ ├── contexts/ # React context providers
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page components
│ ├── services/ # API service functions
│ ├── styles/ # Global styles and themes
│ ├── utils/ # Utility functions
│ ├── App.jsx # Main App component
│ ├── main.jsx # Entry point
│ └── vite-env.d.ts # Vite type definitions
├── tests/ # Test files
├── .eslintrc.json # ESLint configuration
├── .gitignore # Git ignore rules
├── index.html # HTML entry point
├── package.json # Project dependencies and scripts
├── vite.config.js # Vite configuration
└── README.md # This file
We use ESLint and Prettier to maintain code quality:
# Run linter
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Format code with Prettier
npm run formatEnvironment variables can be set in the following files:
.env- Loaded in all environments.env.development- Development-specific variables.env.production- Production-specific variables
Important: Never commit sensitive information in these files.
Example .env file:
VITE_API_URL=https://api.example.com
VITE_APP_TITLE=My Vite React App
Access environment variables in your code using import.meta.env.VITE_*:
console.log(import.meta.env.VITE_API_URL);# Run all tests
npm run test
# Run tests in watch mode
npm run test:watch
# Generate test coverage report
npm run test:coveragePlace your test files in the tests directory or alongside the components with a .test.jsx or .spec.jsx extension.
Example test for a component:
import { render, screen } from "@testing-library/react";
import { describe, it, expect } from "vitest";
import Button from "./Button";
describe("Button Component", () => {
it("renders correctly", () => {
render(<Button>Click me</Button>);
expect(screen.getByText("Click me")).toBeInTheDocument();
});
});To build the application for production:
npm run buildThis will generate optimized files in the dist directory.
To preview the production build locally:
npm run previewCurrently only the collaborators aka project members would be allowed to contribute , here is a guide to making commits/contributions :
- Fork the repository on GitHub
- Clone your fork to your local machine
- Create a branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them with descriptive messages:
git commit -m "Add: your feature description" - Push your changes to your fork:
git push origin feature/your-feature-name
- Open a Pull Request against the main repository
We follow the Conventional Commits standard:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for code style changes (formatting, etc.)refactor:for code refactoringtest:for adding or modifying testschore:for maintenance tasks
Example: feat: add user authentication system
- Ensure your code passes all tests
- Update documentation if necessary
- Your PR should be reviewed by at least one maintainer
- Once approved, a maintainer will merge your PR
npm install
Check if the port is already in use. You can change the port in vite.config.js.
Make sure you're not using React.memo, useMemo, or useCallback unnecessarily.
- Ensure variables are prefixed with
VITE_ - Restart the development server after changing environment files
If you encounter any issues, please:
- Check the existing issues on GitHub
- Search through the documentation
- Open a new issue with a detailed description of the problem
This project is licensed under the MIT License - see the LICENSE file for details.