How owenz0523/pet-feeder works
Project Overview
• PiPaws is an integrated project that seamlessly blends software and hardware. Its purpose is to let pet owners remotely dispense food using a web application while recording video (camera) feedback and feeding data.
• The system involves a frontend built with React.js/Tailwind.css, a backend implemented with Node.js and Python scripts, hardware control on a Raspberry Pi (using RPi.GPIO and Picamera libraries), and Firebase for authentication and data management.
Major Components
a. Frontend Web Application:
• User interface built with React.js. Indicate key pages such as Home, About, Account, Camera, and SignIn.
• Mention the use of Tailwind.css for styling and that Firebase is integrated for login/authentication and as the database.
• User interactions such as initiating food dispensing and viewing feeding logs.
b. Backend Services:
• Node.js Server (“server.js”) and related modules (like gpio.js) that likely act as the API layer communicating with frontend requests.
• Python service components such as camera.py, stepper.py, and test.py, which handle hardware-specific operations like image processing using the Picamera library and controlling rotational motors via GPIO.
• Integration between these services (for example, a Node.js process invoking or coordinating with Python scripts to operate hardware elements).
c. Hardware Control Module:
• Raspberry Pi’s role as the central hub for hardware connectivity.
• Camera sensor for capturing video/images during feeding and the motor control (through stepper.py) for dispensing food.
• How Raspberry Pi’s GPIO channels are used to interface with both the camera and the feeding mechanism (rotational motor).
d. External Services:
• Firebase for authentication and database services (storing feeding data, user credentials, etc.).
Relationships and Interactions
• From the Frontend (React app) to the Backend (Node.js server/API) for user commands (e.g., “Dispense Food” requests).
• From the Backend to the Hardware module (Python scripts running on the Raspberry Pi) indicating control commands for the motor and camera activation.
• From the Hardware module back to the Backend if there are status updates or processed data (e.g., image capture results).
• From the Frontend and Backend to Firebase for authentication and data persistence.
• Separation of concerns: UI/UX in the frontend, hardware interfacing in the backend/Python modules, and external cloud services for data management.
Architectural Patterns and Principles
• That the project uses a separation between the user interface and business logic through clearly partitioned frontend and backend folders.
• The design follows a service-oriented approach where the backend orchestrates hardware functionalities and interacts with external services.
• Modularity—each Python script (for camera, motor control, etc.) and Node.js component represents a specific responsibility.
• Patterns such as API-driven communication between components and event-driven triggers (e.g., activating the camera when food is dispensed).
Technologies, Frameworks, and Libraries
• Frontend: React.js, Tailwind.css, Firebase integration.
• Backend: Node.js (server.js, gpio.js), npm for package management.
• Hardware Control: Python scripts using the Picamera library and RPi.GPIO modules.
• Deployment: Instructions mention a Flask web application in the README (possibly for local testing), though the core backend for hardware communication appears to be Node and Python.
• Git as version control and possibly additional setup using requirements.txt (for Python dependencies).