This is a solution to the REST Countries API with color theme switcher challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
š Live Demo: https://country-api-eight-wheat.vercel.app
Your challenge is to integrate with the REST Countries API to pull country data and display it like in the designs.
Users should be able to:
| Desktop Preview | Mobile Preview |
|---|---|
(Note: Add your actual screenshots if available)
The project follows a simplified Clean Architecture pattern to ensure maintainability, testability, and scalability:
src/
āāā core/ # Core Domain (SSOT)
ā āāā domain/ # Types, Schemas (Zod) and Centralized Errors
ā āāā interfaces/ # Ports (Repository definitions)
ā āāā use-cases/ # Unified Business Logic (e.g. GetCountries)
āāā infrastructure/ # Data Adapters
ā āāā cache/ # In-memory optimization
ā āāā http/ # Core fetch with Retry & Timeout logic
ā āāā repositories/ # Concrete API implementations
āāā presentation/ # Presentation Layer
ā āāā components/ # Vue components
ā āāā composables/ # Generic reactive hooks (useAsync)
āāā actions/ # Astro Actions (Bridges)
āāā pages/ # Astro Routes (SSR Entry points)
āāā layouts/ # Base layouts
src/core/domain.pnpm dev # Run development server
pnpm build # Build for production (Vercel/Node)
pnpm test # Run unit tests (Vitest)
pnpm e2e # Run E2E tests (Playwright)
It was fun to build it! š If you like the code, feel free to follow me. š