{"id":23188429,"url":"https://github.com/crazywolf132/ultimate-gomake","last_synced_at":"2025-04-05T05:44:49.247Z","repository":{"id":266362726,"uuid":"898147758","full_name":"crazywolf132/ultimate-gomake","owner":"crazywolf132","description":"The ultimate makefile for any golang project","archived":false,"fork":false,"pushed_at":"2024-12-05T02:05:29.000Z","size":35,"stargazers_count":237,"open_issues_count":1,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T15:34:17.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazywolf132.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-03T21:51:20.000Z","updated_at":"2025-03-15T20:21:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5d9b97c-dc13-4bf9-a1c9-ea9838ce0d3f","html_url":"https://github.com/crazywolf132/ultimate-gomake","commit_stats":null,"previous_names":["crazywolf132/ultimate-gomake"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazywolf132%2Fultimate-gomake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazywolf132%2Fultimate-gomake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazywolf132%2Fultimate-gomake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazywolf132%2Fultimate-gomake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazywolf132","download_url":"https://codeload.github.com/crazywolf132/ultimate-gomake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294463,"owners_count":20915338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-18T11:14:41.200Z","updated_at":"2025-04-05T05:44:49.241Z","avatar_url":"https://github.com/crazywolf132.png","language":"Makefile","readme":"# Ultimate Golang Makefile\n\nA comprehensive, production-ready Makefile system for Go projects of any size. This Makefile provides a complete set of commands for development, testing, building, and deployment workflows while remaining flexible and customizable.\n\n## 🚀 Features\n\n- **Flexible Configuration**: Support for environment variables, .env files, and command-line overrides\n- **Multi-Environment Support**: Development, staging, and production builds\n- **Cross-Platform Building**: Support for multiple OS/Architecture combinations\n- **Advanced Testing**: Unit, integration, and end-to-end testing with coverage reports\n- **Docker Integration**: Build, push, and run Docker containers\n- **Database Operations**: Migration management and database utilities\n- **Development Tools**: Hot reload, formatting, linting, and security scanning\n- **CI/CD Ready**: Integrated pipeline support for common CI systems\n- **Documentation**: Automatic API documentation generation\n- **Monorepo Support**: Build and manage multiple services\n- **Comprehensive Reporting**: Test coverage, benchmarks, and security reports\n\n## 📋 Prerequisites\n\n- Go 1.21 or higher\n- Make\n- Docker (optional)\n- Git\n\n## 🛠 Installation\n\n1. Copy the Makefile to your project root:\n```bash\ncurl -O https://raw.githubusercontent.com/crazywolf132/ultimate-gomake/main/Makefile\n```\n\n2. Initialize your project:\n```bash\nmake init\n```\n\nThis will:\n- Create necessary directories\n- Initialize Go modules\n- Install required tools\n- Create default configuration files\n\n## ⚙️ Configuration\n\n### Environment Variables\n\nCreate a `.env` file in your project root to override default settings:\n\n```env\n# Project Configuration\nPROJECT_NAME=myapp\nORGANIZATION=myorg\nENABLE_DOCKER=true\nENABLE_PROTO=false\n\n# Build Settings\nCGO_ENABLED=0\nCOVERAGE_THRESHOLD=80\n\n# Docker Settings\nDOCKER_REGISTRY=docker.io\nDOCKER_REPO=myorg/myapp\n```\n\n### Project Structure\n\nThe Makefile assumes the following project structure:\n```\n.\n├── cmd/\n│   └── myapp/\n│       └── main.go\n├── pkg/\n├── internal/\n├── api/\n├── docs/\n├── scripts/\n├── build/\n├── configs/\n├── test/\n│   ├── e2e/\n│   └── integration/\n└── Makefile\n```\n\n## 🎯 Common Commands\n\n### Development\n\n```bash\n# Start development with hot reload\nmake dev\n\n# Run tests\nmake test\n\n# Run tests with coverage\nmake test-coverage\n\n# Format and lint code\nmake fmt lint\n\n# Generate mocks and protobuf\nmake generate\n```\n\n### Building\n\n```bash\n# Build for current platform\nmake build\n\n# Build for all platforms\nmake build-all\n\n# Build with debug symbols\nmake build-debug\n\n# Build with race detector\nmake build-race\n```\n\n### Docker Operations\n\n```bash\n# Build Docker image\nmake docker-build\n\n# Push Docker image\nmake docker-push\n\n# Run in Docker container\nmake docker-run\n```\n\n### Database Operations\n\n```bash\n# Run migrations\nmake db-migrate\n\n# Rollback last migration\nmake db-rollback\n\n# Reset database\nmake db-reset\n```\n\n### Maintenance\n\n```bash\n# Install/update dependencies\nmake deps\nmake deps-update\n\n# Clean build artifacts\nmake clean\n\n# Update tools\nmake tools\n```\n\n## 🏗️ Project Types\n\n### Basic Project\n\nFor single-service projects, use default settings:\n\n```env\nPROJECT_TYPE=basic\n```\n\n### Monorepo\n\nFor multiple services, configure as follows:\n\n```env\nPROJECT_TYPE=monorepo\nMONOREPO_SERVICES=service1 service2 service3\n```\n\nDirectory structure for monorepo:\n```\n.\n├── services/\n│   ├── service1/\n│   │   └── cmd/\n│   ├── service2/\n│   │   └── cmd/\n│   └── service3/\n│       └── cmd/\n└── Makefile\n```\n\n## 📊 Reports\n\nGenerate comprehensive project reports:\n\n```bash\nmake report\n```\n\nThis creates:\n- Test coverage reports\n- Benchmark results\n- Linting reports\n- Security scan results\n\nReports are saved in `docs/reports/`.\n\n## 🔄 CI/CD Integration\n\nThe Makefile includes predefined CI/CD targets:\n\n```bash\n# Run CI pipeline\nmake ci\n\n# Run CD pipeline\nmake cd\n```\n\nCustomize pipelines by modifying these targets in the Makefile.\n\n## 📚 Documentation\n\n```bash\n# Generate documentation\nmake docs\n\n# Serve documentation locally\nmake serve-docs\n```\n\n## 🎨 Customization\n\n### Adding New Targets\n\nAdd custom targets at the end of the Makefile:\n\n```makefile\n.PHONY: custom-target\ncustom-target: ## Custom target description\n    @echo \"Running custom target...\"\n    @# Custom commands here\n```\n\n### Modifying Existing Targets\n\nOverride existing targets by redefining them in `config.mk`:\n\n```makefile\n# config.mk\n.PHONY: test\ntest: ## Custom test implementation\n    @echo \"Running custom tests...\"\n    @# Custom test commands\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a new Pull Request\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🙏 Acknowledgements\n\nSpecial thanks to the Go community and all contributors who have helped shape this Makefile system.\n","funding_links":[],"categories":["Templates"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazywolf132%2Fultimate-gomake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazywolf132%2Fultimate-gomake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazywolf132%2Fultimate-gomake/lists"}