Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Environment variables secret available on server side

# add your ipify api key below
IPIFY_API_KEY=your_secret_api_key_here

# Public Environment variables available on client side
NEXT_PUBLIC_LOCAL_DEVELOPMENT=true
NEXT_PUBLIC_HOSTNAME=localhost
NEXT_PUBLIC_PORT=3000
NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$NEXT_PUBLIC_PORT
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

This project is part of the [Frontend Mentor Challenge - IP address tracker](https://www.frontendmentor.io/challenges/ip-address-tracker-I8-0yYAH0)

![Design preview for the IP address tracker coding challenge](./desktop-preview.jpg)
## Getting Started

First, run the development server:
First create a file `.env.local` in the root of the project. Copy the environment variables from `.env.local.example` to your `.env.local` and edit them per your needs.

You will have something like this:
```bash
# Environment variables secret available on server side

# add your ipify api key below
IPIFY_API_KEY=your_secret_api_key_here

# Public Environment variables available on client side
NEXT_PUBLIC_LOCAL_DEVELOPMENT=true
NEXT_PUBLIC_HOSTNAME=localhost
NEXT_PUBLIC_PORT=3000
NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$NEXT_PUBLIC_PORT
```

Then, run the development server:

```bash
npm run dev
Expand All @@ -12,12 +31,6 @@ yarn dev

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:
Expand All @@ -32,3 +45,5 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

**Have fun!** 🚀
Binary file added desktop-preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.