Complete guide for setting up the development environment from scratch on Windows. Use this when helping new developers get started or troubleshooting environment issues.
Run these checks to see what's already installed:
# Check Go
go version # Should be 1.22+
# Check PostgreSQL
$env:Path += ";D:\Program Files\PostgreSQL\18\bin"
psql --version # Should be 15+
# Check Flutter
$env:Path += ";C:\src\flutter\bin"
flutter --version # Should be 3.2+
# Check Docker (optional)
docker --version
Install Go 1.22+:
go versionInstall PostgreSQL (choose one):
Option A: Docker (Recommended)
ecommerce-backend/: docker compose up -dOption B: Local PostgreSQL
$env:Path += ";D:\Program Files\PostgreSQL\18\bin"psql -U postgres
CREATE DATABASE ecommerce;
\q
Install Flutter 3.2+:
C:\src\flutter (or preferred location)$env:Path += ";C:\src\flutter\bin"flutter doctorflutter doctorEnable Windows Desktop Development:
flutter config --enable-windows-desktop
Install Chrome (for web development):
# Navigate to backend
cd "D:\demo project\ecommerce-backend"
# Install dependencies
go mod download
go mod tidy
# Copy environment file
cp .env.example .env
# Edit .env file (update if needed)
# DATABASE_URL, JWT_SECRET, etc.
# Run migrations (CRITICAL - creates database tables)
make migrate-up
# OR
go run cmd/migrate/main.go up
# Verify tables created
$env:PGPASSWORD = "postgres"
psql -U postgres -d ecommerce -c "\dt"
# Start backend server
make run
# OR
go run cmd/api/main.go
Backend should now run on: http://localhost:8080
Verify backend:
curl http://localhost:8080/health
# Navigate to frontend
cd "D:\demo project\ecommerce-app"
# Add Flutter to PATH (if not permanent)
$env:Path += ";C:\src\flutter\bin"
# Get dependencies
flutter pub get
# Analyze for issues
flutter analyze
# Run app (ensure backend is running first)
flutter run -d chrome --web-port=3000
# OR
flutter run -d windows
# Server
PORT=8080
ENVIRONMENT=development
# Database
DATABASE_URL=postgres://postgres:postgres@localhost:5432/ecommerce?sslmode=disable
# JWT (CHANGE IN PRODUCTION!)
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_ACCESS_TOKEN_EXPIRATION=30m
JWT_REFRESH_TOKEN_EXPIRATION=168h
# Rate Limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_RPS=10
# CORS
CORS_ALLOW_ORIGINS=http://localhost:3000,http://localhost:8080
# Future: Stripe keys, email settings, etc.
static const String baseUrl = 'http://localhost:8080/api/v1';
To avoid setting PATH every time:
PowerShell Profile:
# Open profile
notepad $PROFILE
# Add these lines:
$env:Path += ";C:\src\flutter\bin"
$env:Path += ";D:\Program Files\PostgreSQL\18\bin"
# Save and reload
. $PROFILE
Or System Environment Variables:
C:\src\flutter\binD:\Program Files\PostgreSQL\18\binBackend Tools:
# Swagger doc generator
go install github.com/swaggo/swag/cmd/swag@latest
# Migration tool (if not using go run)
go install github.com/golang-migrate/migrate/v4/cmd/migrate@latest
# Linter
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Frontend Tools:
# DevTools for debugging
flutter pub global activate devtools
VS Code Extensions (Recommended):
Backend:
cd ecommerce-backend
make run # Start server
make test # Run tests
make migrate-up # Run migrations
make migrate-down # Rollback migrations
go mod tidy # Clean dependencies
Frontend:
cd ecommerce-app
flutter pub get # Get dependencies
flutter run -d chrome # Run on web
flutter analyze # Check for issues
flutter test # Run tests
flutter clean # Clean build cache
$env:Path += ";D:\Program Files\PostgreSQL\18\bin"$env:Path += ";C:\src\flutter\bin"psql -U postgres -lecommerce-backend/ directory# Find process
netstat -ano | findstr ":8080"
# Kill if needed
taskkill /PID <PID> /F
go mod download)flutter pub get)ecommerce)