mypart (1)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

An E-Commerce Store

Project by:
Jie Zhou 0446860S
Shichen Liu 0432295
Shushu Qin 0434687
Taslima Sultana Juli 0447933
Contents
Project Overview............................................................................................................................3
Title.............................................................................................................................................3
Abstract......................................................................................................................................3
Project Scope..............................................................................................................................3
Objectives...................................................................................................................................3
Project Plan....................................................................................................................................4
Timeline......................................................................................................................................4
Resources....................................................................................................................................5
Requirements Documentation......................................................................................................5
Functional Requirements..........................................................................................................5
Non-Functional Requirements..................................................................................................6
Design Documentation...................................................................................................................7
System Architecture...................................................................................................................7
Detailed Design...........................................................................................................................8
Diagrams.....................................................................................................................................8
Development Documentation......................................................................................................13
Installation Instructions..........................................................................................................13
Usage.....................................................................................................................................13
Configuration.......................................................................................................................14
Dependencies........................................................................................................................14
Testing...................................................................................................................................14
Deployment...........................................................................................................................14
Source Code..............................................................................................................................15
Account Module...................................................................................................................15
Cart Module.........................................................................................................................16
Payment Module..................................................................................................................17
Store Module........................................................................................................................17
Project Overview
Title:
An E-Commerce Store

Abstract:
This project proposal outlines the development of PrimePicks, an e-commerce platform designed for a
professional online shopping experience. Key objectives include setting up the foundation using Django,
integrating secure payment processing, developing a robust shopping cart feature, implementing user
management functionalities, and AWS integration for scalability and reliability. The project will follow a
structured development approach, leveraging tools like Django, HTML/CSS/JavaScript, MySQL, and
AWS. The expected outcome is a fully functional e-commerce platform hosted on AWS, offering core
features like product listing, shopping cart management, secure payments, and user authentication.
PrimePicks aims to provide a premier destination for quality-conscious shoppers globally.

Project Scope
The Ecommerce Platform Development project aims to design and implement a functional web
application for online shopping, as part of our class project. This platform will feature user registration
and authentication, a product catalog, shopping cart functionality, and secure payment processing. It will
provide an easy-to-use interface for customers to browse products, manage their cart, and complete
purchases, as well as an admin interface for managing products, orders, and user accounts.

Key deliverables include:

 A responsive frontend for users to interact with the platform.


 A backend API to handle business logic and data management.
 A relational database schema to store user, product, and order information.
 Integration with a payment gateway like Stripe or PayPal for transaction processing.

Objectives:
A. E-commerce Foundation Setup
Establish the basic structure and layout of our eCommerce website using Django, ensuring a solid starting
point for development.
B. Payment Integration
Implement secure and efficient payment processing capabilities using PayPal to facilitate smooth
transactions.
C. Shopping Cart Development
Develop a robust shopping cart feature to manage user selections and streamline the checkout process,
manage shopping cart operations, including sessions, adding, deleting, updating items, and optimizing
performance for a better user experience.
D. User Management
Create comprehensive user management functionalities, including account creation, login, and profile
management, to enhance user experience.
E. Email Verification
Increase security and user trust by integrating email verification features into our user management
system.
F. AWS Integration
Use Amazon Web Services (AWS) for various aspects of our project, including storage (Amazon S3),
database management (Amazon RDS), and hosting (Amazon Elastic Beanstalk).
G. Shipping and Order Processing
Implement features to handle shipping logistics and order processing, ensuring efficient operations from
purchase to delivery.
H. Styling and Data Validation
Enhance the user interface with professional styling and ensure data integrity through rigorous validation
techniques.
I. Password Management
Implement secure password management features, including password hashing, reset, and recovery
options to protect user data.
J. Context Processors
Implement context processors to manage global variables effectively within Django.

Project Plan
Timeline
Week1: Planning and Design
Planning and Requirement Analysis: Conduct initial meetings with group members, finalize requirements,
and prepare the project plan.
Design: Design the database schema, create wireframes, and finalize the overall architecture.
Week2: Initial Implementation
Project Setup: Set up the Django project environment.
User Authentication: Develop user authentication features (registration, login, logout).
Product Management: Implement product listing, detail pages.
Week3: Core Feature Development
Shopping Cart: Develop shopping cart functionalities (add, remove, update items).
Checkout Process: Implement the checkout process.
Week4: Testing, Deployment and initial Maintence
Testing: Conduct unit testing, integration testing,
Deployment: Set up the AWS environment, configure the Django application for production, and deploy
the application.

