This is a Next.js project bootstrapped with
create-next-app
.
Run the nvm use
command to set the default node version found in the .nvmrc
file. Similarly, if the specified node version is not installed simply run
nvm install
.
npm i
# or
yarn
To run the app, you need an API key. To get a key:
- Create a free Pexels account
- Go to: https://www.pexels.com/onboarding
- Follow "I want to download"
- Complete the form. Make sure you use a valid email address
- Confirm your email
- Visit the Image & Video API section of your account
- Provide a description and a URL. These can be fake, feel free to use the
examples below or write your own:
- Example description: "I'm using the API for a code challenge"
- Example URL: https://example.com
cp .env.local.default .env.local
Add your Pexels API key value to
NEXT_PUBLIC_PEXELS_API_KEY
in .env.local
NEXT_PUBLIC_PEXELS_API_KEY=<YOUR_API_KEY_HERE>
npm run dev
# or
yarn dev
OR
npm run build && npm run start
# or
yarn build && yarn start
Open http://localhost:3000 with your browser to see the result.
The app is also deployed here: https://forbes-code-challenge.vercel.app/
yarn dev
: starts the application in development mode with hot-code reloading, error reporting, and moreyarn format
: formats the code with prettieryarn lint
: runs eslint, tsc, and stylelintyarn lint:js
: runs eslintyarn lint:styles
: runs stylelintyarn lint:ts
: runs tscyarn lint:ts:watch
: runs tsc in watch modeyarn build
: creates an optimized production buildyarn build && yarn start
: builds & starts the application in production mode. for production & starts the application in production mode