https://github.com/pyrrolizin/nextjs-api-request
Starting platform for a Next.js project that pulls data from an external API and caches the result. (includes responsive TSX template with Bootstrap 5)
https://github.com/pyrrolizin/nextjs-api-request
api cache memory-cache next-js nextjs openweathermap-api
Last synced: 8 months ago
JSON representation
Starting platform for a Next.js project that pulls data from an external API and caches the result. (includes responsive TSX template with Bootstrap 5)
- Host: GitHub
- URL: https://github.com/pyrrolizin/nextjs-api-request
- Owner: pyrrolizin
- License: mit
- Created: 2022-09-01T15:26:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-08T11:32:29.000Z (over 3 years ago)
- Last Synced: 2025-06-11T23:07:23.883Z (9 months ago)
- Topics: api, cache, memory-cache, next-js, nextjs, openweathermap-api
- Language: TypeScript
- Homepage:
- Size: 71.9 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to Nextjs-api-request 👋
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 a starting platform for a Next.js project that pulls data from an external API and caches the result.
>The project includes a responsive Bootstrap 5 template.
>
>The Project uses yarn zero install (Plug'n'Play)
## 🏠 [Homepage](https://github.com/pyrrolizin/nextjs-api-request)
## ✨ Demo (OpenWeatherMap-Api - Current weather in Stuttgart, Germany)
tbd

## Prerequisit
* Node.js >= 16
* Yarn > 3
## Install
Yarn installs the suitable swc binary for `@next/swc`.
```sh
yarn
```
### Environment varaibles
You can set the following environment variables:
| NAME | *required* | Comment |
| ----------- | ------------ | --------- |
| `API_KEY` | **yes** | You can get your own free OpenWeatherApi key on this website: https://home.openweathermap.org/users/sign_up |
You can either set the environment variables or use the `.env.local` file:
Make your own copy of the `.env.local` file and specify the `.env.local` and add the keys.
```sh
cp ./.env.local_default ./.env.local
```
Learn more about the OpenWeatherMap API: https://openweathermap.org/api
## Getting Started
First, run the development server:
```bash
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## Deploy on Vercel
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 the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.