... | ... | @@ -6,31 +6,35 @@ https://drive.google.com/file/d/1CvoqH_p84jSwCTQ2__f6gZt2DyL88udK/view?usp=shari |
|
|
**System Architecture Discussion**
|
|
|
The Smart Grocery Management Mobile App is built on a modular, scalable architecture comprising four key layers:** Presentation (Client Devices), Application (Backend Server), Data (Database), and External Services**. This layered structure ensures a clear separation of concerns, facilitates maintainability, and provides robust support for collaborative, intelligent grocery management functionalities.
|
|
|
Presentation Layer (Client Devices – Mobile App)
|
|
|
The client side application is developed using React Native, enabling cross-platform deployment on both Android and iOS through Expo Go. Core functionalities offered to users include:
|
|
|
The client side application is developed using React Native, enabling cross-platform deployment on both Android and iOS through Expo Go. Core functionalities offered to users include:
|
|
|
- Secure user login and registration
|
|
|
- Grocery inventory management
|
|
|
- Group based data sharing and collaboration
|
|
|
- Real time reminders, expense visualization, and calorie tracking
|
|
|
- AI powered recipe suggestions based on available inventory
|
|
|
The mobile app communicates with the backend over HTTPS, using JSON formatted data via RESTful API calls to ensure secure and standardized information exchange
|
|
|
Application Layer (Backend Server – Node.js/Express)
|
|
|
The mobile app communicates with the backend over HTTPS, using JSON formatted data via RESTful API calls to ensure secure and standardized information exchange
|
|
|
|
|
|
**Application Layer (Backend Server – Node.js/Express)**
|
|
|
The backend is built with Node.js and Express, exposing a set of REST API endpoints for core functionalities:
|
|
|
- /users: Handles user registration, login, and password reset
|
|
|
- /group: Manages group creation, joining, leaving, and ownership transfer
|
|
|
- /items: Supports adding, updating, and deleting inventory items
|
|
|
These endpoints follow RESTful principles to ensure modularity and ease of integration. Beyond routing, the backend also implements essential business logic such as:
|
|
|
These endpoints follow RESTful principles to ensure modularity and ease of integration. Beyond routing, the backend also implements essential business logic such as:
|
|
|
- Email based password verification using Nodemailer
|
|
|
- Intelligent recipe requests to an external AI service
|
|
|
- Calorie and BMI computations for personalized health tracking
|
|
|
Data Layer (Database – MongoDB via Mongoose)
|
|
|
- Calorie and BMI computations for personalized health tracking
|
|
|
-
|
|
|
**Data Layer (Database – MongoDB via Mongoose)**
|
|
|
Persistent data storage is handled by MongoDB, with Mongoose used for schema validation and object modeling.
|
|
|
The database structure supports the following collections:
|
|
|
- Users: Stores account credentials, BMI data, and user preferences
|
|
|
- Groups: Records group metadata and member associations
|
|
|
- Items: Contains inventory items with attributes like expiry, price, and calorie value
|
|
|
- Logs: Tracks food consumption history and financial records
|
|
|
This flexible schema supports efficient querying and easy schema evolution, enabling real time group synchronization and historical data analytics.
|
|
|
External Services
|
|
|
|
|
|
This flexible schema supports efficient querying and easy schema evolution, enabling real time group synchronization and historical data analytics.
|
|
|
|
|
|
**External Services **
|
|
|
To extend core functionality, the system integrates with two external services:
|
|
|
- Gmail SMTP (via Nodemailer): Used for sending 6 digit verification codes during password reset workflows, enhancing account security
|
|
|
- Spoonacular API: Provides personalized recipe suggestions by analyzing the user’s inventory and dietary preferences
|
... | ... | @@ -40,7 +44,7 @@ To extend core functionality, the system integrates with two external services: |
|
|
| ------ | ------ |
|
|
|
| Secure authentication | HTTPS, JWT tokens, and email verification via SMTP |
|
|
|
| Group collaboration | Shared MongoDB group model with role based access and synchronized REST API endpoints |
|
|
|
| Expiry and usage alerts | | Backend tracks expiry dates; frontend displays dynamic notifications |
|
|
|
| Expiry and usage alerts | Backend tracks expiry dates; frontend displays dynamic notifications |
|
|
|
| Expense tracking | MongoDB logging combined with client side charting features |
|
|
|
| AI powered recipes | Backend connects to Spoonacular API to generate intelligent suggestions |
|
|
|
| Cross platform compatibility | React Native ensures compatibility with both iOS and Android devices |
|
... | ... | |