Welcome to the MVP Shop project! This repository contains a fully functional RESTful API for an online shop, built with Go, Gin, and GORM. We appreciate any feedback and contributions. Feel free to open issues for comments and discussions.
This project includes the following features to meet the MVP criteria:
-
Product Management:
- View product list by category
- Add products to the shopping cart
- View items in the shopping cart
- Remove items from the shopping cart
- Checkout and process payment transactions
-
User Authentication:
- Customer login and registration
- JWT-based authorization
-
Database and Logging:
- Automatic schema migration using GORM
- Custom error and info logging with Logrus
For detailed schema design, please visit our Wiki.
Follow these steps to set up and run the application:
- Clone the Repository:
git clone https://github.com/yourusername/mvp-shop.git cd mvp-shop
- Database Setup:
- Create a PostgreSQL database.
- Set environment variables for your database as shown in the .env.example file.
- Run the Application:
- Directly with Go:
go run main.go
- Using Docker Compose:
docker-compose up -d --build --force-recreate
- (Optional) Update Swagger Documentation:
go install github.com/swaggo/swag/cmd/swag@latest && swag init
Access the comprehensive API documentation through the following links: