# Contributing to TaaS Platform Thank you for your interest in contributing to the TaaS Platform! This document provides guidelines for contributing to the project. ## Table of Contents - [Getting Started](#getting-started) - [Project Structure](#project-structure) - [Development Workflow](#development-workflow) - [Code Style](#code-style) - [Testing](#testing) - [Commit Message Format](#commit-message-format) - [Pull Request Process](#pull-request-process) - [CI/CD](#cicd) - [Release Process](#release-process) - [Reporting Issues](#reporting-issues) - [License](#license) ## Getting Started ### Prerequisites - **Go 1.26+**: [Download](https://go.dev/dl/) - **Rust 1.94+**: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` - **Node.js 22+**: [Download](https://nodejs.org/) - **pnpm**: `npm install -g pnpm` - **Docker**: [Install](https://docs.docker.com/get-docker/) - **PostgreSQL 15+**: [Install](https://www.postgresql.org/download/) - **Redis**: [Install](https://redis.io/download) - **Kubernetes**: [Install](https://kubernetes.io/docs/tasks/tools/) (for production deployment) - **Helm 3+**: [Install](https://helm.sh/docs/intro/install/) (for production deployment) - **MongoDB 7.0+**: [Install](https://www.mongodb.com/docs/manual/installation/) (required for free5GC only) ### Setup 1. **Fork the repository** 2. **Clone your fork:** ```bash git clone https://github.com/nutcas3/telecom-platform.git cd telecom-platform ``` 3. **Install dependencies:** ```bash make install-deps ``` 4. **Set up databases:** ```bash make db-setup make db-migrate ``` 5. **Build all components:** ```bash make all ``` ## Project Structure ``` telecom-platform/ ├── apps/ │ ├── api-server/ # Go BSS API server │ ├── carrier-connector/ # Go ES2+ carrier integration │ ├── charging-engine/ # Rust real-time charging │ ├── packet-gateway/ # Rust eBPF packet processing │ ├── cli/ # Go CLI tool │ └── web-dashboard/ # Next.js management UI ├── sdk/ │ └── typescript/ # TypeScript SDK ├── deployments/ │ ├── docker/ # Dockerfiles │ ├── kubernetes/ # K8s manifests │ ├── helm/ # Helm charts │ └── free5gc/ # 5G core network config ├── monitoring/ # Prometheus/Grafana configs └── scripts/ # Setup and utility scripts ``` ## Development Workflow 1. **Create a feature branch:** ```bash git checkout -b feature/your-feature-name ``` 2. **Make your changes:** - Write clear, documented code - Follow language-specific style guides - Add tests for new functionality - Update documentation as needed 3. **Run linters:** ```bash make lint ``` 4. **Run tests:** ```bash make test ``` 5. **Format code:** ```bash make fmt ``` 6. **Commit your changes:** ```bash git add . git commit -m "feat: add new feature" ``` 7. **Push to your fork:** ```bash git push origin feature/your-feature-name ``` 8. **Create a Pull Request** ## Code Style ### Go - Follow [Effective Go](https://go.dev/doc/effective_go) - Use `gofmt` for formatting: `make fmt-go` - Run `golangci-lint` before committing: `make lint-go` - Use descriptive variable and function names - Add godoc comments for exported functions - Handle errors explicitly, don't ignore them ### Rust - Follow [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/) - Use `cargo fmt` for formatting: `cargo fmt` - Run `cargo clippy` before committing: `make lint-rust` - Use `Result` for error handling - Prefer `unwrap()` only in tests - Document unsafe blocks with safety comments ### TypeScript - Follow [Airbnb Style Guide](https://github.com/airbnb/javascript) - Use Prettier for formatting: `make lint-ui` - Use ESLint for linting - Use TypeScript strict mode - Prefer functional programming patterns - Add JSDoc comments for public APIs ## Testing ### Testing Strategy - **Unit Tests**: Test individual functions and methods in isolation - **Integration Tests**: Test service interactions with real dependencies - **End-to-End Tests**: Test complete workflows across services - **Race Detection**: Use `-race` flag for Go tests to detect data races ### Running Tests ```bash # Run all tests make test # Run Go tests with race detection make test-go # Run Rust tests in release mode make test-rust-release # Run TypeScript tests pnpm -r test ``` ### Test Coverage - Aim for >80% code coverage on new code - Run coverage reports before submitting PRs - Add tests for bug fixes to prevent regressions ## Commit Message Format We use [Conventional Commits](https://www.conventionalcommits.org/): ``` ():