Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cones & Stones #37

Open
wants to merge 266 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
266 commits
Select commit Hold shift + click to select a range
904be59
Merge branch 'main' of https://github.com/JohannaBN/cones-and-stones
ericamechler May 30, 2024
00242e8
changed a couple of section-names and added SingleProduct-page and Ca…
ericamechler May 30, 2024
a0922a8
changed structure and put header & footer in app as sections
ericamechler May 30, 2024
a56b3e9
added routes for /, /products, /ptofuvyd/category/:category and /prod…
ericamechler May 30, 2024
a0e648a
Merge pull request #5 from JohannaBN/routes
ericamechler May 30, 2024
bb2a0d7
changed the structure a bit again, added common-folder and reusable-c…
ericamechler May 31, 2024
e990a2c
Moved middleware to check if bug with service unawailable is fixed.
JohannaBN May 31, 2024
bec6892
Merge pull request #6 from JohannaBN/error-handling
JohannaBN May 31, 2024
e9bb3e7
fixed the routes for the navlinks- they are now hard-coded based on t…
ericamechler May 31, 2024
09490ba
Merge pull request #7 from JohannaBN/routes2
ericamechler May 31, 2024
fdbbde4
Import logo and icons to assets folder and add them to the header
FridaMari May 31, 2024
68b98ec
Merge pull request #8 from JohannaBN/header-structure
FridaMari May 31, 2024
b8d25ff
moved assets to public-folder, because of common practice for better …
ericamechler May 31, 2024
9228a7a
Merge pull request #9 from JohannaBN/hero-component
ericamechler May 31, 2024
838f7f0
Apply some styling to header
FridaMari Jun 2, 2024
1c67c40
Merge pull request #10 from JohannaBN/header
FridaMari Jun 2, 2024
1d48b59
Add elements to single product page
FridaMari Jun 2, 2024
30c4852
Made test to see if API-error is fixed. Removed middleware.
JohannaBN Jun 3, 2024
2c024be
Merge pull request #11 from JohannaBN/middleware-test
JohannaBN Jun 3, 2024
cffc7e2
Added product fetch in AllProducts.jsx and created ProductCard compon…
JohannaBN Jun 3, 2024
4937c3c
Fetch successfull and products showing in ProductCard and mapped to s…
JohannaBN Jun 3, 2024
bdfe7a4
added button-component and implemented in hero component, also added …
ericamechler Jun 3, 2024
2a3abbf
Change h5 to p in SPP
FridaMari Jun 3, 2024
c1f5a46
Merge pull request #12 from JohannaBN/button-component
ericamechler Jun 3, 2024
c821d8e
Merge pull request #13 from JohannaBN/single-product
FridaMari Jun 3, 2024
9e1a4ce
Added Link to image, text and price at AllProducts to route to SingeP…
JohannaBN Jun 3, 2024
38bc1d6
Added styling.
JohannaBN Jun 3, 2024
0f391d3
Merge pull request #14 from JohannaBN/all-products-fetch
JohannaBN Jun 3, 2024
9467bac
Import fonts to index.html, define font styling and add css variables…
FridaMari Jun 3, 2024
5037cc0
Merge pull request #15 from JohannaBN/fonts
FridaMari Jun 3, 2024
c8028eb
Add media queries to header so that hamburger menu disappears at larg…
FridaMari Jun 3, 2024
2b64769
fixed deliverystatements and css for hero-image
ericamechler Jun 3, 2024
4b250bf
Merge pull request #16 from JohannaBN/trust-indicators
ericamechler Jun 3, 2024
2045ec9
category page-fetch
ericamechler Jun 3, 2024
5d9dbb1
Merge pull request #17 from JohannaBN/category-page
ericamechler Jun 3, 2024
a79df4e
fixed so css is same for category-page as for product-list within all…
ericamechler Jun 3, 2024
c8a15a4
Fetch single product by id
FridaMari Jun 4, 2024
beb7114
Merge branch 'main' into spp-fetch
FridaMari Jun 4, 2024
eb58088
Fixed issue with missing key props.
JohannaBN Jun 4, 2024
2c03cbc
Successfully fetch product data and display on SPP
FridaMari Jun 4, 2024
0692446
Merge pull request #18 from JohannaBN/spp-fetch
FridaMari Jun 4, 2024
3d5fd85
Working on issue with timeout method.
JohannaBN Jun 4, 2024
d71c038
Removed timeout function that didn't work as expected.
JohannaBN Jun 4, 2024
ca3ac0e
Merge pull request #19 from JohannaBN/refactor-fetch
JohannaBN Jun 4, 2024
d4a57f0
worked on category-icons and making them reusable & styled the shop b…
ericamechler Jun 4, 2024
53fdf4a
Merge pull request #20 from JohannaBN/category-icons
ericamechler Jun 4, 2024
3b547e5
Added slick-carousel.
JohannaBN Jun 4, 2024
ef0e276
fixed the category-buttons for all-products page and category-pages
ericamechler Jun 4, 2024
cef5a0b
Merge pull request #21 from JohannaBN/product-showcase
JohannaBN Jun 4, 2024
e77de7d
Merge pull request #22 from JohannaBN/category-icons2
ericamechler Jun 4, 2024
518ac22
removed styling from home-component, then the react-scroll works
ericamechler Jun 4, 2024
35b87f7
Merge pull request #23 from JohannaBN/test
ericamechler Jun 4, 2024
b2e3f28
fixed the h1 for mobile like we talked about, also fixed the logos so…
ericamechler Jun 4, 2024
6a0ddc7
Merge pull request #24 from JohannaBN/small-fixes
ericamechler Jun 4, 2024
3e2c64c
Refactor DeliveryStatements compontent to get background color by props
FridaMari Jun 4, 2024
fcaea36
Refactor DeliveryStatements component to get fontsize by props
FridaMari Jun 4, 2024
2f10a55
Style buttons on SPP
FridaMari Jun 4, 2024
728d683
Merge branch 'main' into spp-css
FridaMari Jun 4, 2024
d7d8708
Merge pull request #25 from JohannaBN/spp-css
FridaMari Jun 4, 2024
0379c49
fixed bug within delivery-statment code. A small change from prop say…
ericamechler Jun 5, 2024
ff63e25
Replaced image that didn't match in the carousel.
JohannaBN Jun 5, 2024
0097f32
Move button css from index.css to Button.css
FridaMari Jun 5, 2024
675e4d6
Added some settings for slider.
JohannaBN Jun 5, 2024
64de3d0
Changed values for media queries.
JohannaBN Jun 5, 2024
575c311
Updated images with alt-tags with product name props.
JohannaBN Jun 5, 2024
ddc1f97
added banner-image to component and styled it a bit- will probably be…
ericamechler Jun 5, 2024
9334fd7
Merge pull request #26 from JohannaBN/banner
ericamechler Jun 5, 2024
4a9f171
Refactored return and replaces a href to use nav link.
JohannaBN Jun 5, 2024
65a3d0f
Merge pull request #27 from JohannaBN/showcase-improvments
JohannaBN Jun 5, 2024
355386a
Change font style on buttons and icons
FridaMari Jun 5, 2024
a7c5379
Merge pull request #28 from JohannaBN/button-css
FridaMari Jun 5, 2024
7ef582b
added main to structure (matching header & footer) & switching names …
ericamechler Jun 5, 2024
f22f22c
Co-authored-by: Frida Svensson <[email protected]>
ericamechler Jun 5, 2024
c69a154
Merge pull request #29 from JohannaBN/footer
ericamechler Jun 5, 2024
46144ad
Small changes since last commit
FridaMari Jun 5, 2024
751cc08
Merge branch 'main' into button-css
FridaMari Jun 5, 2024
33dd7ad
Merge pull request #30 from JohannaBN/button-css
FridaMari Jun 5, 2024
6e74e01
Put Image component togheter with its css file inside a folder
FridaMari Jun 5, 2024
c071dbc
Refacored code to include image component instead of img.
JohannaBN Jun 5, 2024
b6ef477
Change paths on some imports
FridaMari Jun 5, 2024
2d9315b
Changed path to new path for Image import.
JohannaBN Jun 5, 2024
c5a6b4e
Merge pull request #31 from JohannaBN/image-component
FridaMari Jun 5, 2024
e75417b
Merge pull request #32 from JohannaBN/add-image-component
JohannaBN Jun 5, 2024
d49d5b5
Refactor code on image component
FridaMari Jun 5, 2024
a355861
removed toUppercase in code since it is in css
ericamechler Jun 5, 2024
711f059
Merge branch 'main' of https://github.com/JohannaBN/cones-and-stones
ericamechler Jun 5, 2024
ad16dc9
Changed name on component, changed imports and added image component …
JohannaBN Jun 5, 2024
c766f5d
Added grid and media queries on new-arrivals-container.
JohannaBN Jun 5, 2024
b14edec
Merge pull request #33 from JohannaBN/new-arrivals
JohannaBN Jun 5, 2024
cddbf29
Added button.
JohannaBN Jun 5, 2024
8959ef6
fixing structure with sections where there should be sections. Fixing…
ericamechler Jun 5, 2024
6865cdf
Merge pull request #34 from JohannaBN/smallcss-fix
ericamechler Jun 5, 2024
d4f7465
versaler i header
ericamechler Jun 5, 2024
62a07fa
changed so hamburger-menu is for mobile & desktop
ericamechler Jun 5, 2024
6b868c2
created footer with toggle-function
ericamechler Jun 5, 2024
d1fe3bd
Merge pull request #35 from JohannaBN/footer2
ericamechler Jun 5, 2024
f7cadb3
imported footer-logo to footer
ericamechler Jun 5, 2024
6ba6e04
Added button to new arrivals section. Also added styling and position…
JohannaBN Jun 6, 2024
8afd9db
Merge pull request #36 from JohannaBN/new-arrivals-button
JohannaBN Jun 6, 2024
a0d1867
Change category links in nav to h5
FridaMari Jun 6, 2024
06556c0
Removed unused icons and added styling for mobile and tablet.
JohannaBN Jun 6, 2024
79adac6
Update fontsize on mobile screens
FridaMari Jun 6, 2024
05cd54f
Refactored code to use flex instead of grid. Added order property to …
JohannaBN Jun 6, 2024
e8f831b
Remove larger fontsize on category icons on bigger screens
FridaMari Jun 6, 2024
d3017c6
Merge pull request #37 from JohannaBN/header-styling
JohannaBN Jun 6, 2024
4a0b757
Merge branch 'main' into font-fix
FridaMari Jun 6, 2024
c68e0f7
Merge pull request #38 from JohannaBN/font-fix
FridaMari Jun 6, 2024
4fe24e8
Replaced cart icon with new icon and adjusted styling to make it look…
JohannaBN Jun 6, 2024
f8b0f63
Merge pull request #39 from JohannaBN/cart-icon-update
JohannaBN Jun 6, 2024
ef6fc97
Added hamburger menu with sliding function.
JohannaBN Jun 6, 2024
32e2a24
Added custom icon and styling to hamburger menu icon.
JohannaBN Jun 6, 2024
69b2966
Added positioning for mobile and tablet and display: none for desktop.
JohannaBN Jun 6, 2024
e4402c4
Added correct headings and links.
JohannaBN Jun 6, 2024
d828f59
Removed unused code.
JohannaBN Jun 6, 2024
2031662
Made som minor changes in styling.
JohannaBN Jun 6, 2024
6002e0c
Merge branch 'main' into hamburger-menu
JohannaBN Jun 6, 2024
c433493
Merge pull request #40 from JohannaBN/hamburger-menu
JohannaBN Jun 6, 2024
bfe9389
worked on footer-styling and changed padding for several elements
ericamechler Jun 6, 2024
7c3fd29
Merge pull request #41 from JohannaBN/footer3
ericamechler Jun 6, 2024
c123ed8
Fixed issue with slide menu opening when clicking anywhere on the site.
JohannaBN Jun 7, 2024
f88c9c7
Merge pull request #42 from JohannaBN/menu-slide-fix
JohannaBN Jun 7, 2024
4cc3c20
Added custom cross image in menu slider.
JohannaBN Jun 7, 2024
a7f33fb
Created function to use isOpen state to show menu icon if menu is clo…
JohannaBN Jun 7, 2024
9bf52e1
Fixed issue with cross icon not being removed on desktop by adding di…
JohannaBN Jun 7, 2024
490d700
fixed footer-bug and styled large screen
ericamechler Jun 7, 2024
17230b4
added som padding-right to footer-logo
ericamechler Jun 7, 2024
d3d4a5a
fixed function so that whenever a link in the footer is clicked, the …
ericamechler Jun 7, 2024
9f8dcfa
Merge pull request #43 from JohannaBN/footer-bugs
ericamechler Jun 7, 2024
4b862f1
Updated styling in header.
JohannaBN Jun 7, 2024
c4fcc07
Updated positioning on cross icon.
JohannaBN Jun 7, 2024
076affb
Merge pull request #44 from JohannaBN/slide-menu-closing
JohannaBN Jun 7, 2024
438f644
Tryout font-size 10 in SPP
FridaMari Jun 8, 2024
960f74d
Change back fonts on SPP and update class in index.css for extra smal…
FridaMari Jun 8, 2024
8d22f01
Add hover and disabled states to buttons
FridaMari Jun 8, 2024
cce0bc9
Add hover effects to category icons and underline offsat to links in …
FridaMari Jun 8, 2024
dbb8844
Add hover state to size buttons
FridaMari Jun 8, 2024
af1703b
Add scaling as hover on product cards and give all hover effects a tr…
FridaMari Jun 8, 2024
6b109bc
Add media queries to SPP and add toggle to details text
FridaMari Jun 9, 2024
4de0dbb
Make alt-tag dynamic on product image in SPP
FridaMari Jun 9, 2024
1aa4b40
Add ability to select size on SPP
FridaMari Jun 9, 2024
dac625d
Change label on add to cart button when no size is selected
FridaMari Jun 9, 2024
58eb080
added UseCartStore and filled it with states for cart, addToCart, rem…
ericamechler Jun 10, 2024
eebfe5f
added addToCart to singleproduct-page and a handle addToCart-function
ericamechler Jun 10, 2024
1619548
filled cart.jsx with cart items & details regarding them + quantity …
ericamechler Jun 10, 2024
b69f480
added handleIncrease, handleDecrease, handleRemove etc & the icons
ericamechler Jun 10, 2024
88a6c4f
filled cart with components & got the handleIncrease etc working
ericamechler Jun 10, 2024
edf0e29
Merge pull request #45 from JohannaBN/global-state
ericamechler Jun 10, 2024
c0842b6
changed filename of UseCartStore to useCartStore and imported them again
ericamechler Jun 11, 2024
70cfbf6
tried fixing useCartStore
ericamechler Jun 11, 2024
740bf3c
created a new Store called useBagStore to try solve issues with deploy
ericamechler Jun 11, 2024
29ce34b
got the clear-cart-function working and added a button with a new var…
ericamechler Jun 11, 2024
289f59e
Configured backend server-file and added endpoint for stripe checkout…
JohannaBN Jun 11, 2024
1787ea4
implemented localStorage in useBagStore
ericamechler Jun 11, 2024
9c4e9e8
Merge pull request #46 from JohannaBN/cart-fixes
ericamechler Jun 11, 2024
a6f7143
Added .env-file.
JohannaBN Jun 11, 2024
13b8b12
Updated frontend button code to handle checkout request.
JohannaBN Jun 11, 2024
b4388da
Updated localhost url to deployed urls.
JohannaBN Jun 11, 2024
bfdadc5
Merge branch 'main' into checkout
JohannaBN Jun 11, 2024
f5f5a77
Merge pull request #47 from JohannaBN/checkout
JohannaBN Jun 11, 2024
9f3180f
Updated env.
JohannaBN Jun 11, 2024
f43c3e1
Merge pull request #48 from JohannaBN/env-update
JohannaBN Jun 11, 2024
4f40c5f
Corrected Stripe post url.
JohannaBN Jun 11, 2024
9a1e9ba
Merge pull request #49 from JohannaBN/stripe-post
JohannaBN Jun 11, 2024
60bbaa4
Create Loader component
FridaMari Jun 11, 2024
e4bc18a
Display Loader when loading state is set to true
FridaMari Jun 11, 2024
e32d76e
Merge pull request #50 from JohannaBN/loader
FridaMari Jun 11, 2024
cb8f643
Updated process.env for Google cloud.
JohannaBN Jun 11, 2024
6176c82
Updated process.env for netlify deploy.
JohannaBN Jun 11, 2024
34825e3
Merge pull request #51 from JohannaBN/env-import
JohannaBN Jun 11, 2024
6b675dc
Updated URLs.
JohannaBN Jun 11, 2024
53d991b
Fixed typo in process.env.
JohannaBN Jun 11, 2024
2553f71
Merge pull request #52 from JohannaBN/meta.env2
JohannaBN Jun 11, 2024
4e80645
Make not found page work as expected
FridaMari Jun 11, 2024
caad520
Refactor code so that when error occurs, redirect to Not found page
FridaMari Jun 11, 2024
a5b893f
Add styling to not found page
FridaMari Jun 11, 2024
a57f836
Change name on hero-button to shop-button
FridaMari Jun 11, 2024
7c44a39
Style loader
FridaMari Jun 11, 2024
74ea31d
Checkout fixed.
JohannaBN Jun 11, 2024
aa61fcd
Merge pull request #53 from JohannaBN/stripe-fix
JohannaBN Jun 11, 2024
9a242ed
Merge branch 'main' into notfound-page
FridaMari Jun 12, 2024
ef58ad2
Merge pull request #54 from JohannaBN/notfound-page
FridaMari Jun 12, 2024
04c2baf
Change name on shop-button also in hover state, and add clear-cart bu…
FridaMari Jun 12, 2024
0cc45d5
Add some padding to cart-css
FridaMari Jun 12, 2024
3e2af41
Removed products details from checkout.
JohannaBN Jun 12, 2024
7205c2e
Added more payment options in checkout.
JohannaBN Jun 12, 2024
4f5628f
Merge pull request #55 from JohannaBN/checkout-details
JohannaBN Jun 12, 2024
1b25ec0
Give logo a bit more padding on desktop view. Center cart-count insid…
FridaMari Jun 12, 2024
330c8e0
Created file and stylesheet for order comfirmation page. And created …
JohannaBN Jun 12, 2024
7219b6e
Change styling in slider-menu from em to px
FridaMari Jun 12, 2024
602f360
Merge pull request #56 from JohannaBN/styling-header
FridaMari Jun 12, 2024
211c62d
Added content and styling for order confirmation page.
JohannaBN Jun 12, 2024
51b1ba7
Merge pull request #57 from JohannaBN/orderconfirmation
JohannaBN Jun 12, 2024
f0355b5
Put h1 in hero-text wrapper and update some styling so that it looks …
FridaMari Jun 12, 2024
2560845
Updated cancel_url to redirect to /cart for better UI.
JohannaBN Jun 12, 2024
6303776
Merge pull request #58 from JohannaBN/cancel
JohannaBN Jun 12, 2024
e1a9006
Merge pull request #59 from JohannaBN/styling-hero
FridaMari Jun 12, 2024
01684f0
Updated styling for mobile. Added margins and gap.
JohannaBN Jun 12, 2024
0a3f51b
Updated styling for tablet - margin and padding.
JohannaBN Jun 12, 2024
984eae6
Create separate elements in banner instead of having a fixed image
FridaMari Jun 12, 2024
7d4669c
Updated styling for desktop - added width 100% on product-card.
JohannaBN Jun 12, 2024
ed4e225
Removed unused code.
JohannaBN Jun 12, 2024
49db905
Updated hover effects for tablet and mobile.
JohannaBN Jun 12, 2024
492417f
fixed cart-design
ericamechler Jun 12, 2024
1a78bc4
Merge pull request #60 from JohannaBN/cart-css
ericamechler Jun 12, 2024
088cb78
Updated classnames for category page to use styling for all-products …
JohannaBN Jun 12, 2024
d68869a
Merge pull request #61 from JohannaBN/all-products-styling
JohannaBN Jun 12, 2024
f06af60
Updated title.
JohannaBN Jun 12, 2024
a0be21f
Added logo as favicon.
JohannaBN Jun 12, 2024
4cdce61
Cleaned up code a bit.
JohannaBN Jun 12, 2024
8131d7c
Removed unused icons.
JohannaBN Jun 12, 2024
a84bfb8
Merge pull request #62 from JohannaBN/minor-updates
JohannaBN Jun 12, 2024
0c14496
Fix banner layout for alla screen sizes
FridaMari Jun 12, 2024
5075c8a
Create bubble-row
FridaMari Jun 12, 2024
4a19e44
Merge pull request #63 from JohannaBN/banner-fix
FridaMari Jun 12, 2024
9d8468f
Change path on favicon in html
FridaMari Jun 13, 2024
2a511d4
Fix margins around banner and remove border bottom on desktop footer
FridaMari Jun 13, 2024
02575bb
Merge pull request #64 from JohannaBN/banner-margin
FridaMari Jun 13, 2024
c963765
Addded media queries for extra large screens. Added maxwidth and marg…
JohannaBN Jun 13, 2024
b89aac3
fixed empty-cart look
ericamechler Jun 13, 2024
35d2181
removed extra text in footer that talked about an about-page
ericamechler Jun 13, 2024
89052f1
removed border-bottom & margin-bottom on 1024 screen in footer
ericamechler Jun 13, 2024
deeab7f
Updated gap.
JohannaBN Jun 13, 2024
3417dc7
Added margin and media queries for extra large screens.
JohannaBN Jun 13, 2024
0b42d83
Merge branch 'main' into margin-correction
JohannaBN Jun 13, 2024
f5fc8c4
Merge pull request #65 from JohannaBN/margin-correction
JohannaBN Jun 13, 2024
7ff2322
Fixed bug with text not center on very small screens on size buttons.
JohannaBN Jun 13, 2024
7d5a0b5
Merge pull request #66 from JohannaBN/bug/size-button-text
JohannaBN Jun 13, 2024
f08edd3
fixed so cart clears when confirmation-page is reached
ericamechler Jun 13, 2024
0181046
fixed confirmation-message
ericamechler Jun 13, 2024
a13c6d4
Merge branch 'main' into cart-bugs
ericamechler Jun 13, 2024
9b9ced0
Merge pull request #67 from JohannaBN/cart-bugs
ericamechler Jun 13, 2024
a5b780d
Remove max-width from toggle component and place it on the footer ins…
FridaMari Jun 13, 2024
a07e983
Merge pull request #68 from JohannaBN/details-text
FridaMari Jun 13, 2024
0f242df
Updated colours on p for better accessibility.
JohannaBN Jun 13, 2024
839ec6f
Updated for better accessibility.
JohannaBN Jun 13, 2024
021cfe2
Give variable colors better contrast
FridaMari Jun 13, 2024
e2a2280
Second try to update colors
FridaMari Jun 13, 2024
6436bef
Merge pull request #69 from JohannaBN/color-fix
FridaMari Jun 13, 2024
786a03d
removed classname hero-h4 which was not used
ericamechler Jun 13, 2024
07b486b
Merge pull request #70 from JohannaBN/heading-structure
ericamechler Jun 13, 2024
4c7b398
Change color on banner text
FridaMari Jun 13, 2024
f8fcce9
Removed unused ul.
JohannaBN Jun 13, 2024
bc2a55a
removed category/:id because we don't use it
ericamechler Jun 13, 2024
c85e86e
Merge pull request #71 from JohannaBN/clean-up
ericamechler Jun 13, 2024
0f6c10c
Made slide arrow buttons bigger for better accessibility.
JohannaBN Jun 13, 2024
7899ae4
Changed arrow size in slider for better accessibility.
JohannaBN Jun 13, 2024
d5cb57c
Merge pull request #72 from JohannaBN/slide-arrows
JohannaBN Jun 13, 2024
d4c4f43
Make arrow in productshowcase bigger for accessibility reasons
FridaMari Jun 13, 2024
767b460
updated readme
ericamechler Jun 13, 2024
903faea
updated readme again
ericamechler Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

