A Comprehensive Go-based E-Commerce Platform
Disclaimer: This project is a learning playground and not yet production-ready. It's designed for educational purposes and
experimentation features
- Authentication
- Profile management
- Role-based access control
- CRUD operations
- Category hierarchies
- Flexible product management
- Complete order workflow
- Zarin-Pal payment gateway
- Email verifier
- Product commenting system
- User reviews
-
Language Go (Golang) 1.21+
-
Web framework Gin
-
CLI management Cobra
-
Row sql and database postgresSQL
-
Caching system redis
-
Payment gateway Zarin-Pal v4
Prerequisites
Go 1.24+
Docker (optional)
Zarin-Pal Merchant AccountLocal Development Setup
- Clone the Repository
git clone https://github.com/yourusername/generic-shop-sample.git
cd generic-shop-sample
- Configuration
# Copy environment template
cp .env.example .env
# Edit .env file with your specific configurations
# Set database, payment gateway, and email service credentials
nano .env- Environment Variables
# Set precise path to your .env file
export DOTENV_PATH=~/exact/path/to/.env- Build & Run Local Execution
# Build the application
go build .
# Start the server
./generic-shop-sample serve
# Create admin user
./generic-shop-sample new-admin -u admin -p securePasswordDocker Deployment
# Build and start services
docker compose build
docker compose up -d
# View logs
docker compose logs -f- secure password hashing base
- JWT Authentication
- Role-Based Access Control
Run Tests
## Unit Tests
go test ./... -v- email: daniel-k84@outlook.com