This React application fetches IP and geolocation data and displays it to the user along with a map. The backend is built with Node.js and is available at this repo. Follow the instructions to start the server.
To get a copy of this project up and running on your local machine, follow these steps:
- Clone the repository:
git clone https://github.com/gtcore902/myIP-frontend.git
- Install dependencies:
npm install or yarn
- Start the development server:
npm start or yarn start
-
Don't forget to install this repo and launch the backend server.
-
Open http://localhost:3000 in your browser.
- Displays IP address, city, country, latitude, longitude, and region information.
- Shows a map based on the latitude and longitude information.
- Utilizes React hooks for state management.
- Fetches data from various APIs including geolocation, IP lookup.
- React - A JavaScript library for building user interfaces.
- SCSS - CSS preprocessor.
- NodeJS - JavaScript runtime platform.
- ipinfo.io - Geolocation API for fetching location data based on IP address.
- OpenStreetMap - Collaborative, open-source mapping platform created by a global community of volunteers.
- React Leaflet - React components for Leaflet maps
- Backend with NodeJS - Returns an object with the ip address
You're welcome 😎
If you wish to use or contribute to the project, follow these steps:point_down::
- Fork the project
- Replace in IP_INFO_API_KEY_EXAMPLE.js file the key with you own key:
const IP_INFO_API_KEY = 'YOUR_IP_INFO_API_KEY'
>export default IP_INFO_API_KEY
- Rename IP_INFO_API_KEY_EXAMPLE.js in IP_INFO_API_KEY.js
- Create a feature branch
git checkout -b feature/NewFeature
- Commit your changes
git commit -m 'Add NewFeature'
- Push the branch
git push origin feature/AmazingFeature
- Open a pull Request