A modern, feature-rich React application to track your daily grocery purchases with visual analytics and expiry alerts.
- Add Groceries - Track items with detailed information:
- Item name
- Category and subcategory
- Weight/quantity
- Price in Indian Rupees (βΉ)
- Purchase date
- Expiry date
- Status (In Stock / Finished)
-
Total Summary Cards
- Total items in stock
- Total amount spent
-
Visual Charts
- π Pie chart showing spending by category
- π Pie chart showing spending by subcategory
- Interactive tooltips and legends
- Color-coded visualization
-
π¨ Expired Items Alert (Red Flag)
- Displays all items that have passed their expiry date
- Shows when each item expired
- Remove button to mark items as finished
-
β οΈ Close to Expire Alert (Amber Flag)- Shows items expiring within the next 7 days
- Displays days remaining until expiry
- Remove button to mark items as finished
-
Sorting
- Sort groceries by date (Newest First / Oldest First)
-
Item Status Tracking
- Mark items as "In Stock" (π¦) - Active items
- Mark items as "Finished" (β) - Consumed/Disposed items
- Finished items remain in database for historical tracking
- Finished items don't appear in alerts
-
Comprehensive Dashboard Table
- View all items with all details
- Status indicators (In Stock / Finished)
- Faded appearance for finished items
-
Beautiful Modern Design
- Gradient purple-themed header with emoji decorations
- Animated header icons with bounce effect
- Responsive grid layout
- Smooth card animations on hover
-
Interactive Elements
- Hover effects on cards and buttons
- Slide-in animations for alerts
- Color-coded badges and indicators
- Form inputs with focus states
- Delete buttons with visual feedback
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd grocery-tracker- Install dependencies:
npm install- Start the development server:
npm start- Open your browser and navigate to:
http://localhost:3000
Runs the app in development mode. The page reloads automatically when you make changes.
Launches the test runner in interactive watch mode.
Builds the app for production in the build folder. The build is minized and ready for deployment.
Note: This is a one-way operation. Once you eject, you can't go back!
- React 19.2.3 - Frontend framework
- Recharts - Data visualization library for pie charts
- CSS3 - Styling and animations
- JavaScript (ES6+) - Core logic
grocery-tracker/
βββ public/
β βββ index.html
β βββ manifest.json
β βββ robots.txt
βββ src/
β βββ components/
β β βββ GroceryForm.js # Form to add new groceries
β β βββ GroceryDashboard.js # Table display of all items
β βββ data/
β β βββ groceryData.js # Sample initial data
β βββ App.js # Main app component
β βββ App.css # App styling
β βββ index.js # Entry point
β βββ setupTests.js
βββ package.json
βββ README.md
-
Add Items
- Fill in the form with item details
- Click "Add" to add to your grocery list
- Fields auto-reset after adding an item
-
View Analytics
- See total items and total spent at the top
- View spending breakdown in pie charts
- Check category and subcategory wise spending
-
Check Alerts
- Red alert shows expired items
- Amber alert shows items expiring soon
- Click "ποΈ Remove" to mark items as finished
-
Sort Items
- Use the sort dropdown to order by date
- Choose "Newest First" or "Oldest First"
-
Track Status
- Check the Status column in the dashboard
- "π¦ In Stock" = Active item
- "β Finished" = Consumed/Disposed item
Shows pie charts for spending by category and subcategory, grocery form for adding items, and the data table.
Beautiful gradient header with emoji decorations, summary cards showing total items and total spent, and smart alerts for expired items with remove buttons.
- Items marked as "Finished" don't appear in expiry alerts
- All finished items remain in the database for history
- Expired items have a red background color
- Close-to-expire items have an amber background
- Charts update automatically when you add/remove items
This project is open source and available under the MIT License.
Happy Grocery Tracking! π₯¬π₯π
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify