SRS Group8 MidSem
SRS Group8 MidSem
Specification
For
Prepared by
08/10/24
1. INTRODUCTION
This project aims to develop an interactive web-based (will be integrated at a later point)
Inventory Management System that automates stock level tracking, order management, and
product information. By providing real-time insights and using a SQL database to store data,
the system will help businesses maintain accurate records, reduce errors, and optimize
inventory levels. The primary goal is to improve operational efficiency and streamline
decision-making, ensuring that businesses can meet customer demand while minimizing
costs.
Target Beneficiaries
The primary beneficiaries of the Inventory Management System are small to medium-sized
businesses (SMBs) that require efficient tools to manage their stock levels, orders, and
product information. These businesses often lack the resources or infrastructure to implement
complex enterprise-level inventory systems, making them ideal candidates for a user-friendly,
web-based solution.
Key beneficiaries include:
In addition to these core groups, other stakeholders such as sales teams, customer service
staff, and financial managers will also benefit from enhanced inventory visibility and
improved decision-making capabilities.
Project Scope
An interactive inventory control management system is a web-based platform designed to
help businesses efficiently manage their stock levels, orders, and product information. The
system typically uses a SQL (Structured Query Language) database to store and retrieve data,
ensuring that the inventory records are accurate, up-to-date, and easily accessible.
References
Inventory Management for Dummies by Mark Sigfried
Official Documentation of MySQL or PostgreSQL
2. Project Description
Reference Algorithm for Database Structure
1. Entities and Relationships
Users: Represents individuals using the system. Each user can have
multiple addresses and orders.
Addresses: Each address is associated with a user and optionally
linked to an order.
Orders: Each order is linked to a user and can have multiple items
associated with it.
Order Items: Represents the specific products in each order.
Products: Products available for purchase, categorized into different
categories.
Categories: Groups of products organized for better navigation and
management.
Transactions: Represents payment transactions for orders.
2. Table Structures
User Table:
o id (Primary Key)
o roleId (Foreign Key)
o firstName, middleName, lastName, username, mobile, email,
passwordHash, registeredAt, lastLogin, intro, profile
Address Table:
o id (Primary Key)
o userId (Foreign Key referencing User)
o orderId (Foreign Key referencing Order, optional)
o firstName, middleName, lastName, mobile, email, line1,
line2, province, country, createdAt, updatedAt
Order Table:
o id (Primary Key)
o userId (Foreign Key referencing User)
o createdAt, updatedAt, content
Order Item Table:
o id (Primary Key)
o orderId (Foreign Key referencing Order)
o productId (Foreign Key referencing Product)
o quantity, price, createdAt, updatedAt
Product Table:
o id (Primary Key)
o title, summary, type, createdAt, updatedAt, content
Category Table:
o id (Primary Key)
o parentId (Foreign Key referencing itself for nested
categories)
o title, metaTitle, slug, content
Transaction Table:
o id (Primary Key)
o userId (Foreign Key referencing User)
o orderId (Foreign Key referencing Order)
o code, type, mode, status, createdAt, updatedAt, content
4. Query Logic
Add a New User: Insert a record in the User table.
Add an Address for a User: Insert a record in the Address table
referencing the userId.
Create an Order: Insert a record in the Order table with the
associated userId.
Add Order Items: For each order, insert records in the Order Item
table linking them with orderId and productId.
Record a Transaction: Insert a record in the Transaction table
with associated orderId.
Characteristics of Data
1. Entity Relationships:
a. Users: Contains personal details and role information. Each
user can have multiple addresses and transactions.
b. Addresses: Represents the locations associated with users,
including home and office addresses.
c. Orders: Tracks user purchases, each of which can consist of
multiple items.
d. Order Items: Provides a breakdown of products within each
order, linking them to both the order and the product.
e. Products: Includes product details, such as type, title, and
description.
f. Categories: Hierarchical structure to classify products,
allowing for nested categories.
g. Transactions: Captures financial activities related to user
orders, including their status and type.
2. Data Types:
a. The dataset utilizes various data types, including BIGINT for
IDs, VARCHAR for textual information, and DATETIME for
timestamps.
3. Cardinality:
a. One-to-Many Relationships:
i. A user can have multiple addresses and transactions.
ii. An order can contain multiple order items.
iii. A category can have subcategories.
b. Many-to-One Relationships:
i. Order items reference a single order and a single
product.
4. Data Distribution:
a. The dataset may contain categorical data (e.g., product types,
status codes) and continuous data (e.g., timestamps, prices).
5. Completeness:
a. Ensure that all essential fields are populated to maintain
referential integrity. For example, every transaction must be
associated with an order and a user.
2. Stratified Sampling:
a. To understand distinct user demographics or product
categories, stratified sampling can be employed. For example,
users can be grouped based on geographical location or user
role, and random samples can be taken from each group.
3. Systematic Sampling:
a. Selecting every nth user or order from a sorted list can
provide a systematic approach to sampling.
4. Convenience Sampling:
a. For preliminary analysis or testing hypotheses, a convenience
sample (e.g., the first 100 users) may be used, although this
can introduce bias.
Statistical Methods Used for Data Processing
1. Descriptive Statistics:
a. Calculate measures such as mean, median, mode, and
standard deviation to summarize user behavior, transaction
amounts, and product performance.
2. Inferential Statistics:
a. Utilize hypothesis testing to make inferences about user
behavior from a sample to the larger population.
b. Confidence intervals may be constructed to estimate the
average transaction value with a specified level of confidence.
3. Regression Analysis:
a. Conduct regression analysis to understand relationships
between variables (e.g., how user demographics influence
transaction amounts).
4. Data Aggregation:
a. Aggregate data at various levels (e.g., monthly sales, average
order size per user) to provide insights into trends over time.
5. Data Cleaning Techniques:
a. Identify and handle missing values, outliers, and duplicate
records to improve data quality and accuracy.
6. Data Visualization:
a. Use graphical representations (e.g., histograms, pie charts,
scatter plots) to visualize distributions, relationships, and
trends within the data.
SWOT Analysis
Strengths
1. Well-Defined Structure:
a. The database schema includes distinct tables for entities like
users, orders, products, addresses, etc., promoting data
organization and clarity.
2. Referential Integrity:
a. Foreign key relationships are established (though not
explicitly shown in the provided SQL), ensuring that data
remains consistent across related tables.
3. Scalability:
a. The use of BIGINT for IDs accommodates a large number of
entries, making it suitable for scaling as user or product data
grows.
4. Timestamp Tracking:
a. The inclusion of createdAt and updatedAt columns helps in
tracking changes and managing data lifecycle effectively.
5. Comprehensive Data Types:
a. Various data types are employed to suit different attributes,
enhancing data validation and integrity.
Weaknesses
1. Lack of Constraints:
a. Without defined foreign keys in the given code, there's a risk
of orphaned records (e.g., an order referencing a non-existent
user).
2. Redundancy:
a. Some fields might have redundancy or overlap (e.g., product
summaries in multiple tables), leading to potential data
inconsistency.
3. No Normalization Mentioned:
a. While the structure appears organized, normalization could be
examined further to eliminate redundancy and ensure
efficient data storage.
4. Limited Error Handling:
a. The provided SQL does not include any error handling
mechanisms for transactions, which could lead to data
integrity issues.
Opportunities
1. User Management
a. Register User: Allows new users to create an account by
providing necessary information (e.g., name, email,
password).
b. Login/Logout: Users can securely log in and out of their
accounts.
c. Update Profile: Users can edit their personal information and
preferences.
2. Product Management
a. Browse Products: Users can view a list of available products,
filtered by category or brand.
b. Search Products: Users can search for specific products
using keywords or criteria.
c. View Product Details: Users can view detailed information
about a specific product, including descriptions, pricing, and
specifications.
3. Shopping Cart Functionality
a. Add to Cart: Users can add products to their shopping cart
for later purchase.
b. Remove from Cart: Users can remove items from their cart.
c. View Cart: Users can view the contents of their shopping
cart, including quantities and total price.
4. Order Management
a. Place Order: Users can finalize their purchases and place
orders for the items in their cart.
b. View Order History: Users can access a history of their past
orders, including details of each order.
c. Track Order Status: Users can track the status of their
current orders.
5. Payment Processing
a. Select Payment Method: Users can choose from various
payment options (credit card, debit card, UPI, etc.).
b. Process Payment: Users can complete the payment for their
orders.
c. View Transaction Status: Users can check the status of
their payment transactions.
6. Address Management
a. Add Address: Users can add new shipping addresses for their
orders.
b. Edit Address: Users can modify existing address details.
c. Remove Address: Users can delete addresses they no longer
use.
7. User Reviews and Ratings
a. Submit Review: Users can leave reviews and ratings for
products they have purchased.
b. View Reviews: Users can read reviews submitted by others
for specific products.
1. Customers/End Users
Description: Individuals who visit the platform to browse, search,
and purchase products.
Typical Actions:
o Register an account.
o Log in and manage their profiles.
o Browse and search for products.
o Add products to their shopping cart.
o Place orders and manage payment options.
o View order history and track orders.
o Provide reviews and ratings for purchased products.
2. Administrators
Description: Users responsible for managing the overall
functionality of the database and the system.
Typical Actions:
o Monitor user activity and manage user accounts (create,
update, deactivate).
o Manage product listings, including adding, editing, or
removing products.
o Review and manage orders and transactions.
o Generate reports and analytics on sales, user activity, and
inventory.
o Handle customer service inquiries and issues.
3. Guest Users
Description: Users who have not registered an account but can
browse the catalog.
Typical Actions:
o Browse products and categories.
o Search for specific items.
o View product details (without the ability to purchase).
4. Marketing Personnel
Description: Users who handle marketing and promotional
activities for the platform.
Typical Actions:
o Create and manage marketing campaigns.
o Analyze user engagement and sales data.
o Implement SEO strategies and track their effectiveness.
o Manage content on the website to promote products.
5. Technical Support/IT Staff
Description: Users responsible for maintaining the technical
aspects of the database and system.
Typical Actions:
o Monitor database performance and troubleshoot issues.
o Implement software updates and security measures.
o Backup and restore database data as needed.
6. Delivery Personnel (Logistics)
Description: Users involved in the physical delivery of products to
customers.
Typical Actions:
o Access and manage delivery orders.
o Update order statuses as products are shipped and delivered.
o Communicate with customers regarding delivery timelines.
7. Data Analysts
Description: Users responsible for analyzing data to derive insights
for decision-making.
Typical Actions:
o Generate reports on user behavior, sales trends, and
inventory status.
o Analyze customer feedback and reviews for product
improvements.
Timing Requirements:
o Response time for queries should be less than 200
milliseconds for user-initiated actions.
o Batch processes (like report generation) should complete
within a designated window (e.g., overnight).
Memory Requirements:
o Minimum of 8 GB RAM for development environments.
o Production environments may require 16 GB or more
depending on the volume of concurrent users and data size.
o Sufficient disk space (SSD recommended) for database
storage, backups, and logs (at least 500 GB).
2. Interfaces to Other Applications
Payment Gateway Integration: Interfaces for third-party
payment processing services (e.g., PayPal, Stripe).
Shipping Services API: Integration with shipping providers (e.g.,
UPS, FedEx) for tracking and logistics.
Email Service Providers: Integration with services like SendGrid
or Mailgun for email notifications and marketing.
Analytics Tools: Integration with tools like Google Analytics for
tracking user behavior on the website.
3. Specific Technologies and Tools
Database Management System (DBMS): MySQL, PostgreSQL, or
any relational database that supports SQL.
Web Framework:
o Frontend: React.js, Angular, or Vue.js for dynamic user
interfaces.
o Backend: Node.js, Django (Python), or Spring Boot (Java).
Version Control: Git for source code management.
Containerization: Docker for environment consistency across
development and production.
4. Parallel Operations
Asynchronous Processing: Implement asynchronous processing
for tasks like order confirmation emails, notifications, and batch
jobs.
Load Balancing: Utilize load balancers to distribute user requests
across multiple servers to enhance performance and redundancy.
5. Language Requirements
Database Language: SQL for database operations and queries.
Programming Languages:
o Frontend: JavaScript/TypeScript for client-side scripting.
o Backend: Python, Java, or JavaScript (Node.js) for server-side
logic.
6. Communications Protocols
HTTP/HTTPS: Use HTTPS for secure communication between the
client and server.
RESTful API: Design APIs following REST principles for client-server
communication.
WebSocket: For real-time features (e.g., live notifications).
7. Security Considerations
Authentication: Implement OAuth 2.0 or JWT for user
authentication and session management.
Data Encryption: Encrypt sensitive data both at rest (in the
database) and in transit (using TLS/SSL).
Input Validation: Sanitize and validate all user inputs to prevent
SQL injection and cross-site scripting (XSS) attacks.
Role-Based Access Control (RBAC): Implement user roles to
restrict access to certain functionalities based on user class.
Regular Security Audits: Conduct periodic security assessments
and penetration testing.
8. Design Conventions or Programming Standards
Code Structure: Follow MVC (Model-View-Controller) architecture
for organizing the codebase.
Naming Conventions: Use camelCase for JavaScript, snake_case
for Python, and PascalCase for class names.
Commenting and Documentation: Maintain clear documentation
and comments in the codebase to ensure maintainability.
Versioning: Implement semantic versioning for API and application
releases.
Design Diagram:
1. User Adoption:
a. Assumption that target users (customers, administrators) will
adopt and effectively use the system without extensive
training.
b. The assumption that users have access to the necessary
hardware (smartphones, computers) and internet
connectivity.
2. Scalability Needs:
a. Assumption regarding the projected growth in user base and
data volume, which could affect future scalability
requirements.
b. It is assumed that the initial user load will remain stable or
grow predictably over time.
3. Technology Changes:
a. Assumption that chosen technologies (e.g., programming
languages, frameworks) will remain relevant and supported
throughout the project lifecycle.
b. Assumed compatibility with future updates of the underlying
platforms and tools.
4. Regulatory Compliance:
a. Assumption that the project will remain compliant with
existing data protection regulations (e.g., GDPR, CCPA)
without significant changes in the legal landscape.
5. Security Threat Landscape:
a. Assumption that the current security measures are sufficient
to mitigate foreseeable threats but may not account for future
vulnerabilities.
b. The effectiveness of user authentication and authorization
processes may depend on user behavior (e.g., password
strength).
6. Third-Party Services Stability:
a. Assumption that third-party services (like payment gateways
and APIs) will remain operational and provide consistent
performance.
Dependencies on External Factors
1. Third-Party APIs:
a. Dependency on external APIs for functionalities such as
payment processing, shipping logistics, and email
notifications. Any changes or outages in these services could
affect system operations.
2. Internet Connectivity:
a. Dependency on reliable internet connectivity for users to
access the application, which could be influenced by external
factors like ISP performance and outages.
3. Hosting Environment:
a. Dependency on the chosen hosting provider for uptime and
performance. Any issues with the hosting environment (e.g.,
server downtime, maintenance) can directly affect the
application's availability.
4. Regulatory Environment:
a. Changes in laws or regulations related to data protection,
online commerce, or payment processing could necessitate
adjustments to the database and application.
5. User Behavior:
a. Variations in user behavior, such as unexpected spikes in
traffic or changes in how users interact with the system, can
impact performance and may require scalability adjustments.
6. Technological Advancements:
a. Dependency on advancements in technology that may
necessitate updates to the application (e.g., new security
practices, database optimizations).
7. Market Trends:
a. Changes in user preferences or industry standards may
influence feature development and enhancements, requiring
the project to adapt accordingly.
3. System Requirements:
User Interface:
The Inventory Management System requires a user-friendly interface for seamless interaction
between users and the system. The main software components that need a user interface
include:
Product Management: This component allows users to add, update, or delete product
information. It includes fields for product name, SKU, quantity, price, and supplier
details.
User Authentication: Login screens and role-based access controls for secure user
interaction.
These interfaces ensure easy navigation and efficiency in managing inventory data.
Software Interface:
The Inventory Management System consists of interconnected modules that communicate to
ensure seamless operation. Key modules include Product Management, Order Management,
User Management, and Reporting.
Module Connections
Product Management Module: This module communicates with the Order
Management and Reporting modules to update inventory when stock is added or
orders are processed. It retrieves and updates product details from the SQL database.
Order Management Module: This module connects with the Product Management
module to update stock levels after processing orders. It also interacts with Supplier
Management for reordering stock when inventory levels are low.
Database Interface:
The Inventory Management System utilizes a Relational Database Management System
(RDBMS), specifically MySQL or PostgreSQL, for efficient data storage, retrieval, and
management. These systems are chosen for their robustness, scalability, and strong support
for SQL, which is essential for executing complex queries and transactions.
Key Features:
Data Integrity and Consistency: Both MySQL and PostgreSQL ensure data integrity
through the use of primary keys, foreign keys, and constraints. This helps maintain
accurate relationships between different data entities, such as products and orders.
Scalability: MySQL and PostgreSQL can handle growing data needs, allowing the
system to scale with the business. They support large datasets and high transaction
volumes, making them suitable for businesses of all sizes.
SQL Support: The use of Structured Query Language (SQL) allows for powerful data
manipulation, enabling complex queries for reporting and analysis. Users can easily
generate insights on inventory trends and performance.
Security: Both database systems offer robust security features, including user
authentication, role-based access control, and data encryption, ensuring sensitive
information is protected.
This database interface plays a crucial role in maintaining accurate and efficient inventory
management, providing a solid foundation for the application’s data operations.
Protocols:
The Inventory Management System employs several protocols to ensure secure and efficient
communication between its components and the database. Below are the key requirements
and considerations related to these protocols:
Communication Protocols
HTTP/HTTPS: The system uses Hypertext Transfer Protocol (HTTP) for data
exchange between the front-end and back-end. To enhance security, HTTPS (HTTP
Secure) is implemented, which encrypts data during transmission using SSL/TLS
protocols. This ensures that sensitive information, such as user credentials and
inventory data, remains protected from eavesdropping and man-in-the-middle attacks.
RESTful API Protocol: The system follows RESTful architecture for its APIs,
utilizing standard HTTP methods (GET, POST, PUT, DELETE) for communication.
This enables clear and stateless interactions, making it easier to manage requests and
responses.
Token-Based Authentication: JSON Web Tokens (JWT) are used for user
authentication, allowing secure access to the API. Each token contains encoded user
information and is validated on each request, preventing unauthorized access.
Synchronization Mechanisms
Database Transactions: ACID properties ensure data consistency during simultaneous
operations. Transactions are utilized to maintain integrity, especially during stock
updates and order processing.
4.Non-Functional Requirments
Performance Requirements:
The Inventory Management System must meet the following performance criteria:
Response Time: User interactions, like dashboard loading, should respond within 2
seconds. Reports should generate in under 5 seconds.
Throughput: The system must handle at least 100 concurrent users without
performance issues.
Data Retrieval Speed: Product queries should return results within 1 second; complex
queries should execute within 3 seconds.
Real-Time Operations:
o Stock Updates: Changes should reflect within 2 seconds.
o Order Processing: Orders should be confirmed within 3 seconds.
Functional Requirements:
o Product Management: Add/update products within 2 seconds; bulk imports of
500 records in under 5 seconds.
o Order Management: Real-time status updates within 2 seconds.
o Reporting: Standard reports in 3 seconds; complex reports in up to 10 seconds.
Security Requirements:
The Inventory Management System must meet stringent security and privacy requirements to
protect user data and ensure system integrity.
Data Protection
Data Encryption: Sensitive data, including user credentials and inventory information,
must be encrypted in transit (using TLS/SSL) and at rest (using AES-256).
Access Control: Role-based access control (RBAC) should restrict user access based
on roles, ensuring users can only access relevant data and functionalities.
Data Validation: Input data must be validated to prevent SQL injection and cross-site
scripting (XSS) attacks.
Regular Security Audits: The system should undergo regular security audits to
identify and mitigate potential threats.
These requirements are essential for safeguarding user data and ensuring compliance with
relevant regulations.
2. Availability: The degree to which the system is operational and accessible when
required. High availability is crucial for inventory management to ensure continuous
access for users and real-time updates.
3. Correctness: The system's accuracy in processing and managing data. It ensures that
outputs reflect the correct operations, minimizing errors in inventory tracking and
reporting.
4. Flexibility: The ease with which the system can accommodate new features or
changes in functionality. This attribute allows the inventory management system to
adapt to emerging business needs without significant overhaul.
5. Interoperability: The ability of the system to work seamlessly with other systems and
applications. This is vital for integrating with third-party tools, such as accounting
software or e-commerce platforms.
6. Maintainability: The ease with which the system can be updated or repaired. High
maintainability ensures that developers can efficiently address issues, implement
enhancements, and reduce downtime.
10. Robustness: The system's ability to handle errors or unexpected inputs gracefully,
maintaining functionality without crashing. This is essential for ensuring continuous
operation in inventory management.
11. Testability: The ease with which the system can be tested to ensure it meets
requirements and performs as expected. High testability facilitates quality assurance
processes and helps identify defects early.
12. Usability: The user-friendliness of the system, encompassing how intuitive and easy it
is for users to navigate and perform tasks. High usability enhances user satisfaction
and reduces training time.
5. Other Requirements
2. Training: Adequate training programs must be implemented for users to ensure they
can effectively utilize the system. This includes training on new features and updates.
3. Backup and Recovery: The system should implement regular data backups to prevent
data loss in case of failures. A disaster recovery plan must also be in place to restore
system functionality quickly.
5. Scalability: The system should be designed to scale easily as the business grows,
accommodating an increasing number of users and larger data sets without
performance degradation.
8. Audit Logging: An audit trail should be maintained to log user actions and changes
within the system, enhancing accountability and facilitating troubleshooting.
These additional requirements play a critical role in ensuring the Inventory Management
System is robust, user-friendly, and aligned with business objectives and regulatory
standards.