This is a simple e-commerce application with a Go backend and React frontend.
- Navigate to the backend directory:
cd backend- Install dependencies:
go mod download- Run the server:
go run main.goThe server will start on http://localhost:8080
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm startThe frontend will start on http://localhost:3000
POST /users- Create a new userGET /users- List all usersPOST /users/login- Login with username and password
POST /items- Create a new itemGET /items- List all items
POST /carts- Add item to cartGET /carts- List all cartsGET /carts/me- Get current user's cart
POST /orders- Create order from cartGET /orders- List all ordersGET /orders/me- Get current user's orders
- First, create a new user using the
/usersendpoint - Login using the
/users/loginendpoint to get a token - Use the token in the Authorization header for protected endpoints
- Create some items using the
/itemsendpoint - Add items to cart using the
/cartsendpoint - Create an order using the
/ordersendpoint
-
Login Screen
- Enter username and password
- Shows alert on invalid credentials
-
Items List Screen
- Displays all available items
- Click on an item to add it to cart
- Checkout button to create order
- Cart button to view current cart items
- Order History button to view past orders
https://drive.google.com/file/d/1va_XY3xdq1PARRdsZNvghwwxdIAot0F9/view?usp=sharing