Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Byte me Byte me
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 5
    • Issues 5
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • JuvrajSingh.-
  • Byte meByte me
  • Wiki
  • Deliverable 3
  • System Architecture

System Architecture · Changes

Page history
Update System Architecture authored Apr 12, 2025 by Wenjun.Chen's avatar Wenjun.Chen
Show whitespace changes
Inline Side-by-side
Deliverable-3/System-Architecture.md
View page @ 931287ca
......@@ -2,48 +2,47 @@
https://drive.google.com/file/d/1CvoqH_p84jSwCTQ2__f6gZt2DyL88udK/view?usp=sharing
![image](uploads/1a3b6e42511c1f1db5d003976051b240/image.png)
**System Architecture Discussion**
The Smart Grocery Management Mobile App adopts a modular and scalable architecture consisting of four main layers: **Client Devices, Backend Server, Database, and External Services**. This structure ensures a clear separation of concerns, high maintainability, and strong support for collaborative and intelligent grocery management features.
**Client Devices (Mobile App)**
The client is built using React Native and runs on both Android and iOS platforms via Expo Go. It allows users to:
- Log in and register securely
- Manage grocery inventory
- Share data with group members
- View reminders, expense charts, and calorie tracking
- Receive AI generated recipe suggestions
The app communicates with the backend using HTTPS and JSON via REST API, ensuring secure and standardized data exchange.
**Backend Server (Node.js/Express)**
The backend uses Node.js with Express to expose REST API endpoints for:
- /users: Handles login, registration, and password reset
**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:
- 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 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: Manages grocery inventory actions (add, update, delete)
These endpoints are organized under a RESTful architecture, simplifying integration and promoting modularity. The backend also includes business logic for:
- /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:
- Email based password verification using Nodemailer
- AI recipe querying
- Calorie and BMI analysis
**Database (MongoDB via Mongoose)**
All data is persistently stored in a MongoDB database with the help of Mongoose for schema validation and object modeling. Collections include:
- users: Account data, BMI, preferences
- groups: Group metadata and member mapping
- items: Inventory items with expiry, price, calories
- logs: Food consumption and financial records
This design allows flexible schema evolution and efficient querying, supporting features like group synchronization and historical analytics
- Intelligent recipe requests to an external AI service
- 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
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
**External Services**
Two external APIs enhance app intelligence and communication:
- Gmail SMTP (via Nodemailer): Used to send 6 digit verification codes for password reset. This ensures secure identity validation
- Spoonacular API: Allows the backend to generate intelligent meal suggestions based on real time inventory and nutritional goals
| Attribute | Architectural Support |
| ------ | ------ |
| Secure authentication | HTTPS, JWT tokens, and email verification via SMTP |
| Group collaboration | Shared MongoDB model with role based logic and API synchronization |
| Expiry and usage notifications | REST API tracks expiry dates; frontend highlights them dynamically |
| Expense tracking | MongoDB logs combined with frontend charting |
| AI powered recipes | API connection to Spoonacular via backend HTTP requests |
| Cross platform compatibility | React Native enables iOS and Android support |
| Scalability | RESTful, modular backend + NoSQL flexibility |
| Maintainability and Testability | Clear separation of API logic, database schema, and external modules |
| 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 |
| 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 |
| Scalability | Modular backend and flexible NoSQL schema enable easy feature expansion |
| Maintainability and Testability | Clear separation of logic, database schemas, and service integrations |
Clone repository
  • Deliverable 2
    • Requirements Statement
    • UML Class Model
    • Use Case Descriptions and Scenarios
    • Use Case Model
  • Deliverable 3
    • Final Document
      • Challenges and How We Solved Them
      • Key summary of all participants
      • Video Link
    • System Architecture
    • Updated Class diagram
    • Updated Use case Diagram
  • Functional Properties
  • Participation Journal
View All Pages