{"id":28496313,"url":"https://github.com/lhsanghcmus/local-tools","last_synced_at":"2026-01-16T15:41:41.397Z","repository":{"id":296889970,"uuid":"994610345","full_name":"lhsanghcmus/local-tools","owner":"lhsanghcmus","description":"Local development toolkit featuring preconfigured containers for essential services: MongoDB, Kafka, PostgreSQL, Temporal, Redis, and Elasticsearch. Ideal for microservices and distributed system testing.","archived":false,"fork":false,"pushed_at":"2026-01-15T06:21:55.000Z","size":47,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-15T12:46:58.378Z","etag":null,"topics":["docker","docker-compose","elasticsearch","kafka","kibana","localhost","mongodb","postgres","redis","temporal"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lhsanghcmus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-02T07:52:41.000Z","updated_at":"2026-01-15T06:21:55.000Z","dependencies_parsed_at":"2025-06-08T01:02:02.322Z","dependency_job_id":null,"html_url":"https://github.com/lhsanghcmus/local-tools","commit_stats":null,"previous_names":["lhsanghcmus/local-tools"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lhsanghcmus/local-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsanghcmus%2Flocal-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsanghcmus%2Flocal-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsanghcmus%2Flocal-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsanghcmus%2Flocal-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lhsanghcmus","download_url":"https://codeload.github.com/lhsanghcmus/local-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhsanghcmus%2Flocal-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","docker-compose","elasticsearch","kafka","kibana","localhost","mongodb","postgres","redis","temporal"],"created_at":"2025-06-08T12:07:18.089Z","updated_at":"2026-01-16T15:41:41.389Z","avatar_url":"https://github.com/lhsanghcmus.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# local-tools\n\nA Docker Compose-based local development environment that provides essential data storage and messaging services for development and testing purposes.\n\n## 📋 Release Notes \u0026 Changelog\n\nFor detailed information about changes, new features, and version history, see [CHANGELOG.md](CHANGELOG.md).\n\n**Latest Version: v1.0.3** - Container upgrades, MongoDB configuration improvements, and enhanced documentation\n\n## Description\n\nThis project sets up a comprehensive local development stack with the following services:\n\n### 📊 Database Services\n- **MongoDB Replica Set**: A 3-node MongoDB cluster (Primary, Secondary, Arbiter) with authentication and keyfile security\n- **Redis**: In-memory data structure store with persistence and password protection\n- **PostgreSQL**: PostgreSQL database with Temporal workflow database setup\n\n### 📨 Messaging Services\n- **Apache Kafka Cluster**: A 3-broker Kafka cluster using KRaft mode (without Zookeeper)\n- **Kafka UI**: Web-based interface for managing and monitoring Kafka topics, consumers, and producers (no password required)\n\n### 🔍 Search \u0026 Analytics Services\n- **Elasticsearch**: Distributed search and analytics engine with security enabled\n- **Kibana**: Web-based interface for Elasticsearch data visualization and analysis\n\n### 🔄 Workflow Services\n- **Temporal Server**: Distributed workflow orchestration platform for reliable microservices\n- **Temporal UI**: Web-based interface for monitoring and managing Temporal workflows\n\n## Services \u0026 Ports\n\n| Service | Port | Description |\n|---------|------|-------------|\n| MongoDB Primary | 30000 | Main MongoDB instance |\n| MongoDB Secondary | 30001 | Secondary MongoDB replica |\n| MongoDB Arbiter | 30002 | MongoDB arbiter node |\n| Redis | 6379 | Redis server |\n| PostgreSQL | 5432 | PostgreSQL database server |\n| Temporal Server | 7233 | Temporal gRPC endpoint |\n| Temporal UI | 8090 | Web interface for Temporal workflows (no login required) |\n| Kafka Broker 0 | 9992 | First Kafka broker |\n| Kafka Broker 1 | 9993 | Second Kafka broker |\n| Kafka Broker 2 | 9994 | Third Kafka broker |\n| Kafka UI | 8080 | Web interface for Kafka management (no login required) |\n| Elasticsearch | 9200 | Elasticsearch REST API |\n| Kibana | 5601 | Web interface for Elasticsearch visualization |\n\n## Quick Start\n\n### Prerequisites\n- Docker and Docker Compose installed\n- Environment variables for database authentication\n\n### Update /etc/hosts for MongoDB Cluster\nTo allow the MongoDB replica set to work properly, you need to add the following entries to your `/etc/hosts` file:\n\n```bash\n# Add these lines to /etc/hosts\n127.0.0.1 mongodb-primary\n127.0.0.1 mongodb-secondary\n127.0.0.1 mongodb-arbiter\n```\n\nOn macOS/Linux, you can run:\n```bash\nsudo sh -c 'echo \"127.0.0.1 mongodb-primary\" \u003e\u003e /etc/hosts'\nsudo sh -c 'echo \"127.0.0.1 mongodb-secondary\" \u003e\u003e /etc/hosts'\nsudo sh -c 'echo \"127.0.0.1 mongodb-arbiter\" \u003e\u003e /etc/hosts'\n```\n\nOn Windows, edit `C:\\Windows\\System32\\drivers\\etc\\hosts` as Administrator and add the same entries.\n\n### Setup Script Permissions\nAfter cloning the repository, make sure the script files have execute permissions:\n```bash\nchmod +x scripts/up.sh\nchmod +x scripts/down.sh\nchmod +x scripts/init-temporal.sh\nchmod +x scripts/create-kibana-user.sh\nchmod 400 scripts/mongosetup/mongo-keyfile\n```\n\n### Setup Environment Variables\nCreate a `.env` file with the following variables:\n```bash\n# MongoDB Configuration\nMONGODB_INITDB_ROOT_USERNAME=your_mongo_username\nMONGODB_INITDB_ROOT_PASSWORD=your_mongo_password\n\n# Redis Configuration\nREDIS_PASSWORD=your_redis_password\n\n# PostgreSQL Configuration\nPOSTGRES_USER=your_postgres_username\nPOSTGRES_PASSWORD=your_postgres_password\nTEMPORAL_PASSWORD=your_temporal_password\n\n# Elasticsearch Configuration\nES_PASSWORD=your_elasticsearch_password\nKIBANA_USER=kibana_system\nKIBANA_PASSWORD=your_kibana_password\n```\n\n### Usage\n```bash\n# Start all services\nmake up\n\n# Stop all services\nmake down\n\n# Alternative: Using docker compose directly\ndocker compose up -d\ndocker compose down -v\n```\n\n## Data Persistence\n\nAll data is persisted in the `./data/` directory:\n- `./data/mongodb_primary/` - MongoDB data\n- `./data/redis/` - Redis data\n- `./data/kafka0/`, `./data/kafka1/`, `./data/kafka2/` - Kafka data\n- `./data/postgresql/` - PostgreSQL data\n- `./data/elasticsearch/` - Elasticsearch data\n\n## Service Details\n\n### MongoDB Replica Set\n- **Primary**: Main read/write instance on port 30000\n- **Secondary**: Replica instance on port 30001  \n- **Arbiter**: Voting member for elections on port 30002\n- **Authentication**: Uses keyfile-based internal authentication\n- **Version**: MongoDB Community Server 8.0.9\n\n### Redis\n- **Version**: Redis 8.0.2 Alpine\n- **Persistence**: RDB snapshots every 20 seconds if at least 1 key changed\n- **Security**: Password protected\n\n### PostgreSQL\n- **Version**: PostgreSQL 17\n- **Features**: Standard PostgreSQL database\n- **Temporal Setup**: Includes Temporal workflow database initialization\n\n### Temporal Server\n- **Version**: Temporalio Auto-setup 1.27.2\n- **Database**: Uses PostgreSQL as persistence layer\n- **Features**: Full workflow orchestration with automatic database setup\n- **Authentication**: Connects to dedicated `temporal` database and `temporal_visibility` database\n- **Security**: No authentication required for client connections\n\n### Temporal UI\n- **Version**: Temporalio UI v2.37.4\n- **Features**: Web-based workflow monitoring, execution history, and task management\n- **CORS**: Configured to allow connections from localhost:3000\n- **Security**: No authentication required for web access\n\n### Kafka Cluster\n- **Version**: Confluent Platform 7.9.1\n- **Mode**: KRaft (no Zookeeper dependency)\n- **Brokers**: 3-node cluster for high availability\n- **UI**: Provectus Kafka UI v0.7.2 for management\n- **Security**: No authentication required for client connections or web UI access\n\n### Elasticsearch\n- **Version**: Elasticsearch 9.0.2\n- **Mode**: Single-node cluster for development\n- **Security**: X-Pack security enabled with password authentication\n- **Features**: Full-text search, analytics, and aggregations\n- **Memory**: Configured with 1GB heap size (ES_JAVA_OPTS)\n\n### Kibana\n- **Version**: Kibana 9.0.2\n- **Authentication**: Uses dedicated `kibana_system` user\n- **Features**: Data visualization, dashboard creation, and Elasticsearch management\n- **Configuration**: Custom configuration via `kibana.yaml`\n\n## Features\n\n- **Production-like Setup**: MongoDB replica set and Kafka cluster mimic production environments\n- **Persistent Storage**: Data survives container restarts with local bind mounts\n- **Security**: MongoDB uses keyfile authentication, Redis and PostgreSQL require passwords\n- **Web UI**: Kafka UI and Temporal UI provide easy management interfaces\n- **Easy Management**: Simple make commands for lifecycle management\n- **Workflow Orchestration**: Full Temporal platform for distributed workflow management\n\n## Use Cases\n\nPerfect for:\n- Local development requiring MongoDB, Redis, PostgreSQL, and Kafka\n- Testing distributed applications and microservices\n- Learning about replica sets and Kafka clusters\n- Prototyping event-driven architectures\n- Integration testing with multiple data stores\n- Temporal workflow development\n- Search and analytics with Elasticsearch and Kibana\n- Log aggregation and visualization\n\n## Connection Examples\n\n### MongoDB\n```bash\n# Connect to primary\nmongosh mongodb://username:password@localhost:30000/admin?replicaSet=rs0\n\n# Connect to secondary (read-only)\nmongosh mongodb://username:password@localhost:30001/admin?replicaSet=rs0\u0026readPreference=secondary\n```\n\n### Redis\n```bash\n# Connect with password\nredis-cli -h localhost -p 6379 -a your_redis_password\n```\n\n### PostgreSQL\n```bash\n# Connect with psql\npsql -h localhost -p 5432 -U your_postgres_username -d postgres\n```\n\n### Temporal\n```bash\n# Use Temporal CLI (if you have it installed) - no authentication required\ntemporal --address localhost:7233 workflow list\n\n# Or access the web UI at http://localhost:8090 (no login required)\n```\n\n### Kafka\n```bash\n# List topics (if you have kafka tools installed) - no authentication required\nkafka-topics --bootstrap-server localhost:9992 --list\n\n# Or use the web UI at http://localhost:8080 (no login required)\n```\n\n### Elasticsearch\n```bash\n# Check cluster health with authentication\ncurl -u elastic:your_elasticsearch_password http://localhost:9200/_cluster/health\n\n# Create an index\ncurl -u elastic:your_elasticsearch_password -X PUT http://localhost:9200/my-index\n\n# Search documents\ncurl -u elastic:your_elasticsearch_password http://localhost:9200/my-index/_search\n\n# Or use Kibana web UI at http://localhost:5601 (login with kibana_system user)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhsanghcmus%2Flocal-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flhsanghcmus%2Flocal-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhsanghcmus%2Flocal-tools/lists"}