A modern, scalable microservices-based e-commerce API built with Go, featuring comprehensive testing, CI/CD, and beautiful API documentation.
GoCart E-commerce Platform - Experience the full-featured shopping platform with real-time product browsing, user management, and order processing!
Interactive API Explorer - Test APIs directly in your browser
- Product API: Swagger UI | OpenAPI Spec
- User API: Swagger UI | OpenAPI Spec
- Order API: Swagger UI | OpenAPI Spec
GoCart implements a microservices architecture with the following services:
- React 18 with TypeScript
- React Router for navigation
- Custom hooks for state management
- Responsive CSS with mobile-first design
- Real-time search & sorting
- Animated gopher branding
| Service | Endpoint | Status | Description |
|---|---|---|---|
| Product Service | /products |
Complete | Product catalog, inventory, CRUD operations |
| User Service | /users |
Complete | User management, authentication, profiles |
| Order Service | /orders |
Complete | Order processing and management |
All services run on single port
- Payment Service - Payment processing simulation
- Notification Service - Email/SMS notifications
- Go 1.23+
- PostgreSQL 13+
- Docker & Docker Compose (optional)
git clone https://github.com/wasifsarwar/gocart.git
cd gocart
go mod download# Start PostgreSQL with Docker
docker-compose up -d postgres
# Or use your local PostgreSQL
createdb gocart_db# Shut down PostgreSQL instance
brew services stop postgresqlgo run cmd/main.goUnified API: http://localhost:8080
- Products: http://localhost:8080/products
- Users: http://localhost:8080/users
- Orders: http://localhost:8080/orders
ℹ️ When the backend boots successfully it automatically migrates the schema and seeds the database with the sample catalog/users defined under
pkg/seeder/data. You’ll see the seeding summary in the logs—no additional command is required for local development.
# Start all services
docker-compose up
# Build and start
docker-compose up --build
# Stop all services
docker-compose down
# View logs
docker-compose logs app # Backend logs# Start everything with one command
./start.shNeed a filled database before you launch the backend? Run the dedicated seeding command:
go run ./cmd/seedThis connects to the configured Postgres instance, migrates schemas, and loads the sample products/users defined in pkg/seeder/data/*.yaml. Feel free to tweak those YAML files (e.g., adjust prices or categories) and rerun the command whenever you need a fresh dataset.
GET /products # List all products
POST /products # Create product
GET /products/{id} # Get product by ID
PUT /products/{id} # Update product
DELETE /products/{id} # Delete productGET /users # List all users
POST /users/register # Register new user
POST /users/login # Login user
GET /users/{id} # Get user by ID
PUT /users/{id} # Update user
DELETE /users/{id} # Delete userGET /orders # List all orders
POST /orders # Create new order
GET /orders/{id} # Get order by ID
PUT /orders/{id} # Update order
DELETE /orders/{id} # Delete order
GET /orders/user/{user_id} # Get orders by user ID
DELETE /orders/{id}/items # Delete order itemgo test ./...