This project is a basic e-commerce application built with Go, Gin, and GORM. It supports user registration, login, cart management, and order processing.
- Go
- Git
- PostgreSQL
-
Clone the Repository
git clone https://github.com/vinayak-chavan/e-commerce-backend-go-lang- cd e-commerce
-
Install Dependencies
go mod tidy
-
Set Up Environment Variables
Change .env file in the root directory:
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_db_user
DB_PASS=your_db_password
DB_NAME=your_db_name
DB_PORT=5432
DB_SSLMODE=disable
DB_TIMEZONE=Asia/Kolkata
PORT=8000
SECRET=ThisIsSecretKey
-
Run the Project
go run main.go
-
For swagger documentation (Optional)
go install github.com/swaggo/swag/cmd/swag@latest go get -u github.com/swaggo/gin-swagger go get -u github.com/swaggo/files
-
Generate the Swagger Documentation
swag init
-
Access Swagger UI
Open your browser and navigate to http://localhost:8000/swagger/index.html to view the Swagger UI for your APIs.