{"id":29180487,"url":"https://github.com/yasindce1998/issue-tracker","last_synced_at":"2026-05-05T09:31:37.311Z","repository":{"id":302283120,"uuid":"1011877171","full_name":"yasindce1998/issue-tracker","owner":"yasindce1998","description":"Project issue tracker service with multi-backend","archived":false,"fork":false,"pushed_at":"2025-07-01T13:34:41.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T14:41:19.652Z","etag":null,"topics":["backend","golang","grpc","grpc-go","kafka","postgresql","redis"],"latest_commit_sha":null,"homepage":"","language":"Go","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/yasindce1998.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,"zenodo":null}},"created_at":"2025-07-01T13:19:43.000Z","updated_at":"2025-07-01T13:36:46.000Z","dependencies_parsed_at":"2025-07-01T14:53:03.329Z","dependency_job_id":null,"html_url":"https://github.com/yasindce1998/issue-tracker","commit_stats":null,"previous_names":["yasindce1998/issue-tracker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yasindce1998/issue-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasindce1998%2Fissue-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasindce1998%2Fissue-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasindce1998%2Fissue-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasindce1998%2Fissue-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yasindce1998","download_url":"https://codeload.github.com/yasindce1998/issue-tracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasindce1998%2Fissue-tracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backend","golang","grpc","grpc-go","kafka","postgresql","redis"],"created_at":"2025-07-01T20:00:22.155Z","updated_at":"2026-05-05T09:31:37.290Z","avatar_url":"https://github.com/yasindce1998.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Issue Tracker Service\r\n\r\nA gRPC-based issue tracking application designed for efficient management of projects and issues. Features both **HashiCorp MemDB** for high-performance in-memory storage, **PostgreSQL** for persistent data storage, and **Kafka** for messaging between services.\r\n\r\n---\r\n\r\n## Project Overview\r\n\r\nThe Issue Tracker provides a robust backend service for managing software development projects and their associated issues. Built using Go, gRPC, **HashiCorp MemDB**, **PostgreSQL**, **Redis**, and **Kafka**, it delivers blazing-fast storage and retrieval operations with structured data schemas and transaction support, along with the durability of a relational database and reliable messaging.\r\n\r\n### Features\r\n\r\n- **Project Management**:\r\n  - Create, read, update, delete, list projects with persistent storage.\r\n  - Real-time project updates through streaming.\r\n- **Issue Tracking**:\r\n  - Associate issues with projects, assign users, update statuses.\r\n  - Comprehensive issue lifecycle management (creation, updates, resolution).\r\n  - Custom issue types, priorities, and resolution states.\r\n- **User Management**:\r\n  - User CRUD operations with support for v1 and v2 APIs.\r\n  - Authentication and user profile management.\r\n- **Dual Storage Strategy**:\r\n  - **HashiCorp MemDB**: For fast, in-memory operations and rapid prototyping.\r\n  - **PostgreSQL Database**: For persistent, durable storage of all entities.\r\n  - **Redis Cache**: For rapid data access and caching frequently used entities.\r\n- **Messaging Architecture**:\r\n  - **Kafka**: For reliable message delivery between services and real-time updates.\r\n  - **In-Memory Stream**: Option for simplified development environments.\r\n- **gRPC API with REST Gateway**:\r\n  - Efficient and type-safe communication through gRPC.\r\n  - REST compatibility via HTTP gateway for broader client support.\r\n\r\n---\r\n\r\n## Prerequisites\r\n\r\n- **Go** (version 1.16+)\r\n- **Protocol Buffers compiler (`protoc`)**\r\n- Go plugins for Protocol Buffers:\r\n  - `go install google.golang.org/protobuf/cmd/protoc-gen-go@latest`\r\n  - `go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest`\r\n\r\n---\r\n\r\n## Installation\r\n\r\n1. Clone the repository:\r\n   ```bash\r\n   git clone \u003crepository-url\u003e\r\n   cd issue-tracker-service\r\n   ```\r\n\r\n2. Install dependencies:\r\n   ```bash\r\n   go mod tidy\r\n   ```\r\n\r\n---\r\n\r\n## Building the Application\r\n\r\nUsing the Makefile:\r\n```bash\r\nmake build\r\n```\r\n\r\nOr directly with Go:\r\n```bash\r\ngo build -o bin/server cmd/main.go\r\n```\r\n\r\n---\r\n\r\n## Running the Application\r\n\r\nUsing the Makefile:\r\n```bash\r\nmake run\r\n```\r\n\r\nOr directly:\r\n```bash\r\n./bin/server\r\n```\r\n\r\nBy default, the server will run on the following ports:\r\n- **gRPC Server**: `50052`\r\n- **HTTP/REST Gateway**: `8080`\r\n\r\n---\r\n\r\n## Project Structure\r\n\r\n```\r\nissue-tracker-service/\r\n├── cmd/\r\n│   └── main.go         # Server entry point\r\n├── pkg/\r\n│   ├── pb/             # Generated Protocol Buffer files\r\n│   │   ├── user/       # User service (v1, v2)\r\n│   │   ├── project/    # Project service\r\n│   │   └── issues/     # Issues service\r\n│   ├── svc/            # Service implementations\r\n│   │   ├── usersvc/    # User service implementation\r\n│   │   ├── projectsvc/ # Project service implementation\r\n│   │   └── issuessvc/  # Issues service implementation\r\n│   ├── seed/           # Seeding functionality for test data\r\n│   └── consts/         # Common constants and errors\r\n├── models/             # Database models for PostgreSQL\r\n├── database/           # PostgreSQL database initialization and connections\r\n├── proto/              # Protocol Buffer definitions and validation\r\n├── google/             # Google API protobuf definitions\r\n├── logger/             # Custom logging utilities\r\n└── mocks/              # Mock implementations for testing\r\n```\r\n\r\n---\r\n\r\n## Integration with HashiCorp MemDB\r\n\r\n### Why MemDB?\r\nHashiCorp MemDB is used as the in-memory storage backend because it offers:\r\n- **Schema-based Design**:\r\n  - Define structured tables for projects, issues, and users.\r\n- **Transactional Support**:\r\n  - Ensure consistent reads and writes.\r\n- **High Performance**:\r\n  - Optimized for transient and lightweight data workloads.\r\n  \r\n### MemDB Schema\r\nThe project leverages MemDB tables such as:\r\n- `Users`: Stores user profiles with unique IDs and relevant attributes.\r\n- `Projects`: Tracks development projects with associated metadata.\r\n- `Issues`: Manages issues tied to projects and optionally assigns users.\r\n\r\n---\r\n\r\n## Generating Protocol Buffer Files\r\n\r\nUsing the Makefile:\r\n```bash\r\nmake proto\r\n```\r\n\r\nOr manually:\r\n```bash\r\nprotoc --go_out=. --go_opt=paths=source_relative \\\r\n       --go-grpc_out=. --go-grpc_opt=paths=source_relative \\\r\n       proto/user/v1/user.proto proto/project/v1/project.proto proto/issue/v1/issue.proto\r\n```\r\n\r\n---\r\n\r\n## API Documentation (gRPC Overview)\r\n\r\n### User Service\r\n\r\n- `CreateUser`: Creates a new user with name and email.\r\n- `ListUsers`: Retrieves all users.\r\n- `GetUser`: Fetches user details by ID.\r\n- Other CRUD operations for user management.\r\n\r\n### Project Service\r\n\r\n- `CreateProject`: Creates a new project with name and description.\r\n- `ListProjects`: Retrieves all projects.\r\n- `StreamProjectUpdates`: Provides real-time updates on project changes.\r\n- Other CRUD operations for project management.\r\n\r\n### Issue Service\r\n\r\n- `CreateIssue`: Creates a new issue associated with a project.\r\n- `ListIssues`: Retrieves all issues by project ID or other filters.\r\n- Other CRUD operations for issue tracking.\r\n\r\n---\r\n\r\n## Seeding Test Data\r\n\r\nDuring non-production environments, the application supports automatic data seeding for testing purposes:\r\n- **User Seeding**:\r\n  - Controlled via the `SEED_USER_COUNT` environment variable (default is 5 users).\r\n- **Project Seeding**:\r\n  - Controlled via the `SEED_PROJECT_COUNT` environment variable (default is 5 projects).\r\n- **Relationships** (_Optional_):\r\n  - Automatically assigns users to projects and creates example issues.\r\n\r\nTo enable relationship seeding, set:\r\n```bash\r\nSEED_RELATIONSHIPS=true\r\n```\r\n\r\n---\r\n\r\n## Using with a gRPC Client\r\n\r\nYou can interact with the service using any gRPC client. Here are some options:\r\n\r\n### Tools\r\n1. Command line tools like [grpcurl](https://github.com/fullstorydev/grpcurl).\r\n2. GUI tools like [Postman](https://www.postman.com/) or [BloomRPC](https://github.com/uw-labs/bloomrpc).\r\n\r\n### Example Interaction via `grpcurl`\r\n```bash\r\ngrpcurl -d '{\"name\": \"Test User\", \"email\": \"test@example.com\"}' \\\r\n        -plaintext localhost:50051 userpb.UserService.CreateUser\r\n```\r\n\r\n---\r\n\r\n## Configuration Options\r\n\r\nThe application can be customized via environment variables:\r\n\r\n| Variable               | Description                                                              | Default Value      |\r\n|------------------------|--------------------------------------------------------------------------|--------------------|\r\n| `GRPC_PORT`            | Port for the gRPC server                                                | `50052`            |\r\n| `HTTP_PORT`            | Port for the REST gateway                                               | `8080`             |\r\n| `ENVIRONMENT`          | Application environment (`production`, `development`)                  | `development`      |\r\n| `DB_TYPE`              | Database type (`postgres`, `memdb`)                                     | `memdb`            |\r\n| `POSTGRES_HOST`        | PostgreSQL host                                                         | `localhost`        |\r\n| `POSTGRES_PORT`        | PostgreSQL port                                                         | `5432`             |\r\n| `POSTGRES_USER`        | PostgreSQL username                                                     | `postgres`         |\r\n| `POSTGRES_PASSWORD`    | PostgreSQL password                                                     | `postgres`         |\r\n| `POSTGRES_DB`          | PostgreSQL database name                                               | `issue_tracker`    |\r\n| `CACHE_TYPE`           | Cache implementation (`memory`, `redis`)                               | `memory`           |\r\n| `REDIS_ADDR`           | Redis address                                                           | `localhost:6379`   |\r\n| `COMMUNICATION_METHOD` | Messaging implementation (`stream`, `kafka`)                           | `stream`           |\r\n| `KAFKA_BROKERS`        | Comma-separated list of Kafka brokers                                  | `localhost:9092`   |\r\n| `KAFKA_TOPIC_PREFIX`   | Prefix for Kafka topics                                                | `issue-tracker`    |\r\n| `SEED_USER_COUNT`      | Number of users to create during seeding                                | `5`                |\r\n| `SEED_PROJECT_COUNT`   | Number of projects to create during seeding                             | `5`                |\r\n| `SEED_RELATIONSHIPS`   | Enable creation of relationships between seeded entities (`true/false`) | `false`            |\r\n\r\n---\r\n\r\n## Running with Docker Compose\r\n\r\nThe easiest way to run the application with all its dependencies is using Docker Compose:\r\n\r\n```bash\r\ndocker-compose up -d\r\n```\r\n\r\nThis will start:\r\n- The Issue Tracker service\r\n- PostgreSQL database\r\n- Redis cache\r\n- Kafka and Zookeeper for messaging\r\n- Kafdrop for Kafka monitoring\r\n\r\nAccess the services at:\r\n- **gRPC Server**: `localhost:50052`\r\n- **HTTP/REST Gateway**: `localhost:8080`\r\n- **Kafdrop (Kafka UI)**: `localhost:9000`\r\n\r\n---\r\n\r\n## Testing\r\n\r\n### Running Unit Tests\r\nRun unit tests for repositories and services with verbose output:\r\n```bash\r\ngo test -v ./...\r\n```\r\n\r\nFor focused testing of specific packages:\r\n```bash\r\ngo test -v ./pkg/svc/usersvc\r\ngo test -v ./pkg/svc/projectsvc\r\ngo test -v ./pkg/svc/issuessvc\r\n```\r\n\r\n### Test Coverage\r\nGenerate test coverage reports to identify untested code:\r\n```bash\r\ngo test -cover ./...\r\n# For detailed HTML coverage report\r\ngo test -coverprofile=coverage.out ./...\r\ngo tool cover -html=coverage.out\r\n```\r\n\r\n### Integration Tests\r\nEnd-to-end tests for gRPC services with MemDB and Redis interactions:\r\n```bash\r\ngo test -tags=integration ./tests/\r\n```\r\n\r\n### Mock Data Testing\r\nTest the application with automatically seeded data:\r\n```bash\r\n# Basic seeding\r\nENVIRONMENT=development go run ./cmd\r\n\r\n# Custom seeding configuration\r\nENVIRONMENT=development SEED_USER_COUNT=10 SEED_PROJECT_COUNT=10 SEED_RELATIONSHIPS=true go run ./cmd\r\n```\r\n\r\n### Redis Integration Testing\r\nTo test Redis-specific functionality:\r\n```bash\r\n# Start Redis if not running\r\ndocker run -d --name redis-test -p 6379:6379 redis:alpine\r\n\r\n# Run tests with Redis connection\r\nREDIS_ENABLED=true REDIS_URL=localhost:6379 go test -v ./pkg/svc/...\r\n```\r\n\r\n---\r\n\r\n## Future Improvements\r\n\r\n1. **Enhanced Redis Integration**:\r\n   - Implement full Redis caching layer for frequently accessed entities\r\n   - Add Redis Pub/Sub for real-time notifications across multiple instances\r\n\r\n2. **WebSocket Support**:\r\n   - Extend `StreamProjectUpdates` to use WebSockets for real-time data updates\r\n   - Implement browser-compatible event streaming\r\n\r\n3. **Advanced Metrics \u0026 Monitoring**:\r\n   - Integrate Prometheus metrics for service performance tracking\r\n   - Add Grafana dashboards for visualizing MemDB and Redis performance\r\n\r\n4. **Scalability Enhancements**:\r\n   - Implement sharding strategies for MemDB with Redis coordination\r\n   - Add distributed tracing with OpenTelemetry\r\n   - Scale Kafka consumers for higher throughput\r\n\r\n5. **Developer Experience**:\r\n   - Create interactive API documentation with Swagger UI\r\n   - Add CLI tools for common administrative tasks\r\n\r\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasindce1998%2Fissue-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyasindce1998%2Fissue-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasindce1998%2Fissue-tracker/lists"}