Resources
Amazon Elastic Compute Cloud (EC2) is a cloud-based flexible computing service provided by
Amazon Web Services (AWS). EC2 allows users to rent virtual computing resources, called instances, to
run various types of applications in the cloud. EC2 instances provide scalability, security, and reliability,
and can dynamically adjust computing power based on demand. EC2 instances can be used to run a variety
of workloads, including website hosting, application development, big data processing, machine learning,
etc. We may use this service in subsequent projects.
Amazon Simple Storage Service (S3) is an object storage service provided by Amazon Web Services
(AWS). S3 allows users to store and retrieve any number of data objects in the cloud. S3 provides a secure,
reliable, and highly scalable storage solution suitable for a variety of different use cases and scenarios,
including data backup, static website hosting, data distribution, and big data analysis.
Amazon Relational Database Service (RDS) is a managed relational database service provided by
Amazon Web Services (AWS). RDS enables users to easily deploy, manage, and scale relational databases
in the cloud without having to manage the underlying database servers. With RDS, users can easily set up
database instances and automatically scale computing and storage resources as needed. RDS manages
routine database tasks such as backup, replication, fault recovery, and software updates to reduce the
management burden on users.

Requirements Documentation

Functional Requirements

1. User Registration and Authentication: We aim to ensure that users can seamlessly register on
our platform by providing a username, email, and password. To maintain the integrity of user
data, the system will verify user emails during the registration process. Post-registration, users
will be able to log in using their credentials securely. Additionally, our system will support a
robust password reset functionality via email, allowing users to reset their passwords safely if
they forget them.
2. User Account Management: Our platform will enable users to view and update their profile
information easily, ensuring their data remains current. Users will also have the ability to manage
their shipping addresses, allowing for efficient handling of orders. Furthermore, users will be
given the option to delete their accounts if they decide to leave the platform, ensuring they have
full control over their data.
3. Product Catalog: We will present a comprehensive list of products categorized by type,
enhancing the browsing experience for our users. Each product will have a detailed page
containing crucial information such as price, description, and images. To facilitate easy product
discovery, users will be able to search for products using relevant keywords.
4. Shopping Cart: Our system will allow users to add products to their shopping cart with ease.
Users will be able to view their cart at any time, seeing a summary of the selected products. They
will also have the flexibility to update the quantity of items or remove items from their cart as
needed.
5. Checkout and Payment: The checkout process will be straightforward, allowing users to
proceed to checkout from their shopping cart. During this process, the system will provide a
secure form for entering payment details. Users will receive a confirmation upon successful
payment, and in case of payment failures, the system will notify them with relevant information.
6. Order Management: Users will have access to their order history, enabling them to keep track
of past purchases. They will also be able to monitor the status of their current orders, providing
transparency and assurance throughout the delivery process.
7. Admin Interface: For efficient management, admins will be equipped with tools to manage
product listings, including adding new products, updating existing ones, and removing obsolete
items. Admins will also be able to manage user accounts, including viewing and editing user
information. Additionally, the admin interface will allow for comprehensive order management,
facilitating smooth order processing and customer service.
8. Content Management: The system will support the addition and updating of static content such
as FAQs, terms of service, and privacy policy. This ensures users have access to the latest
information and guidelines, enhancing their experience and trust in the platform.

Non-Functional Requirements

o Performance: Our system is designed to handle up to 1000 concurrent users efficiently. We aim
to ensure that page load times remain under 3 seconds under normal load conditions, providing a
smooth user experience. Additionally, the system will be capable of managing peak loads with
minimal performance degradation.
o Usability: We will prioritize an intuitive and easy-to-navigate user interface, ensuring a positive
user experience. The system will provide clear error messages and guidance for user actions,
helping users resolve issues independently. The website will be responsive and accessible across
various devices, including desktops, tablets, and smartphones.
o Reliability: Our goal is to achieve a system uptime of 99.9%, ensuring high availability. The
system will handle failures gracefully, offering meaningful error messages to users to help them
understand and manage issues. Automated backups of the database will be performed daily to
safeguard against data loss.
o Scalability: The system will be designed to scale horizontally, accommodating increased load as
user demand grows. The architecture will support the easy addition of new features and modules,
allowing for future expansion and enhancement without significant rework.
o Security: We will ensure that all sensitive data in transit is encrypted using HTTPS, protecting
user information from unauthorized access. User passwords will be securely hashed, and we will
implement measures to prevent common security threats such as SQL injection, cross-site
scripting (XSS), and cross-site request forgery (CSRF) attacks. Access to the admin interface will
be restricted to authorized personnel only.
o Maintainability: The codebase will be well-documented and adhere to coding standards,
facilitating easy maintenance and updates. The system will support automated testing to ensure
code quality and detect issues early. Configuration and deployment processes will be automated
using continuous integration and continuous deployment (CI/CD) pipelines, streamlining updates
and deployments.
o Compliance: Our system will comply with relevant data protection regulations such as the
General Data Protection Regulation (GDPR). User data will be handled in accordance with our
privacy policy, ensuring transparency and trustworthiness.
o Localization: The system will support multiple languages, allowing users from different regions
to use the platform in their preferred language. Users will be able to switch between languages
easily, enhancing the overall user experience and accessibility.

