# GoPrint Service General API A comprehensive Go microservice providing REST API and gRPC support. Built with **Clean Architecture**, **Domain-Driven Design (DDD)**, and **CQRS Pattern**, featuring multi-database support, intelligent caching, and direct integration with Indonesian Health Systems (BPJS VClaim & SatuSehat). ## πŸ—οΈ Architecture This project strongly follows **Clean Architecture** principles, **CQRS Pattern** (Command and Query Responsibility Segregation), and **Domain-Driven Design (DDD)** patterns: ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Transport Layer β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ REST API (Gin) β”‚ β”‚ gRPC API β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Application Layer β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Auth Service β”‚ β”‚ Role/Master Service β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Domain Layer β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Command Repository β”‚ β”‚ Query Repository β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Infrastructure Layer β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Multi-DB & Cache β”‚ β”‚ BPJS VClaim & SatuSehat β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸš€ Features ### Core Features - βœ… **Dual API Support**: REST (Gin) + gRPC endpoints - βœ… **Clean Architecture**: Domain β†’ Application β†’ Infrastructure β†’ Transport - βœ… **Domain-Driven Design**: Bounded Contexts (Auth, Patient) - βœ… **Multi-Database Support**: PostgreSQL, MySQL, SQL Server, MongoDB, SQLite - βœ… **Connection Pooling**: Optimized database connections with health monitoring - βœ… **Read Replicas**: Load balancing with round-robin strategy - βœ… **Audit Trail**: Complete audit logging for data changes - βœ… **Soft Delete**: Data retention with active/inactive views ### Security Features - βœ… **JWT Authentication**: Multiple auth providers (JWT, Keycloak, Static) - βœ… **CORS Support**: Configurable cross-origin resource sharing - βœ… **Rate Limiting**: Configurable request rate limiting - βœ… **Security Headers**: XSS, CSRF, and other security headers - βœ… **Input Validation**: Comprehensive data validation - βœ… **SQL Injection Prevention**: Parameterized queries and input sanitization ### Integration Features - βœ… **BPJS Integration**: Indonesian health insurance system integration - βœ… **SatuSehat Integration**: Indonesian health data platform - βœ… **Swagger Documentation**: Auto-generated API documentation - βœ… **Health Checks**: Database and service health monitoring - βœ… **Metrics Collection**: Application performance metrics ### Development Features - βœ… **Hot Reload**: Development server with auto-restart - βœ… **Code Generation**: Automated entity and service generation - βœ… **Docker Support**: Containerized deployment - βœ… **Environment Configuration**: YAML + Environment variables - βœ… **Structured Logging**: Comprehensive logging system ## πŸ“ Project Structure ```text service-general/ # 🏠 Root Project β”œβ”€β”€ cmd/api/ # πŸš€ Application Entry Point (main.go) β”œβ”€β”€ internal/ # πŸ”’ Private Application Code β”‚ β”œβ”€β”€ auth/ # πŸ” Authentication Context β”‚ β”œβ”€β”€ master/ # πŸ“Š Master Data Context β”‚ β”œβ”€β”€ infrastructure/ # πŸ—οΈ Technical Infrastructure (DB, HTTP, gRPC) β”‚ └── interfaces/ # πŸ”Œ External Services (BPJS, SatuSehat) β”œβ”€β”€ pkg/ # πŸ“¦ Public Reusable Libraries β”‚ β”œβ”€β”€ errors/ # 🚨 Error handling system β”‚ β”œβ”€β”€ logger/ # πŸ“ Logging system β”‚ └── utils/query/ # πŸ” Advanced Query Builder β”œβ”€β”€ scripts/ # πŸ”„ Automation Scripts β”œβ”€β”€ tools/ # πŸ”§ Development Tools β”œβ”€β”€ docs/ # πŸ“š Documentation β”œβ”€β”€ config.yaml # βš™οΈ Configuration file └── Makefile # πŸ”¨ Build automation ``` ## οΏ½ Requirements - Go 1.21+ - PostgreSQL 12+ (recommended) - Redis 6+ (for rate limiting) - Docker & Docker Compose (optional) ## πŸ› οΈ Installation ### 1. Clone the Repository ```bash git clone cd service-general ``` ### 2. Install Dependencies ```bash go mod download go mod tidy ``` ### 3. Install Development Tools ```bash # Install gRPC code generation tools go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-go@v1.31.0 go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v1.31.0 go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 # Install Swagger generation tool go install github.com/swaggo/swag/cmd/swag@v1.16.2 ``` ### 4. Setup Database ```bash # Create PostgreSQL database createdb api_service # Run migrations psql -d api_service -f migrations/001_initial_schema.sql ``` ### 5. Configure Environment ```bash # Copy configuration template cp config.yaml.example config.yaml # Edit configuration vim config.yaml ``` ### 6. Run the Application ```bash # Development mode make run # Or manually go run cmd/api/main.go ``` ## πŸ”§ Configuration ### Environment Variables ```bash # Server Configuration PORT=8080 GIN_MODE=debug # Database Configuration DB_HOST=localhost DB_PORT=5432 DB_USERNAME=postgres DB_PASSWORD=password DB_DATABASE=api_service # JWT Configuration JWT_SECRET=your-secret-key # BPJS Configuration BPJS_CONSID=your-cons-id BPJS_SECRETKEY=your-secret-key BPJS_USERKEY=your-user-key # Rate Limiting RATE_LIMIT_REQUESTS_PER_MINUTE=60 ``` ### Configuration File (config.yaml) ```yaml server: rest: enabled: true port: 8080 grpc: enabled: true port: 50051 mode: debug read_timeout: 30 write_timeout: 30 databases: primary: type: postgres host: localhost port: 5432 username: postgres password: password database: api_service max_open_conns: 25 max_idle_conns: 25 conn_max_lifetime: 5m auth: type: jwt static_tokens: [] bpjs: base_url: https://apijkn.bpjs-kesehatan.go.id cons_id: "" secret_key: "" user_key: "" timeout: 30s security: trusted_origins: - http://localhost:3000 - http://localhost:8080 max_input_length: 500 rate_limit: requests_per_minute: 60 ``` ## πŸ“š API Documentation ### REST API Endpoints #### Authentication - `POST /api/v1/auth/login` - User login - `POST /api/v1/auth/logout` - User logout - `POST /api/v1/auth/refresh` - Refresh token - `GET /api/v1/auth/profile` - Get user profile #### Patients - `GET /api/v1/patients` - List patients (paginated) - `GET /api/v1/patients/{id}` - Get patient by ID - `POST /api/v1/patients` - Create new patient - `PUT /api/v1/patients/{id}` - Update patient - `DELETE /api/v1/patients/{id}` - Delete patient #### Medical Records - `GET /api/v1/patients/{id}/medical-records` - Get patient medical records - `POST /api/v1/patients/{id}/medical-records` - Create medical record - `PUT /api/v1/medical-records/{id}` - Update medical record #### Health Check - `GET /api/v1/health` - Application health status - `GET /api/v1/health/database` - Database connection status ### gRPC API Endpoints #### Auth Service ```protobuf service AuthService { rpc Login(LoginRequest) returns (LoginResponse); rpc Logout(LogoutRequest) returns (LogoutResponse); rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse); rpc GetProfile(GetProfileRequest) returns (GetProfileResponse); } ``` #### Patient Service ```protobuf service PatientService { rpc ListPatients(ListPatientsRequest) returns (ListPatientsResponse); rpc GetPatient(GetPatientRequest) returns (GetPatientResponse); rpc CreatePatient(CreatePatientRequest) returns (CreatePatientResponse); rpc UpdatePatient(UpdatePatientRequest) returns (UpdatePatientResponse); rpc DeletePatient(DeletePatientRequest) returns (DeletePatientResponse); } ``` ## 🐳 Docker Deployment ### Build Docker Image ```bash docker build -t service-general . ``` ### Run with Docker Compose ```bash docker-compose up -d ``` ### Docker Compose Configuration ```yaml version: '3.8' services: service-general: build: . ports: - "8080:8080" - "50051:50051" environment: - DB_HOST=postgres - REDIS_HOST=redis depends_on: - postgres - redis postgres: image: postgres:15 environment: POSTGRES_DB: api_service POSTGRES_USER: postgres POSTGRES_PASSWORD: password volumes: - postgres_data:/var/lib/postgresql/data redis: image: redis:7-alpine ports: - "6379:6379" volumes: postgres_data: ``` ## πŸ§ͺ Testing ### Run Tests ```bash # Run all tests make test # Run tests with coverage make test-coverage # Run integration tests make test-integration ``` ### Test Examples ```bash # Test health endpoint curl http://localhost:8080/api/v1/health # Test patient creation curl -X POST http://localhost:8080/api/v1/patients \ -H "Content-Type: application/json" \ -d '{ "nik": "1234567890123456", "name": "John Doe", "date_of_birth": "1990-01-01", "gender": "L" }' ``` ## πŸ“Š Monitoring & Metrics ### Health Check Endpoints - `/api/v1/health` - Overall application health - `/api/v1/health/database` - Database connection status - `/api/v1/health/external` - External service status ### Metrics Collection - Request count and duration - Database connection pool metrics - Error rates and types - Authentication success/failure rates ### Logging - Structured JSON logging - Request/Response logging - Error stack traces - Performance metrics ## πŸ”’ Security ### Authentication - JWT tokens with configurable expiration - Multiple auth providers (JWT, Keycloak, Static) - Token refresh mechanism - Session management ### Authorization - Role-based access control (RBAC) - Permission-based endpoints - API key authentication - Rate limiting per user/IP ### Data Protection - SQL injection prevention - XSS protection headers - CSRF protection - Input validation and sanitization ## πŸš€ Performance ### Database Optimization - Connection pooling with configurable limits - Read replica support with load balancing - Query optimization and indexing - Health monitoring and automatic reconnection ### Caching - Redis-based session storage - Application-level caching - Database query result caching - Static asset caching ### Scalability - Horizontal scaling support - Load balancer ready - Microservice architecture - Container orchestration ready ## πŸ› οΈ Development ### Code Generation ```bash # Generate new entity make generate entity=Patient # Generate service for entity make generate service=Patient # Generate CRUD handlers make generate crud=Patient ``` ### Database Migrations ```bash # Create new migration make migration create=add_new_table # Run migrations make migration up # Rollback migration make migration down # Create a new migration using goose goose -dir internal/infrastructure/database/sql create create_users_table sql ``` ### API Documentation ```bash # Generate Swagger docs make swagger # Serve Swagger UI make swagger-serve ``` ## πŸ“ˆ Production Deployment ### Environment Setup ```bash # Production environment variables export GIN_MODE=release export PORT=8080 export DB_HOST=your-production-db export JWT_SECRET=your-production-secret ``` ### Monitoring Setup - Prometheus metrics endpoint - Grafana dashboard templates - Log aggregation with ELK stack - Alert configuration ### CI/CD Pipeline - GitHub Actions workflow - Automated testing - Docker image building - Deployment automation ## 🀝 Contributing 1. Fork the repository 2. Create feature branch (`git checkout -b feature/amazing-feature`) 3. Commit changes (`git commit -m 'Add amazing feature'`) 4. Push to branch (`git push origin feature/amazing-feature`) 5. Open Pull Request ### Code Style - Follow Go conventions - Use meaningful variable names - Add comments for complex logic - Write unit tests for new features ## πŸ“„ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## πŸ†˜ Support For support and questions: - Create an issue on GitHub - Check the [Wiki](wiki) for documentation - Join our [Discord](https://discord.gg/your-server) community ## πŸ—ΊοΈ Roadmap service-general/ # 🏠 Root Project β”œβ”€β”€ πŸ“ cmd/ # πŸš€ Application Entry Points β”‚ └── πŸ“ api/ # API Application β”‚ └── πŸ“„ main.go # 🎯 Main entry point (wires everything together) β”‚ β”œβ”€β”€ πŸ“ internal/ # πŸ”’ Private Application Code β”‚ β”œβ”€β”€ πŸ“ auth/ # πŸ” Bounded Context: Authentication β”‚ β”‚ β”œβ”€β”€ πŸ“ domain/ # πŸ›οΈ Core auth entities & business rules β”‚ β”‚ β”‚ └── πŸ“„ model.go # User, Role entities β”‚ β”‚ β”œβ”€β”€ πŸ“ repository/ # πŸ’Ύ Data access interfaces β”‚ β”‚ β”‚ └── πŸ“„ repo.go # Auth repository interface β”‚ β”‚ └── πŸ“ usecase/ # βš™οΈ Application business logic β”‚ β”‚ └── πŸ“„ service.go # Auth services (login, register, etc) β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ master/ # πŸ“Š Bounded Context: Master Data β”‚ β”‚ β”œβ”€β”€ πŸ“„ dto.go # πŸ“‹ Data Transfer Objects β”‚ β”‚ β”œβ”€β”€ πŸ“„ entity.go # πŸ—ƒοΈ Master entities β”‚ β”‚ β”œβ”€β”€ πŸ“„ repository.go # πŸͺ Master repository interface β”‚ β”‚ └── πŸ“„ service.go # πŸ› οΈ Master business logic β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ infrastructure/ # πŸ—οΈ Technical Infrastructure Layer β”‚ β”‚ β”œβ”€β”€ πŸ“ config/ # βš™οΈ Configuration management β”‚ β”‚ β”‚ └── πŸ“„ config.go # Load config.yaml β”‚ β”‚ β”œβ”€β”€ πŸ“ container/ # πŸ“¦ Dependency injection container β”‚ β”‚ β”œβ”€β”€ πŸ“ database/ # πŸ’½ Database connections & migrations β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“„ database.go # Multi-database support (PostgreSQL, MySQL, SQL Server, MongoDB) β”‚ β”‚ β”‚ └── πŸ“ migrations/ # πŸ—„οΈ Database migrations β”‚ β”‚ └── πŸ“ transport/ # 🌐 API Transport Layer β”‚ β”‚ β”œβ”€β”€ πŸ“ grpc/ # πŸš€ gRPC implementation β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ gen/ # πŸ“ Generated gRPC code β”‚ β”‚ β”‚ β”œβ”€β”€ πŸ“ proto/ # πŸ“„ Protocol buffer definitions β”‚ β”‚ β”‚ └── πŸ“ servers/ # πŸ–₯️ gRPC server implementations β”‚ β”‚ └── πŸ“ http/ # 🌐 REST API implementation β”‚ β”‚ β”œβ”€β”€ πŸ“ handlers/ # 🎯 HTTP request handlers β”‚ β”‚ β”œβ”€β”€ πŸ“ middleware/ # πŸ›‘οΈ HTTP middlewares β”‚ β”‚ β”œβ”€β”€ πŸ“ routes/ # πŸ—ΊοΈ Route definitions β”‚ β”‚ └── πŸ“ servers/ # πŸ–₯️ HTTP server setup β”‚ β”‚ β”‚ └── πŸ“ interfaces/ # πŸ”Œ External Service Interfaces β”‚ β”œβ”€β”€ πŸ“ bpjs/ # πŸ₯ BPJS Integration β”‚ β”‚ └── πŸ“ vclaim/ # πŸ’³ BPJS VClaim service β”‚ β”‚ β”œβ”€β”€ πŸ“„ VCLAIM.md # πŸ“– Documentation β”‚ β”‚ β”œβ”€β”€ πŸ“„ client.go # 🌐 HTTP client β”‚ β”‚ β”œβ”€β”€ πŸ“„ crypto.go # πŸ” Cryptography utilities β”‚ β”‚ β”œβ”€β”€ πŸ“„ service.go # πŸ› οΈ VClaim service logic β”‚ β”‚ └── πŸ“„ types.go # πŸ“‹ Type definitions β”‚ └── πŸ“ satusehat/ # πŸ₯ SatuSehat Integration (HL7 FHIR) β”‚ β”œβ”€β”€ πŸ“ pkg/ # πŸ“¦ Public Reusable Libraries β”‚ β”œβ”€β”€ πŸ“ errors/ # 🚨 Error handling system β”‚ β”‚ β”œβ”€β”€ πŸ“„ ERRORS.md # πŸ“– Error documentation β”‚ β”‚ β”œβ”€β”€ πŸ“„ builder.go # πŸ—οΈ Error builder β”‚ β”‚ β”œβ”€β”€ πŸ“„ codes.go # πŸ”’ Error codes β”‚ β”‚ β”œβ”€β”€ πŸ“„ grpc.go # 🌐 gRPC error handling β”‚ β”‚ β”œβ”€β”€ πŸ“„ http.go # 🌐 HTTP error handling β”‚ β”‚ └── πŸ“„ validator.go # βœ… Validation errors β”‚ β”œβ”€β”€ πŸ“ logger/ # πŸ“ Logging system β”‚ β”‚ └── πŸ“„ logger.go # πŸͺ΅ Configurable logger β”‚ β”œβ”€β”€ πŸ“ metrics/ # πŸ“Š Application metrics β”‚ β”œβ”€β”€ πŸ“ response/ # πŸ“€ HTTP response utilities β”‚ β”‚ └── πŸ“„ response.go # 🎯 Standardized responses β”‚ └── πŸ“ utils/ # πŸ› οΈ Utility functions β”‚ └── πŸ“ query/ # πŸ” Advanced Query Builder β”‚ β”œβ”€β”€ πŸ“„ BUILDER.md # πŸ“– Query builder docs β”‚ β”œβ”€β”€ πŸ“„ builder_query.go # πŸ—οΈ Main query builder β”‚ β”œβ”€β”€ πŸ“„ dialects.go # πŸ—£οΈ Database dialect support β”‚ β”œβ”€β”€ πŸ“„ sql_builder.go # πŸ—οΈ SQL query builder β”‚ β”œβ”€β”€ πŸ“„ mongo_builder.go # πŸƒ MongoDB query builder β”‚ └── πŸ“„ sql_security.go # πŸ”’ SQL injection protection β”‚ β”œβ”€β”€ πŸ“ scripts/ # πŸ”„ Automation Scripts β”‚ β”œβ”€β”€ πŸ“„ build.sh # πŸ”¨ Build application β”‚ β”œβ”€β”€ πŸ“„ generate_proto.sh # πŸ“ Generate gRPC protobuf β”‚ β”œβ”€β”€ πŸ“„ migrate.sh # πŸ—„οΈ Run database migrations β”‚ └── πŸ“„ seed.sh # 🌱 Seed initial data β”‚ β”œβ”€β”€ πŸ“ tools/ # πŸ”§ Development Tools β”‚ β”œβ”€β”€ πŸ“„ generate.go # 🏭 Code generator β”‚ └── πŸ“„ generate_config.yaml # βš™οΈ Generator configuration β”‚ β”œβ”€β”€ πŸ“„ config.yaml # βš™οΈ Main configuration file β”œβ”€β”€ πŸ“„ go.mod # πŸ“¦ Go module dependencies β”œβ”€β”€ πŸ“„ go.sum # πŸ”’ Dependency checksums β”œβ”€β”€ πŸ“„ Makefile # πŸ”¨ Build automation β”œβ”€β”€ πŸ“„ README.md # πŸ“– Project documentation β”œβ”€β”€ πŸ“„ Dockerfile # 🐳 Production container β”œβ”€β”€ πŸ“„ Dockerfile.dev # 🐳 Development container β”œβ”€β”€ πŸ“„ docker-compose.dev.yml # 🐳 Dev environment β”œβ”€β”€ πŸ“„ docker-compose.prod.yml # 🐳 Production environment └── πŸ“„ .air.toml # πŸ”„ Live reload configuration goose -dir internal/infrastructure/database/sql create create_users_table sql