44 changes: 37 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
# Final Project
# CONES & STONES - e-commerce store

Replace this readme with your own information about your project.
## Table of Contents

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
- [Project Description](#project-description)
- [Technologies](#technologies)
- [How to Install & Run the Project](#how-to-install--run-the-project)
- [How to Use the Project](#how-to-use-the-project)
- [Future ToDo](#future-todo)
- [Authors](#authors)
- [See it live](#see-it-live)

## The problem
## Project Description:

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
We have created a kids' clothes e-commerce store with a clean landing page that showcases products from a database, with detailed product views and a functional cart/checkout system integrated with Stripe for test payments.

## View it live
### Technologies

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
The store is developed with React JS & Vite for us to achieve a fast & optimized web app. For building robust APIs we used Express. The database is built using MongoDB for scalable and flexible data storage. Stripe Test API is integrated for secure and scalable payment processing, which was a bit of a challenge for us, since it was our first time implementing a third party solution. Lastly, for image storage, we used cloudinary.

## How to Install & Run the Project

1. Install the required dependencies using `npm install`.
2. Start the development server using `npm run dev`.

## How to Use the Project

To explore our kids' clothes e-commerce store, navigate through the product categories using the menu or click on all products in hero. Add items to your cart by clicking "Add to Cart" on the product page, then proceed to checkout where you can simulate a payment using Stripe's test mode.

## Future ToDo

To develop the app further, we would like to add user registration/login, enabeling adding products to favorites, more inspirational pages as well as filtering- and sorting possibilities.

## Authors

- [Erica Mechler](https://github.com/ericamechler)- [LinkedIn](https://www.linkedin.com/in/erica-mechler-a39b73a8/)
- [Frida Svensson](https://github.com/FridaMari)- [LinkedIn](https://www.linkedin.com/in/frida-svensson-649019295/)
- [Johanna Billingskog Nyberg](https://github.com/JohannaBN)- [LinkedIn](https://www.linkedin.com/in/johanna-billingskog-nyberg-b28b4738/)

## See it live

[Backend](https://cones-and-stones-ppnudpghiq-lz.a.run.app/)
[Frontend](https://cones-and-stones.netlify.app/)
3 changes: 3 additions & 0 deletions backend/.env.sample

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good you added such file! 👏

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VITE_STRIPE_SECRET_KEY=sk_test_xxx
VITE_CLIENT_URL=http://localhost:8080
MONGO_URL=mongodb://localhost/Cones&Stones
8 changes: 0 additions & 8 deletions backend/README.md

This file was deleted.

7 changes: 5 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
"@babel/node": "^7.16.8",
"@babel/preset-env": "^7.16.11",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.17.3",
"express-list-endpoints": "^7.1.0",
"mongoose": "^8.4.0",
"nodemon": "^3.0.1"
"nodemon": "^3.0.1",
"stripe": "^15.10.0"
}
}
}
274 changes: 267 additions & 7 deletions backend/server.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,66 @@
import express from "express";
import cors from "cors";
import mongoose from 'mongoose'
import express from "express";
import expressListEndpoints from "express-list-endpoints";
import mongoose from "mongoose";
import Stripe from "stripe";
import dotenv from "dotenv";

dotenv.config();

const stripe = new Stripe(process.env.VITE_STRIPE_SECRET_KEY);

const mongoUrl = process.env.MONGO_URL || "mongodb://localhost/flowershop"
mongoose.connect(mongoUrl)
mongoose.Promise = Promise
const mongoUrl = process.env.MONGO_URL || "mongodb://localhost/Cones&Stones";
mongoose.connect(mongoUrl);
mongoose.Promise = Promise;

// Create product mongoose-schema & model
// Destructure schema & model
const { Schema, model } = mongoose;

const productSchema = new Schema({
name: {
type: String,
required: true,
},
price: {
type: Number,
required: true,
},
description: {
type: String,
required: true,
},
details: {
type: String,
required: true,
},
image_url: {
type: String,
required: true,
},
stock: [
{
// ex. { "size": "80/86", "quantity": 10 }, { "size": "90/96", "quantity": 15 }
size: { type: String, required: true },
quantity: { type: Number, required: true },
},
],
color: {
type: String,
required: true,
},
category: {
type: String,
enum: ["bottoms", "tops", "dresses", "accessories"], // Only allow specific categories
required: true,
},
createdAt: {
type: Date,
default: Date.now,
},
});

const Product = mongoose.model("Product", productSchema);

// Defines the port the app will run on. Defaults to 8080, but can be overridden
// when starting the server. Example command to overwrite PORT env variable value:
Expand All @@ -18,14 +72,220 @@ const app = express();
app.use(cors());
app.use(express.json());

// app.use(checkDatabaseConnection);

// Start defining your routes here
// http://localhost:8080/
app.get("/", (req, res) => {
res.send("Hello Technigo!");
const endpoints = expressListEndpoints(app);
res.json(endpoints);
});

// GET all products
// http://localhost:8080/products
app.get("/products", async (req, res) => {
try {
// Possibility to filter on category, color and/or size
// http://localhost:8080/products?color=red&size=M <-- for example
const { category, color, size, sort } = req.query;
let filter = {};

if (category) {
filter.category = category;
}

if (color) {
filter.color = color;
}

if (size) {
filter["stock.size"] = size;
}

// Possibility to sort on price/date in ascending or descending order
// Examples:
// http://localhost:8080/products?sort=price_desc
// http://localhost:8080/products?color=red&size=M&sort=price_asc
// http://localhost:8080/products?sort=date_desc
let sortOptions = {};
if (sort) {
const [field, order] = sort.split("_");
if (
(field === "price" || field === "date") &&
(order === "asc" || order === "desc")
) {
sortOptions[field] = order === "asc" ? 1 : -1;
}
}

const products = await Product.find(filter).sort(sortOptions);

if (products.length > 0) {
res.status(200).json({
success: true,
response: products,
message: "Products retrieved successfully",
});
} else {
res.status(404).json({
success: false,
error: {
message: "No products found",
},
});
}
} catch (error) {
res.status(500).json({
success: false,
error: {
message: "Internal server error",
},
});
}
});

// GET single product by id
// http://localhost:8080/products/:productId
app.get("/products/:productId", async (req, res) => {
const { productId } = req.params;
try {
const product = await Product.findById(productId).exec();
if (product) {
res.status(200).json({
success: true,
response: product,
message: "Product was found successfully",
});
} else {
res.status(404).json({
success: false,
error: {
message: "Product not found",
},
});
}
} catch (error) {
res.status(500).json({
success: false,
error: {
message: "Internal server error",
},
});
}
});

// GET products by category
// http://localhost:8080/products/category/:category
app.get("/products/category/:category", async (req, res) => {
const { category } = req.params;
const { color, size, sort } = req.query;
const validCategories = ["bottoms", "tops", "dresses", "accessories"];

if (!validCategories.includes(category)) {
return res.status(400).json({
success: false,
error: {
message: "Invalid category",
},
});
}

try {
// Possibilities to filter and sort in the category endpoint
let filter = { category };

if (color) {
filter.color = color;
}

if (size) {
filter["stock.size"] = size;
}

let sortOptions = {};
if (sort) {
const [field, order] = sort.split("_");
if (
(field === "price" || field === "date") &&
(order === "asc" || order === "desc")
) {
sortOptions[field === "date" ? "createdAt" : field] =
order === "asc" ? 1 : -1;
}
}

const productsByCategory = await Product.find(filter).sort(sortOptions);
if (productsByCategory.length > 0) {
res.status(200).json({
success: true,
response: productsByCategory,
message: "Products retrieved successfully",
});
} else {
res.status(404).json({
success: false,
error: {
message: "No products found in this category",
},
});
}
} catch (error) {
res.status(500).json({
success: false,
error: {
message: "Internal server error",
},
});
}
});

// Stripe Checkout Session creation endpoint
app.post("/create-checkout-session", async (req, res) => {
const { items } = req.body;

try {
const lineItemsPromises = items.map(async (item) => {
const product = await Product.findById(item.id);
if (!product) {
throw new Error(`Product not found: ${item.id}`);
}

return {
price_data: {
currency: "sek",
product_data: {
name: product.name,
images: [product.image_url],
},
unit_amount: product.price * 100, // price in cents
},
quantity: item.quantity,
};
});

const lineItems = await Promise.all(lineItemsPromises);

const session = await stripe.checkout.sessions.create({
// payment_method_types: ["card"],
line_items: lineItems,
mode: "payment",
success_url: `${process.env.VITE_CLIENT_URL}/success`,
cancel_url: `${process.env.VITE_CLIENT_URL}/cart`,
});

res.status(200).json({ id: session.id });
} catch (error) {
console.error("error create-checkout-session:", error.message);
res.status(500).json({
success: false,
error: {
message: error.message || "Internal server error",
},
});
}
});

// Start the server
app.listen(port, () => {
console.log(`Server running on http://localhost:${port}`);
});
});
2 changes: 2 additions & 0 deletions frontend/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_xxx
VITE_BACKEND_URL=http://localhost:8080
8 changes: 0 additions & 8 deletions frontend/README.md

This file was deleted.

Binary file added frontend/dist/assets/ajax-loader-e7b44c86.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading