GithubHelp home page GithubHelp logo

geshan / nextjs-weather-geo Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 66 KB

This is a simple weather app built with Next.js 13 using JavaScript (not TypeScript), demo for a blog post.

Home Page: https://geshan.com.np/blog/2023/06/nextjs-env-variables/

JavaScript 29.64% CSS 70.36%
api-rest nextjs servercomponent weather weather-app

nextjs-weather-geo's Introduction

Simple weather app with Next.js 13

This is a simple weather app built with Next.js 13 using JavaScript (not TypeScript).

For a blog post

This is a demo (proof of concept) app for a blog post about Next.js environment variables.

Run it locally

To run it locally you can clone the app and run npm run dev.

Environment variables

It will need a key from API Ninjas for the weather to work. You can get a free key from them.

You can also add a GA4 tracking ID to track the app. Both of these keys should be added to the .env.local file you can copy the .env.example file to .env.local and add the keys thereby replacing the values shown below:

API_NINJAS_API_KEY="API_NINJAS_API_KEY-value"
NEXT_PUBLIC_GA_MEASUREMENT_ID="G-**--------"

Deploy it to Vercel

You can deploy it to Vercel by clicking the button below:

Deploy with Vercel

Demo

You can see the demo of the app at https://nextjs-weather-geo.vercel.app/ and pass the city as the parameter like:

https://nextjs-weather-geo.vercel.app/?city=sydney

By default, it will load the weather for London.

nextjs-weather-geo's People

Contributors

geshan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

edum-compassuol

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.