{"id":50459668,"url":"https://github.com/phaylali/omniversify-flags-search-engine","last_synced_at":"2026-06-01T04:02:44.594Z","repository":{"id":347694206,"uuid":"1194861172","full_name":"phaylali/omniversify-flags-search-engine","owner":"phaylali","description":"An interactive web application that lets you explore country flags by their colors. Select colors to instantly find matching flags and see countries highlighted on a world map.","archived":false,"fork":false,"pushed_at":"2026-04-05T07:13:53.000Z","size":2297,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-05T09:12:37.313Z","etag":null,"topics":["astro","bun"],"latest_commit_sha":null,"homepage":"https://flags-search-engine.omniversify.com","language":"TypeScript","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/phaylali.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-28T22:53:16.000Z","updated_at":"2026-04-05T07:13:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/phaylali/omniversify-flags-search-engine","commit_stats":null,"previous_names":["phaylali/omniversify-flags-search-engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phaylali/omniversify-flags-search-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaylali%2Fomniversify-flags-search-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaylali%2Fomniversify-flags-search-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaylali%2Fomniversify-flags-search-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaylali%2Fomniversify-flags-search-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phaylali","download_url":"https://codeload.github.com/phaylali/omniversify-flags-search-engine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaylali%2Fomniversify-flags-search-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33759180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"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":["astro","bun"],"created_at":"2026-06-01T04:02:44.540Z","updated_at":"2026-06-01T04:02:44.587Z","avatar_url":"https://github.com/phaylali.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flag Color Explorer\n\nAn interactive web application that lets you explore country flags by their colors. Select colors to instantly find matching flags and see countries highlighted on a world map.\n\n## Features\n\n- **Color-based flag search** - Click colors to find flags containing them\n- **\"Any\" button** - Show all 196 flags at once\n- **AND logic filtering** - Find flags containing ALL selected colors\n- **Color chips** - Each flag displays its colors as stadium-shaped chips with hex codes\n- **Flag preview modal** - Click any flag to see it full-screen with colors\n- **Interactive SVG map** - Countries highlight in gold when their flags match your selection\n- **Zoom \u0026 Pan** - Mouse wheel to zoom, drag to pan, reset button included\n- **Local flag SVGs** - 196 country flags stored locally (no CDN dependency)\n- **REST API** - Access country data programmatically via JSON endpoints\n- **Tailwind CSS v4.2** - Modern utility-first styling throughout the app\n- **Dark theme** - Easy on the eyes\n\n## Countries Included\n\n- **196 countries** - All UN member states + Vatican City, Palestine, Taiwan\n- **Israel excluded** - Permanently removed from data and scripts\n\n## Getting Started\n\n### Prerequisites\n\n- [Bun](https://bun.sh/) (required)\n\n---\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone \u003cyour-repo-url\u003e\ncd FlagsSearchEngine\n\n# Install dependencies\nbun install\n\n# Start development server\nbun run dev\n```\n\nThe app will be available at `http://localhost:4321`\n\n### Build for Production\n\n```bash\nbun run build\nbun run preview\n```\n\n### Deploy to Cloudflare Pages\n\n```bash\nbun run deploy\n```\n\n## Project Structure\n\n```\n├── public/\n│   ├── flags.json          # 196 countries with extracted colors + svgUrl\n│   ├── flags-svgs/         # Local SVG flags (196 files)\n│   │   ├── us.svg\n│   │   ├── fr.svg\n│   │   └── ...\n│   └── world.geojson       # World map GeoJSON data\n├── scripts/\n│   ├── download-flags.sh   # Download flags from GitHub\n│   ├── filter-svgs.sh      # Filter to 196 countries (excludes Israel)\n│   ├── extract-svg-colors.ts  # Extract colors from SVGs\n│   ├── filter-countries.ts    # Filter to official countries\n│   ├── normalize-colors.ts    # Normalize similar colors (manual rules)\n│   └── merge-geojson.ts       # Generate custom world map\n└── src/\n    ├── layouts/\n    │   └── Layout.astro    # Base HTML layout with Tailwind\n    ├── pages/\n    │   ├── index.astro     # Main application (UI + API routes)\n    │   └── api/\n    │       └── [country]/\n    │           ├── index.ts    # GET /api/:country\n    │           ├── colors.ts   # GET /api/:country/colors\n    │           └── svgUrl.ts   # GET /api/:country/svgUrl\n    └── styles/\n        └── global.css      # Tailwind v4.2 entry point\n```\n\n## Scripts\n\n| Command                    | Description                    |\n| -------------------------- | ------------------------------ |\n| `bun run dev`              | Start development server       |\n| `bun run build`            | Build for production           |\n| `bun run preview`          | Preview production build       |\n| `bun run deploy`           | Deploy to Cloudflare Pages     |\n| `bun run download-flags`   | Download flag SVGs from GitHub |\n| `bun run filter-svgs`      | Keep only 196 country SVGs     |\n| `bun run extract-colors`   | Extract colors from SVGs       |\n| `bun run filter-countries` | Filter JSON to countries only  |\n| `bun run normalize-colors` | Normalize similar colors       |\n\n## API Endpoints\n\nThe application provides a REST API built with Astro's native API routes to access country data:\n\n| Endpoint | Description |\n| --- | --- |\n| `GET /api/:country` | Returns full country data (name, code, colors, tabler, colorGroups, svgUrl) |\n| `GET /api/:country/colors` | Returns just the colors array |\n| `GET /api/:country/svgUrl` | Returns just the SVG URL for the flag |\n\n### Examples\n\n```\n# Get full data for Argentina\nGET https://your-site.com/api/argentina\nResponse: {\"name\":\"Argentina\",\"code\":\"ar\",\"colors\":[\"#74ACDF\",\"#FFFFFF\",\"#F6B40E\"],\"tabler\":\"argentina\",\"colorGroups\":{\"red\":false,\"blue\":true,...},\"svgUrl\":\"/flags-svgs/ar.svg\"}\n\n# Get just colors for Argentina\nGET https://your-site.com/api/argentina/colors\nResponse: [\"#74ACDF\",\"#FFFFFF\",\"#F6B40E\"]\n\n# Get just the SVG URL for Argentina\nGET https://your-site.com/api/argentina/svgUrl\nResponse: {\"svgUrl\":\"/flags-svgs/ar.svg\"}\n```\n\nCountry names can be provided in various formats:\n- ISO country code: `ar`, `us`, `fr`\n- Full name: `argentina`, `united-states`, `france`\n- Name without spaces: `argentina`, `unitedstates`, `france`\n\nIf a country is not found, the API returns a 404 error with `{\"error\":\"Country not found\"}`.\n\n## Color Normalization\n\nColors extracted from SVGs may include similar shades (due to anti-aliasing). Edit `scripts/normalize-colors.ts` to add manual rules:\n\n```typescript\nconst COLOR_RULES: [string, string][] = [\n  [\"#000001\", \"#000000\"], // near-black -\u003e black\n  // Add your rules here:\n  // [\"#INFERIOR\", \"#SUPERIOR\"],\n];\n```\n\nThen run:\n\n```bash\nbun run normalize-colors\n```\n\nYou can also manually edit `public/flags.json` to fix specific flags.\n\n## Flag Preview\n\nClick any flag card to open a full-screen preview modal:\n- Large flag image\n- Country name\n- Color chips showing all flag colors with hex codes\n- Close via X button, backdrop click, or Escape key\n\n## Tech Stack\n\n- [Astro](https://astro.build/) - Static site generator with API routes\n- [Bun](https://bun.sh/) - JavaScript runtime\n- [Tailwind CSS v4.2](https://tailwindcss.com/) - Utility-first CSS framework for all styling\n- [Turf.js](https://turfjs.org/) - Geospatial operations (build scripts only, not runtime)\n- Custom SVG rendering - Lightweight map without heavy dependencies\n- [Cloudflare Pages](https://pages.cloudflare.com/) - Deployment\n\n## Data Sources\n\n- **Flags**: [flag-icons](https://github.com/lipis/flag-icons) by Lipis\n- **Map**: Based on Natural Earth vector data, merged with Turf.js\n- **Colors**: Extracted directly from SVG files\n\n## License\n\nMIT License - See LICENSE file for details\n\n---\n\n\u0026copy; 2026 [Omniversify](https://omniversify.com). All rights reserved.\n\n_Made by Moroccans, for the Omniverse_\n\n[![ReadMeSupportPalestine](https://raw.githubusercontent.com/Safouene1/support-palestine-banner/master/banner-project.svg)](https://donate.unrwa.org/-landing-page/en_EN)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaylali%2Fomniversify-flags-search-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphaylali%2Fomniversify-flags-search-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaylali%2Fomniversify-flags-search-engine/lists"}