{"id":26027531,"url":"https://github.com/freshman829/feature-flag-service","last_synced_at":"2025-03-06T16:22:33.392Z","repository":{"id":280634542,"uuid":"942326792","full_name":"freshman829/Feature-Flag-Service","owner":"freshman829","description":"A lightweight and efficient Feature Flag Service built with Golang, Gin, PostgreSQL, Redis, and Swagger API Documentation.","archived":false,"fork":false,"pushed_at":"2025-03-04T14:09:57.000Z","size":64780,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T12:19:31.746Z","etag":null,"topics":["cicd","deployment","docker","dockerfile","feature-flags","gin","golang","postgresql","railway","redis","swagger","swaggerui","unit-testing"],"latest_commit_sha":null,"homepage":"https://feature-flag-service-production.up.railway.app/swagger/index.html","language":"Go","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/freshman829.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2025-03-03T23:52:51.000Z","updated_at":"2025-03-04T14:12:51.000Z","dependencies_parsed_at":"2025-03-05T12:19:35.178Z","dependency_job_id":null,"html_url":"https://github.com/freshman829/Feature-Flag-Service","commit_stats":null,"previous_names":["sirius829/feature-flag-service","freshman829/feature-flag-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freshman829%2FFeature-Flag-Service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freshman829%2FFeature-Flag-Service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freshman829%2FFeature-Flag-Service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freshman829%2FFeature-Flag-Service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freshman829","download_url":"https://codeload.github.com/freshman829/Feature-Flag-Service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242241994,"owners_count":20095473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cicd","deployment","docker","dockerfile","feature-flags","gin","golang","postgresql","railway","redis","swagger","swaggerui","unit-testing"],"created_at":"2025-03-06T16:22:32.507Z","updated_at":"2025-03-06T16:22:33.376Z","avatar_url":"https://github.com/freshman829.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Feature Flag Service\n\nA lightweight and efficient **Feature Flag Service** built with **Golang, Gin, PostgreSQL, Redis, and Swagger API Documentation**. This service allows teams to manage and toggle feature flags dynamically for better **continuous deployment** and **A/B testing** strategies.\n\n## 🌟 Features\n- ✅ **JWT Authentication** (User Registration \u0026 Login)\n- ✅ **Feature Flag Management** (Create, Read, Update, Delete)\n- ✅ **PostgreSQL Database Integration**\n- ✅ **Redis for Caching**\n- ✅ **Swagger API Documentation**\n- ✅ **Dockerized for Easy Deployment**\n- ✅ **Mocked Database for CI/CD Testing**\n\n---\n\n## 🌍 Live Preview\n- **API Base URL:** [https://feature-flag-service-production.up.railway.app/api](https://feature-flag-service-production.up.railway.app/api)\n- **Swagger Documentation:** [https://feature-flag-service-production.up.railway.app/swagger/index.html](https://feature-flag-service-production.up.railway.app/swagger/index.html)\n\n---\n\n## 📂 Project Structure\n```\nfeature-flag-service/\n│-- internal/\n│   │-- config/          # Database \u0026 Redis Configuration\n│   │-- handlers/        # API Route Handlers\n│   │-- middleware/      # Authentication Middleware\n│   │-- models/         # Database Models\n│   │-- tests/          # Unit \u0026 Integration Tests\n│-- docs/               # Swagger Documentation\n│-- main.go             # Entry Point\n│-- Dockerfile          # Docker Build Config\n│-- docker-compose.yml  # Docker Compose Services\n│-- README.md           # Project Documentation\n```\n\n---\n\n## 🔧 Setup \u0026 Installation\n### **1️⃣ Clone the Repository**\n```sh\ngit clone https://github.com/your-username/feature-flag-service.git\ncd feature-flag-service\n```\n\n### **2️⃣ Set Up Environment Variables**\nCreate a **.env** file in the root directory:\n```sh\nPORT=8080\nDATABASE_URL=postgres://postgres:password@postgres:5432/feature_flags?sslmode=disable\nREDIS_URL=redis:6379\nJWT_SECRET=your_secret_key\n```\n\n### **3️⃣ Run the Application Locally**\n#### **With Docker (Recommended)**\n```sh\ndocker-compose up --build\n```\n\n#### **Without Docker**\nEnsure PostgreSQL and Redis are running, then:\n```sh\ngo mod tidy\ngo run main.go\n```\n\n---\n\n## 📌 API Endpoints\n### **🔑 Authentication**\n| Method | Endpoint       | Description           |\n|--------|--------------|----------------------|\n| POST   | `/register`  | Register a new user  |\n| POST   | `/login`     | Authenticate \u0026 get JWT |\n\n### **🚀 Feature Flags**\n| Method | Endpoint           | Description                     |\n|--------|------------------|--------------------------------|\n| POST   | `/api/flags`      | Create a new feature flag      |\n| GET    | `/api/flags`      | Get all feature flags          |\n| GET    | `/api/flags/{id}` | Get a single feature flag by ID |\n| PUT    | `/api/flags/{id}` | Update a feature flag          |\n| DELETE | `/api/flags/{id}` | Delete a feature flag          |\n\n**📖 Swagger Documentation**\n- Once the service is running, access Swagger UI:\n  👉 [http://localhost:8080/swagger/index.html](http://localhost:8080/swagger/index.html)\n\n---\n\n## ✅ Running Tests\nTo run tests **with database mocking**:\n```sh\nTEST_MODE=true go test ./internal/tests -v\n```\n\nFor **full integration tests**:\n```sh\ngo test ./...\n```\n\n---\n\n## 📦 Deployment\n### **🚀 Deploy with Railway**\n1. Install Railway CLI:\n   ```sh\n   curl -fsSL https://railway.app/install.sh | sh\n   ```\n2. Initialize project:\n   ```sh\n   railway init\n   ```\n3. Deploy:\n   ```sh\n   railway up\n   ```\n\n---\n\n## 🤝 Contributing\nWe welcome contributions! Feel free to **open an issue** or **submit a pull request**.\n\n---\n\n## 🛡️ License\nThis project is **MIT Licensed**. See `LICENSE` for details.\n\n---\n\n## 🌟 Acknowledgments\n- **Golang \u0026 Gin** for backend development\n- **Swagger** for API Documentation\n- **PostgreSQL \u0026 Redis** for database management\n- **Railway \u0026 Docker** for seamless deployment\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreshman829%2Ffeature-flag-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreshman829%2Ffeature-flag-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreshman829%2Ffeature-flag-service/lists"}