First off, thank you for considering contributing to MetaRGB Microservices. This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Key Principles
- Getting Started
- Project Architecture
- Development Workflow
- Commit Convention
- Writing Code
- Testing
- Pull Request Process
- Reporting Bugs
- Coding Standards
- API Compatibility (CRITICAL)
- Getting Help
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Report unacceptable behavior to the project maintainers.
- 100% API Compatibility: All services MUST maintain 100% API compatibility with the original Laravel monolith – JSON fields, status codes, validation formats, Jalali dates, and URL structures.
- Security First: Never hardcode secrets. Use
config.envfiles only. - Test Coverage: Every change must be covered by unit, integration, and golden tests.
- Layered Architecture: Strictly follow
handler → service → repositorypattern. - Environment Parity: Development must work with Docker Compose.
| Tool | Version | Command |
|---|---|---|
| Go | 1.21+ | go version |
| Protocol Buffers | latest | protoc --version |
| Docker & Docker Compose | latest | docker --version |
| Node.js | 18+ | node --version |
| Make | latest | make --version |
# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/microservice-metarang.git
cd microservice-metarang
# 2. Add upstream
git remote add upstream https://github.com/iranpsc/microservice-metarang.git
# 3. Create config files for your service
cp services/auth-service/config.env.sample services/auth-service/config.env
# Edit config.env with your values
# 4. Generate proto files
make proto
# 5. Start infrastructure
docker compose up -d mysql redis
sleep 10
make import-schema
# 6. Run development environment
make dev
# 7. Verify
make ps
curl http://localhost:8000
curl http://localhost:3002/healthmetargb-microservices/ ├── services/ # Each microservice │ ├── auth-service/ │ │ ├── cmd/server/main.go │ │ ├── internal/ │ │ │ ├── handler/ # gRPC handlers │ │ │ ├── service/ # Business logic │ │ │ └── repository/ # Data access │ │ └── config.env.sample │ ├── commercial-service/ │ ├── features-service/ │ ├── levels-service/ │ ├── dynasty-service/ │ ├── support-service/ │ ├── training-service/ │ ├── notifications-service/ │ ├── calendar-service/ │ ├── storage-service/ │ ├── financial-service/ │ ├── grpc-gateway/ │ └── websocket-gateway/ ├── shared/ │ ├── proto/ # .proto definitions │ ├── pb/ # Generated code │ └── pkg/ # Shared packages (db, auth, logger, metrics) ├── kong/ # Kong Gateway config ├── scripts/ # Database schema ├── tests/ # Integration & golden tests ├── docs/ # Documentation ├── monitoring/ # Grafana dashboards ├── k8s/ # Kubernetes manifests ├── .cursor/rules/ # LLM assistant rules ├── Makefile └── docker-compose.yml
# Feature branches
git checkout -b feature/add-otp-login# Bug fixes
git checkout -b fix/payment-timeout# Documentation
git checkout -b docs/update-readme# Performance
git checkout -b perf/cache-user-sessionService gRPC Port HTTP Port auth-service 50051 - commercial-service 50052 - features-service 50053 - levels-service 50054 - dynasty-service 50055 - support-service 50056 - training-service 50057 - notifications-service 50058 - calendar-service 50059 - storage-service 50060 8059 financial-service 50062 - grpc-gateway - 8080 websocket-gateway - 3002 Kong Gateway - 8000
# Feature branches
git checkout -b feature/add-otp-login# Bug fixes
git checkout -b fix/payment-timeoutgit checkout -b docs/update-readme
# Performance
git checkout -b perf/cache-user-sessionTypes: feat, fix, docs, style, refactor, perf, test, chore
Scopes: auth, commercial, features, levels, dynasty, support, training, notifications, calendar, storage, financial, gateway, shared, proto, kong, scripts, docs
Examples:
git commit -m "feat(auth): add SMS-based OTP login"git commit -m "fix(commercial): handle Parsian payment timeout"
git commit -m "docs(contributing): add contribution guidelines"git commit -m "perf(storage): implement FTP connection pooling"
git commit -m "test(auth): add unit tests for login service"