The Country Wiki application is a web-based platform that provides users with information about countries. Users can search for countries using a search bar and have the option to search by country code, language, or name.
- Vite: A fast web development build tool that provides a smooth development experience with features like hot module replacement (HMR).
- npm: A package manager for JavaScript that allows you to install and manage project dependencies.
- TypeScript: A typed superset of JavaScript that adds static typing to the language.
- ESLint: A tool for identifying and fixing code style and potential programming errors.
- Bulma: A modern CSS framework based on Flexbox. It is used for styling and creating a responsive and visually appealing user interface.
The application is hosted on Vercel. Vercel provides an easy and scalable platform for hosting web applications.
To run the application locally, follow these steps:
-
Install:
cd frontend npm install
-
Run:
npm run dev
-
Lint:
npm run dev
The Country API is an Express.js-based RESTful API that interacts with the REST Countries API. It provides endpoints to retrieve information about countries, such as all countries, countries by name, country by code, and countries by language.
-
index.js
: Entry point of the application. It initializes the Express app, sets up middleware (CORS, error handling), and defines routes. -
controllers/countriesController.js
: Defines the API routes for fetching country data. Utilizes Axios for making requests to the REST Countries API. -
models/countryModel.js
: Represents the Country model, mapping data received from the REST Countries API to a standardized format. -
middleware/errorMiddleware.js
: Custom middleware for handling errors in the Express app. -
package.json
: Configuration file specifying project details, dependencies, and scripts.
- Endpoint:
/countries/all
- Method:
GET
- Description: Retrieves information about all countries.
- Endpoint:
/countries/name/:name
- Method:
GET
- Description: Retrieves information about countries based on their names.
- Endpoint:
/countries/code/:code
- Method:
GET
- Description: Retrieves detailed information about a country based on its code.
- Endpoint:
/countries/language/:language
- Method:
GET
- Description: Retrieves information about countries based on their primary language.
The application is hosted on Heroku. Heroku offers a scalable and user-friendly platform for hosting web applications.
To run the application locally, follow these steps:
-
Install Dependencies
cd backend npm install
-
Run
npm start || nodemon index.js