This project implements a set of API gateways for managing users, products, and Google authentication using the Fiber web framework in Go.
- Go 1.22+
- Fiber v2
-
Clone the repository:
git clone https://github.com/Rachanonnn/go-ecommerce cd go-ecommerce cd Backend
-
Install dependencies:
go mod tidy
DATABASE_NAME=
MONGODB_URI=
DB_PORT_LOGIN=
JWT_SECRET_KEY=
JWT_REFESH_SECRET_KEY=
# Google Auth
G_CLIENT_ID=
G_CLIENT_SECRET=
# Make sure this value is the same as the one that we initialize
# in the google console before.
G_REDIRECT="http://localhost:8000/api/v1/google_callback"
Start the application using the following command:
go run .
Base URL: /api/v1/profile
- POST /add_user: Create a new user account
- GET /users: Retrieve all user data
- GET /get_user_by_id: Get user data by ID
- PUT /update_user: Update user information
- DELETE /delete_users: Delete a user account
- GET /get_address_by_user_id: Get address by user ID
- POST /add_address: Add a new address
- PUT /update_address: Update an existing address
- DELETE /delete_address: Delete an address
- GET /get_orders_by_user_id: Get orders by user ID
- POST /add_order: Add a new order to the cart
- PUT /update_order: Update an order
- DELETE /delete_order: Delete an order
Base URL: /api/v1/product
- GET /get_all_products: Retrieve all products
- GET /get_product_by_id: Get product data by ID
- POST /add_product: Create a new product
- PUT /update_product: Update product information
- DELETE /delete_product: Delete a product
- gateways: Contains the gateway functions for user and product management.
- main.go: Entry point of the application.
cd go-ecommerce/Frontend
npm run dev
Open http://localhost:3000 with your browser to see the result.
Please feel free to submit issues, fork the repository, and send pull requests.
- frontend | feat : add product show skeleton before fetch data and merge to develop
- frontend | feat : add icon and add button clear
- frontend | merge branch feature/add-product-recheck to develop and remove https://trello.com/c/s9unRXEJ/4-feature-add-product-recheck
- backend | add uid generate when user sign in to database
- backend | add token generate when user sign in to database
- backend | support sign in with firebase email and password