Design Documentation
System Architecture

The system architecture of the Ecommerce Platform Development project is designed to be robust,
scalable, and secure, ensuring a seamless experience for both users and administrators. At a high level,
the system is divided into three primary layers: the presentation layer, the application layer, and the data
layer.

o Presentation Layer: The presentation layer consists of the frontend, which is developed using
modern web technologies such as HTML, CSS, and JavaScript, with a framework like React or
Vue.js to create a responsive and dynamic user interface. This layer handles all interactions with
the users, including browsing products, managing the shopping cart, and performing checkout
operations.

o Application Layer: The application layer comprises the backend, built with Django, a high-level
Python web framework. This layer is responsible for processing user requests, implementing
business logic, and interfacing with the database. It includes functionalities such as user
authentication, product management, order processing, and payment integration. The backend
exposes RESTful APIs that the frontend consumes to perform various operations.

o Data Layer: The data layer uses a relational database management system (RDBMS) such as
PostgreSQL to store all persistent data. This includes user information, product details, order
records, and transaction histories. The database schema is designed to optimize performance and
ensure data integrity, with relationships defined between different entities to facilitate efficient
data retrieval and manipulation.

o Third-Party services:
The system architecture incorporates third-party services for specific functionalities. For payment
processing, we integrate with Stripe or PayPal, ensuring secure and reliable transactions. The
application is deployed on a cloud platform such as AWS or Heroku, leveraging their free tiers
for hosting, storage, and database services. This setup not only reduces costs but also provides
scalability and reliability.
To ensure security and performance, the system uses HTTPS for encrypting data in transit,
implements secure password hashing algorithms, and includes measures to prevent common web
vulnerabilities such as SQL injection, cross-site scripting (XSS), and cross-site request forgery
(CSRF). The architecture supports horizontal scaling to handle increased loads and is designed to
facilitate the addition of new features and modules with minimal disruption.
Detailed Design

The detailed design of the Ecommerce Platform Development project breaks down each component of the
system, providing specific specifications and diagrams to illustrate their functionalities and interactions.

o Frontend: The frontend is structured around a single-page application (SPA) model. It includes
components for various pages such as the home page, product catalog, product detail pages,
shopping cart, checkout, and user account management. Each component is designed to be
reusable and maintainable, following the principles of modular design. For example, the product
card component can be used in both the product catalog and related products section on the
product detail page. The frontend communicates with the backend through RESTful APIs,
sending and receiving data in JSON format.

o Backend: The backend is organized into multiple modules, each responsible for a specific
domain of the application. The user module handles registration, login, profile management, and
password reset functionalities. The product module manages CRUD operations for products,
including categorization and search functionalities. The cart module implements the shopping
cart logic, allowing users to add, update, and remove items. The order module processes orders,
manages order statuses, and integrates with the payment gateway. The admin module provides
interfaces for administrators to manage products, users, and orders. Each module is accompanied
by a set of unit tests to ensure functionality and reliability.
o Database Schema: The database schema is designed to support the various entities and their
relationships within the system. The primary tables include Users, Products, Categories, Carts,
CartItems, Orders, OrderItems, and Payments. The Users table stores user credentials and profile
information. The Products table contains details about each product, linked to the Categories table
to facilitate product categorization. The Carts and CartItems tables track the contents of each
user's shopping cart. The Orders and OrderItems tables record completed transactions, while the
Payments table logs payment details and statuses. Each table includes indexes on key columns to
optimize query performance.

o Admin Interface: The admin interface is built using Django's admin framework, providing a
straightforward way for administrators to manage the platform. It includes views for managing
product listings, processing orders, and handling user accounts. The admin interface also supports
bulk operations and provides comprehensive search and filter capabilities to facilitate efficient
management.

Diagrams

