Skip to content

guidefari/redux-ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to run

  • Make sure you have bun installed.
  • From the root directory, run:
bun install

Run server:

bun run dev:server

To run client:

First, you want to create a .env file in the ./client directory. You can copy paste the contents of ./client/.env.example

bun run dev:client

Sidenote:

I did development against the live lambdas, I set my vite env variables as seen in sst.config.ts

const web = new sst.aws.StaticSite("ViteEcommerce", {
			path: "client/",
			build: {} ,
			environment: {
				VITE_API_BASE_URL: hono.url,
			},
		});

I set up a git pre-commit hook

I set up a simple pre-commit hook on my laptop. Bash script located at: ./git/hooks/pre-commit:

#!/bin/sh

set -eu

npx @biomejs/biome check --staged --files-ignore-unknown=true --no-errors-on-unmatched

Architectural choices

  • Switched to monorepo for quicker iteration between FE & BE.
    • I strongly considered going with NextJS, my default for fullstack TS apps.
  • Deployed to AWS via SST.

Resources


Todo

  • ✅fetch data from frontend and put in a basic UI list.
  • ✅Might switch to tailwind, haven't used MUI in years💀
  • ✅ cart should probably be in local storage. pass in the entire object as action, plus quantity
  • ✅ likely a good time for some unit tests. add to cart, remove from cart
  • Async error handling, macro level
  • When you click on a category on home screen, you get taken to view products with a pre-selected filter
    • Also keep this state in the url
  • Product details modal
    • Try url state for this one too
  • UX: Bandcamp inspired checkout modal?

BE endpoints

  • ✅List All Products: GET
    • filter - can be handled on frontend?
    • sort - can be handled on frontend?
  • ✅List Featured products: GET
  • ✅Single Product details: GET, :id
  • ✅List categories: GET
  • ✅List All products in category: GET, :id
  • Checkout: POST
  • ✅List Discounted Products: GET