By the end of this guide you will have a fully functional local instance of Country-Click running in your browser, with the interactive SVG world map responding to clicks and the search bar returning live country data. All you need is PHP, Node.js, and an internet connection — there is no database to configure, no environment variables to set, and no build step required unless you plan to modify styles.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/Countries-WebPage/llms.txt
Use this file to discover all available pages before exploring further.
Clone the repository
Clone the Country-Click repository from GitHub and move into the project directory:
Install dependencies
The only development dependency is Tailwind CSS v3. Install it with npm:The compiled stylesheet (
src/output.css) is already committed to the repository, so this step is only necessary if you plan to modify styles. If you are just running the app as-is, you can skip straight to starting the PHP server.Build CSS (optional)
If you have modified any PHP templates, HTML, or JavaScript files and want Tailwind to pick up new utility classes, run the build watcher. It monitors all files matching Remove
src/**/*.{html,js,php} — the same content paths defined in tailwind.config.js — and writes the compiled output to src/output.css:--watch for a one-time build instead of a continuous watcher. Leave this terminal session open while developing so your style changes are picked up automatically.Start the PHP built-in server
Move into the Open http://localhost:8000 in your browser. You should see the Country-Click navbar and the interactive SVG world map.
src/ directory — this is the document root — and start PHP’s built-in web server:Try It
Once the server is running, explore the app with these two interaction modes: Click the map — click any country on the SVG world map. Try France, Brazil, or Japan. The JavaScript listener captures thexlink:title of the SVG path, submits a hidden POST form, and the PHP backend fetches and renders that country’s data panel instantly.
Use the search bar — type a country name in English into the search field in the top navigation bar and press the Buscar button. For example, type Spain and press Buscar to see Spain’s flag, capital Madrid, population, official languages, timezone, and region.
Country-Click requires an active internet connection at all times. Country data is fetched live on every request from
https://restcountries.com/v3.1/ — nothing is stored locally or cached between sessions.