Diagrams play a crucial role in visualizing the system's design. An Entity-Relationship (ER)
diagram illustrates the database schema, showing the relationships between tables. A Component
Interaction diagram depicts the interactions between frontend components and backend modules,
as well as the flow of data between them. Additionally, a Sequence diagram outlines the steps
involved in key processes such as user registration, product checkout, and order processing.
Diagram 1: ER diagram illustrating Database Schema
Diagram 2: Component Interaction Diagram

Diagram 3: Sequence diagram:


Diagram 3.1 : Product checkout
Diagram 3.2: User registration
Diagram 4: API interaction Diagram

Diagram 5: Frontend
Development Documentation
This project is a comprehensive web application designed to facilitate online shopping. It incorporates
features for user account management, shopping cart functionalities, payment processing, and product
display. The project is organized into multiple modules, each responsible for specific functionalities,
making it modular and easy to maintain.

Installation Instructions

To set up the project locally, users have to follow these steps:

1. Clone the repository:

bash
Copy code
git clone <repository_url>
cd ecommerce

2. Set up a virtual environment:

bash
Copy code
python3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`

3. Install dependencies:

bash
Copy code
pip install -r requirements.txt

4. Apply migrations:

bash
Copy code
python manage.py migrate

5. Run the development server:

bash
Copy code
python manage.py runserver

Usage

To use the project:

1. Register a new account or log in with existing credentials.


2. Browse products and add items to the shopping cart.
3. Proceed to checkout and complete the payment process.

Configuration

The project can be configured using environment variables. Create a .env file in the root directory and add
the necessary configurations.

Example:

makefile
Copy code
DEBUG=True
SECRET_KEY='your-secret-key'
DATABASE_URL='your-database-url'

Dependencies

The project dependencies are listed in requirements.txt. To install them, run:

bash
Copy code
pip install -r requirements.txt

Testing

To run tests, use the following command:

bash
Copy code
python manage.py test

Deployment

To deploy the project, follow these steps:

1. Set up AWS Elastic Beanstalk CLI:

bash
Copy code
eb init -p python-3.7 ecommerce --region us-west-2

2. Create an environment and deploy:

bash
Copy code
eb create ecommerce-env
eb deploy
3. Open the application in a browser:

bash
Copy code
eb open

Source Code

The source code for the project is structured into various modules, each handling specific functionalities
such as account management, shopping cart operations, payment processing, and product management.
Below is a detailed description of the key source files and their purposes:

Account Module

token.py

This file likely handles token generation and verification for user authentication and password reset
functionalities.

models.py

Defines the data models related to user accounts.

apps.py

Configuration for the account app within the Django project.

forms.py

Contains forms for user registration, login, and profile management.

admin.py

Configuration for managing user accounts in the Django admin interface.

tests.py

Unit tests for the account module.

urls.py

URL routing for account-related pages.

views.py
Handles HTTP requests and responses for account actions such as registration, login, profile updates, and
password resets.

Templates

 profile-management.html: Template for managing user profiles.


 delete-account.html: Template for deleting user accounts.
 dashboard.html: User dashboard template.
 my-login.html: Custom login template.
 track-orders.html: Template for tracking orders.
 manage-shipping.html: Template for managing shipping addresses.
 Registration templates for email verification, registration, and password reset processes.

Cart Module

cart.py

Core functionality for managing the shopping cart, including adding, removing, and updating items.

models.py

Defines the data models related to the shopping cart.

apps.py

Configuration for the cart app within the Django project.

context_processors.py

Provides cart context data to templates.

admin.py

Configuration for managing the cart in the Django admin interface.

tests.py

Unit tests for the cart module.

urls.py

URL routing for cart-related pages.

views.py

Handles HTTP requests and responses for cart actions such as adding items to the cart, viewing the cart,
and updating the cart.

Templates
 cart-summary.html: Template for displaying the cart summary.

Payment Module

templates

 payment-success.html: Template displayed after a successful payment.


 payment-failed.html: Template displayed after a failed payment.
 checkout.html: Template for the checkout process.

Store Module

models.py

Defines the data models for products and categories.

apps.py

Configuration for the store app within the Django project.

admin.py

Configuration for managing products and categories in the Django admin interface.

tests.py

Unit tests for the store module.

urls.py

URL routing for store-related pages.

views.py

Handles HTTP requests and responses for viewing products, categories, and product details.

Templates

 base.html: Base template for the store.


 product-info.html: Template for displaying product information.
 store.html: Template for the store's main page.
 list-category.html: Template for listing products by category.

You might also like