This project implements a Country Info App as part of a full-stack JavaScript engineer test assessment. It consists of a backend built with Node.js and a frontend built with React.js. The app provides information about various countries, including their borders, population data, and flags.
Tech Stack:
- Node.js (Express.js or Nest.js)
Endpoints:
-
Get Available Countries
- Description: Fetches a list of available countries.
- API URL: Date Nager API
-
Get Country Info
- Description: Retrieves detailed information about a specific country.
- API URL: Country Info API
- Data Provided:
- List of Border Countries
- Population Data (Historical)
- Flag URL (Country flag image)
Tech Stack:
- React.js
- Next.js (preferred but not mandatory)
Pages:
-
Country List Page
- Displays a list of countries fetched from the backend.
- Each country name is clickable, navigating the user to the Country Info Page.
-
Country Info Page
- Displays:
- Country Name
- Country Flag
- Border Countries (Clickable links to respective Country Info Pages)
- Population Chart showing population over time.
- Displays:
-
Styling:
- Use any CSS framework or custom styles.
- Ensure responsiveness and user-friendly design.
-
Environment Variables:
- Create a
.env
file for sensitive data (API keys, base URLs). - Ensure secure usage of environment variables.
- Add
.env
to the.gitignore
.
- Create a
-
Code Quality:
- Set up ESLint and Prettier for consistent code formatting.
- Ensure all files are linted and formatted before submission.
-
Documentation:
- Include this
README.md
file with instructions to install, run, and test the application.
- Include this
- Country List API: Nager.Date API Documentation
- Country Info API: Postman Country Info API Documentation
-
Project Structure:
- Place the frontend (FE) and backend (BE) code in separate folders within the root directory.
- Avoid using a monorepo structure.
-
Running the Application:
- Ensure both frontend and backend can run simultaneously on different ports.
- The frontend should communicate with the backend without issues.
-
Clone the Repository:
- First, clone the repository to your local machine:
git clone https://github.com/devjuliof/CodeChallenge-DevelopsToday-by-Julio.git cd CodeChallenge-DevelopsToday-by-Julio
- First, clone the repository to your local machine:
-
Install Dependencies:
- Navigate to the backend and frontend directories and install dependencies:
cd backend npm install cd ../frontend npm install
- Navigate to the backend and frontend directories and install dependencies:
-
Start the Backend Server:
- Run the backend server:
cd backend npm start
- Run the backend server:
-
Start the Frontend Server:
- In a new terminal window, run the frontend server using Vite:
cd frontend npm run dev
- In a new terminal window, run the frontend server using Vite:
-
Access the Application:
- Click the first link that
npm run dev
provides.
- Click the first link that
By following these instructions, you will be able to test the application locally and verify that both the frontend and backend are working together seamlessly.