SenseHarvest is a full-stack web application designed for monitoring and managing agricultural or environmental data. It provides a comprehensive dashboard to visualize sensor readings, manage inventory, and track employee information.
- Dashboard: A central hub for viewing real-time sensor data and key metrics.
- Data Visualization: Graphical representation of sensor data for easy interpretation.
- Inventory Management: CRUD functionality to manage inventory items.
- Employee Management: Track employee information and logs.
- User Authentication: Secure login and registration system with role-based access.
- AI Chatbot: An integrated chatbot to assist users.
- Notifications: A notification center to alert users about important events.
- React: A JavaScript library for building user interfaces.
- Vite: A fast build tool and development server.
- TypeScript: A typed superset of JavaScript.
- Tailwind CSS: A utility-first CSS framework.
- Radix UI: A collection of unstyled, accessible UI components.
- Recharts: A composable charting library built on React components.
- Gemini: Used for an AI Chatbot.
- Node.js: A JavaScript runtime environment.
- Express: A fast, unopinionated, minimalist web framework for Node.js.
- MongoDB: A NoSQL document database.
- Mongoose: An ODM library for MongoDB and Node.js.
- Passport.js: Authentication middleware for Node.js.
- JWT: For implementing JSON Web Tokens for secure authentication.
This project integrates with the following IoT hardware components:
- Soil Sensor
- RFID Sensor
- Temperature and Humidity Sensor
- Gas Sensor
- Buzzer
- 4x LEDs for status indication
The project is organized into two main directories:
/server: Contains the backend application built with Node.js and Express. It handles the API endpoints, database interactions, and user authentication./src: Contains the frontend application built with React and Vite. It includes all the UI components, pages, and client-side logic.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js and npm
- MongoDB
- Git
-
Clone the repository:
git clone <repository-url> cd <repository-name>
-
Navigate to the server directory:
cd server -
Install dependencies:
npm install
-
Create a
.envfile in theserverdirectory and add the following environment variables:MONGODB_URI=<your_mongodb_connection_string> JWT_SECRET=<your_jwt_secret> -
Start the server:
npm start
-
Navigate to the root directory of the project.
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add your Supabase configuration:VITE_GEMINI_API_KEY=<your_gemini_api> VITE_API_URL=<your_api_url> VITE_WS_URL=<your_ws_url> -
Start the development server:
npm run dev
The application should now be running at http://localhost:5173.
npm run dev: Starts the Vite development server.npm run build: Builds the application for production.npm run lint: Lints the source code.npm run preview: Previews the production build.
npm start: Starts the Node.js server.npm run monitor: Runs the monitoring script.npm run add-admin: Runs a script to add a new admin user.
To deploy SenseHarvest, you will need to deploy the frontend and backend applications separately.
- Backend: The
serverdirectory can be deployed to any platform that supports Node.js applications, such as Heroku, AWS, or a DigitalOcean Droplet. - Frontend: The
srcdirectory can be built usingnpm run buildand the resultingdistfolder can be deployed to any static hosting provider like Netlify, Vercel, or GitHub Pages.
Make sure to configure the environment variables on your deployment platforms accordingly.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue on the GitHub repository.
If you would like to contribute code, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with a descriptive message.
- Push your changes to your forked repository.
- Open a pull request to the main repository.
This project is licensed under the MIT License. See the LICENSE file for details.