{"id":28759298,"url":"https://github.com/siruscodes/country-explorer","last_synced_at":"2026-01-20T16:27:43.360Z","repository":{"id":299365095,"uuid":"1001848832","full_name":"SirusCodes/country-explorer","owner":"SirusCodes","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-16T09:19:45.000Z","size":224,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-03T20:55:46.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://country-explorer-dun.vercel.app","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/SirusCodes.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}},"created_at":"2025-06-14T06:50:01.000Z","updated_at":"2025-06-16T09:19:49.000Z","dependencies_parsed_at":"2025-06-16T07:23:37.927Z","dependency_job_id":"f0eba2c3-7408-467c-9fce-0b00cf24a9ad","html_url":"https://github.com/SirusCodes/country-explorer","commit_stats":null,"previous_names":["siruscodes/country-explorer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SirusCodes/country-explorer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirusCodes%2Fcountry-explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirusCodes%2Fcountry-explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirusCodes%2Fcountry-explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirusCodes%2Fcountry-explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SirusCodes","download_url":"https://codeload.github.com/SirusCodes/country-explorer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SirusCodes%2Fcountry-explorer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"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":[],"created_at":"2025-06-17T05:06:22.602Z","updated_at":"2026-01-20T16:27:43.339Z","avatar_url":"https://github.com/SirusCodes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Country Explorer\n\nA Next.js app to explore countries, view details, and manage favorites with authentication.\n\n---\n\n## Setup \u0026 Run Instructions\n\n1. **Clone the repository:**\n   ```sh\n   git clone \u003crepo-url\u003e\n   cd country-explorer\n   ```\n2. **Install dependencies:**\n   ```sh\n   yarn install\n   ```\n3. **Run the development server:**\n   ```sh\n   yarn dev\n   ```\n   The app will be available at [http://localhost:9002](http://localhost:9002).\n\n---\n\n## Credentials for Mock Login\n\n- **Username:** `user`\n- **Password:** `password`\n\n---\n\n## Design Choices, Assumptions, and SSG/SSR Explanation\n\n- **Authentication:**\n\n  - Simple cookie-based mock authentication is used. The `countryExplorerAuth` cookie is set on login and checked in middleware for protected routes.\n  - Middleware (`src/middleware.ts`) restricts access to authenticated users except for public paths (login, home, API routes, etc).\n\n- **Routing \u0026 Data Fetching:**\n\n  - **Country list and details** use **Incremental Static Regeneration (ISR)** for fast load times and SEO. Country data is fetched once and a static page is generated which is cached with validity for a day.\n  - **Favorites** and user-specific data use **Client-Side Rendering (CSR)**, as they depend on the authenticated user does not requires SEO and already pretty light weight.\n  - **Login/logout** handled via API routes (`/api/login`, `/api/logout`).\n\n- **UI/UX:**\n\n  - Built with React and Tailwind CSS for a modern, responsive interface.\n  - Components are modular and reusable.\n\n- **Assumptions:**\n  - No real backend; authentication and data are mocked for demo purposes.\n  - All users share the same country data; favorites are stored in client state only.\n\n---\n\n## State Management Solution\n\n**React Context API** is used for global state management:\n\nThis approach is lightweight and sufficient for the app's needs, avoiding the complexity of external libraries like Redux/Zustand.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiruscodes%2Fcountry-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiruscodes%2Fcountry-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiruscodes%2Fcountry-explorer/lists"}