Professional Documents
Culture Documents
OF
CRWN CLOTHING
A E-Commerce for clothing
by
RISHAV RAJ
1901270100042
Final Year CSE
SUBMITTED TO
Mr. Renu Kumar
Contents
Chapter 1 1
Introduction 1
1.1 Motivation 1
1.2 Objective 1
Chapter 2 2
Project Title 2
Chapter 3 3
Chapter 4 4
Working Methodology 4
4.1 Agile 4
Chapter 5 5
5.1.1 App 6
5.1.6 Firebase 7
Chapter 6 9
Technologies used 9
6.3 Hosting 9
Code 11
Chapter 7 30
Conclusion 30
1
Chapter 1
Introduction
1.1 Motivation
In recent years digitalization spread like wildfire business and trades shifted online
making market competitive and accessible to everyone. These shifts make the market for
uncompontent very vulnerable. Everyone is selling their products and services on the
internet. In recent years many e-commerce came in market and traffic on e-commerce on
these sites is unimaginable and engineers are very key component to manage these
traffics and complexity of the e-commerce. So, I decided to make a e-commerce from
scratch to test my skills try to build a application that give users a great experience.
This will also be a great opportunity to implement what i learned through my engineering
and to learn few more skills while developing this application.
1.2 Objective
The primary goal of e-commerce is to reach maximum customers at the right time to
increase sales and profitability of the business. Functions of e-commerce include buying
and selling goods, transmitting funds or data over the internet. Boosting the efficiency of
services: With the continually evolving technology, you need to enhance the efficiency of
your services. By choosing an online ecommerce platform to create an online store, you
can efficiently reduce the cost of managing and selling online. You have various
opportunities to boost the efficiency of your service that eventually enhances the revenue
earned. By reducing the delivery time, you can witness happy customers getting back to
your business two times faster. Another way is to provide your customers with automated
services such as status update, invoice creating, chat support, etc. When you update your
efficiency of delivering products or services to your customers, you are creating a strong
online presence that helps you sell more.
2
Chapter 2
Project Title
The name of the project is “CRWN CLOTHING” where crwn is picked as symbol of
clothing and custom is king. Crwn Clothing will be a clothing e-commerce application
which will focus on clothes and accessories and nothing more which restric our services
but also establish some strict rule which prevent us from making the application complex
to use and manage. And clothing is also a thing which also interest me which i think a
very bare minimum thing to do uplift your self confidence.
CRWN CLOTHING
/kraʊn/
3
Chapter 3
This is a project which build from the perspective of users so, the user experience of the
the project is very important. Making the user experience good we give user to only to
buy not to sell any product. User can make a account with us and authenticate themselves
on app using their credentials . Users can also use their google account to authenticate.
User cart data will persist in their account. User can access the web app from anywhere
and anytime. Users can pay using the cards , internet banking and upi through stripe API
which is well trusted in the industry.
The scope of ecommerce is expanding day by day due to the heavy number of internet
users all over the world. People are spending more time in doing online shopping for
various products available on the ecommerce platforms. According to Demand Sage, 2.14
billion people are shopping through e-commerce as of 2022. People spend more time
online shopping for various products available on e-commerce platforms. Amazon offers
items in almost every category to all the users. Additionally, It also provides the best
promotion and discounts whenever seasonal sales come. The impact of e commerce is
really good in all the developing countries.
The future scope of ecommerce in india is really going to have big growth potential in all
the categories of items. The user experience is very good in all e-commerce websites if
they continue to provide best customer support in the customer’s online shopping
journey.
4
Chapter 4
Working Methodology
4.1 Agile
It’s a process for managing a project that involves constant collaboration and working in
iterations. Agile project management works off the basis that a project can be
continuously improved upon throughout its life cycle, with changes being made quickly
and responsively. Agile project management is not a singular framework — rather, it can
be used as an umbrella term to include many different frameworks. Agile project
management can refer to terms including Scrum, Kanban, Extreme Programming (XP),
and Adaptive Project Framework (APF).
I am using the Agile method for this project. I will maintain a kanban board by which i
track the steps and try to build the functionality in the iteration and will maintain a
backlog list. I am going to review work on GitHub before the final merging. This will
give me ability to work on the project as different roles and divide the code according to
commits.
Chapter 5
The structure of the application of quite simple there is a app component which have four
routes home, category, checkout and auth. The navigation component will appear on
every route.
5.1.1 App
6
The app is the entry point for the application. The app.js file contains main logic to
control the routes of the single page application.
The home route is the index route of the application which contains all the directory of
the application like mens, womans, hats, jeans etc.
The category Route contains details listing of all the directory or categories . The
category route will show five items from every categories. It will give insigh to the
products.
The checkout route will show all the items in your cart with quantity number and the
grand total of all the items in your cart. The checkout route will give the users payments
options
The auth route will contains sign in and sign up form component. We can create user
account and login with google user.
Navigation component will appear on every page it will contain the link to the all pages.
It will also contain a cart icon which when clicked will show a drop down cart list which
help user to peek the cart items and quantity of the each items.
5.1.6 Firebase
7
For backend and database i am using firebase and firebase firestore. For authentication i
am using firebase auth. For database i am using firebase no sql firestore.
The workflow of the app is quite straightforward the frontend will request with user
credential or session id which stored in local storage of the web browser. It will then give
back the session id after validation of id or credential. The firebase db is used to store
8
user and user data which is a no sql database data store have schema which is useful to
validate user data.
Chapter 6
Technologies used
6.3 Hosting
- Netlify will build my code from source using scripts and deploy
Chapter 7
Conclusion
All we want is to provide applicationthat will be affordable, accessible, and with
minimum entry barriers. The software will be very scalable and easy to maintain. Crwn
Clothing will focus on one thing and focus well. Ecommerce has always been the way of
the future, but it is more so now than ever. The outer world has become a place of
ambiguity, caution, and social distance, highlighting the many benefits of e-commerce for
both companies and customers.
Customers are looking for a detailed overview of the items they wish to purchase, which
is a critical aspect of ecommerce. An e-commerce platform provides its customers with a
product catalogue that includes data sheets that detail all of the company’s products and
services. The characteristics, utility, and specifications are comprehensive. Even the
colours of certain items, such as hats, are defined so that you can make your selection
based on personal preference. Customers can learn about the new trends in fashion and
gather additional knowledge that is not available in retail stores.
Another benefit of online selling that you might not have considered is the ease with
which consumer data can be collected, analysed, and acted upon. If you want to maintain
a laser-like emphasis on the customer experience, you must own the consumer data. By
monitoring consumer experiences, online selling enables you to collect first-hand data.
You’ll benefit from a continuous feedback loop of actionable insights that will allow you
to reinvent the customer experience continuously.
Customers are encouraged to leave feedback on online stores in order to learn about
customer satisfaction and any issues they are having when using the products and
services. The availability of these reviews on ecommerce stores allows potential buyers
to learn more about the product and determine if it is appropriate for their specific needs.
It also aids sellers in improving their services and products to increase sales and customer
satisfaction.
11
FIREBASE
const firebaseConfig = {
apiKey: "AIzaSyAwPTuna5scvPdX4JDm0efMS5wV1ebWXfc",
authDomain: "crwn-clothing-db-b87c0.firebaseapp.com",
projectId: "crwn-clothing-db-b87c0",
storageBucket: "crwn-clothing-db-b87c0.appspot.com",
messagingSenderId: "386293404436",
appId: "1:386293404436:web:e80e325c5b26fc240fe801",
};
// Initialize Firebase
const firebaseApp = initializeApp(firebaseConfig);
//Authentication
const provider = new GoogleAuthProvider();
provider.setCustomParameters({
prompt: "select_account",
});
//Database
export const db = getFirestore();
objectsToAdd.forEach((object) => {
const docRef = doc(collectionRef, object.title.toLowerCase())
batch.set(docRef, object)
})
await batch.commit();
console.log('done');
return categoryMap;
}
if (!userSnapshot.exists()) {
const { displayName, email } = userAuth;
const createdAt = new Date();
try {
await setDoc(userDocRef, {
displayName,
email,
createdAt,
...additionalInformation,
});
} catch (error) {
if (error.code === "auth/email-already-in-use") {
alert("email already is use");
}
console.log("error creating the user", error.message);
}
return userDocRef;
}
};
App.js
Shop.js
return (
<Routes>
<Route index element={<CategoriesPreview />} />
<Route path=":category" element={<Category />} />
</Routes>
);
};
Navigation.js
// setCartDropDownShow(true);
const signOutHandler = async () => {
await signOutUser();
};
return (
<Fragment>
<div className="navigation">
<Link className="logo-container" to="/">
<CrwnLogo className="logo" />
</Link>
<div className="nav-links-container">
<Link className="nav-link" to="/shop">
SHOP
</Link>
{currentUser ? (
<span className="nav-link" onClick={signOutUser}>
SIGN OUT
</span>
) : (
<Link className="nav-link" to="/auth">
SIGN IN
</Link>
)}
<CartIcon />
</div>
{cartDropDownShow &&
<CartDropDown />
}
</div>
<Outlet />
</Fragment>
);
};
Home.js
{cartItems.map((cartItem) => {
return <CheckoutItem key={cartItem.id}
cartItem={cartItem} />;
})}
<span className="total">Total: ${cartTotal}</span>
</div>
);
};
Category.js
import './category.styles.scss'
import ProductCard from
'../../component/product-card/product-card.component'
import { useParams } from 'react-router-dom'
import { Fragment, useContext, useEffect, useState } from
'react'
import { CategoriesContext } from
'../../contexts/categories.context'
useEffect(() => {
setProducts(categoriesMap[category])
}, [category, categoriesMap])
return (
<Fragment>
<h2
className='category-title'>{category.toUpperCase()}</h2>
<div className='category-container'>
{products &&
products.map((product) => (
<ProductCard key={product.id} product={product} />
))}
</div>
</Fragment>
)
}
Category.js
</Fragment>
);
};
Authentication.js
Authentication.js
Cart.context.js
if (existingCartItem) {
return cartItems.map((cartItem) =>
cartItem.id === productToAdd.id
? { ...cartItem, quantity: cartItem.quantity + 1 }
: cartItem
);
}
return [...cartItems, { ...productToAdd, quantity: 1 }];
};
if (existingCartItem.quantity === 1) {
return cartItems.filter((cartItem) => cartItem.id !==
cartItemToRemove.id);
}
setCartCount(totalCartQuantity);
}, [cartItems]);
useEffect(() => {
const newCartTotal = cartItems.reduce(
(previousValue, { quantity, price }) => previousValue +
quantity * price,
0
);
setCartTotal(newCartTotal);
}, [cartItems]);
const removeItemToCart = (cartItemToRemove) =>
setCartItems(removeCartItem(cartItems, cartItemToRemove));
const value = {
cartDropDownShow,
setCartDropDownShow,
addItemToCart,
cartItems,
cartCount,
removeItemToCart,
clearItemFromCart,
cartTotal,
};
return <CartContext.Provider
value={value}>{children}</CartContext.Provider>;
};
Categories.context.js
return (
<CategoriesContext.Provider value={value}>
{children}
</CategoriesContext.Provider>
);
};
User.context.js
useEffect(() => {
const unSubscribe = onAuthStateChangedListener((user) => {
if (user) {
createUserDocumentFromAuth(user)
}
setCurrentUser(user)
})
return unSubscribe
}, [])
return <UserContext.Provider
value={value}>{children}</UserContext.Provider>
}
Sign-up-form.js
const defaultFormField = {
displayName: "",
email: "",
password: "",
confirmPassword: "",
};
try {
const { user } = await createAuthUserWithEmailAndPassword(
email,
password
);
setCurrentUser(user);
resetFormFields();
} catch (error) {
if (error.code === "auth/email-already-in-use") {
alert("Email already Exist");
} else {
console.log("A error occured while creating user",
error);
}
}
};
return (
<div className="sign-up-container">
<h1>Don't have an account?</h1>
<span>Sign up with your email and password</span>
<form onSubmit={handleSubmit}>
<FormInput
label="Display Name"
type="text"
required
onChange={handleChange}
name="displayName"
value={displayName}
/>
<FormInput
label="Email"
type="email"
required
onChange={handleChange}
name="email"
value={email}
/>
<FormInput
label="Password"
type="password"
required
onChange={handleChange}
name="password"
value={password}
/>
<FormInput
label="Confirm Password"
type="password"
required
onChange={handleChange}
name="confirmPassword"
value={confirmPassword}
/>