Demo URL: https://pexel-browser.onrender.com.
Code Setup Instructions:
- You must have Nodejs & npm/yarn installed on your local machine.
- For installing Nodejs & npm follow https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
- For installing yarn follow https://classic.yarnpkg.com/lang/en/docs/install/
- Clone the git repository at https://github.com/hazique/pexel-photo-browser
Getting a Pexels API Key
To work with the Pexels API, you need an API key. To get a key;
- Create a free Pexels account
- 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 programming practice projects”
- Example URL: https://example.com
On completing the above steps, you need to open a Terminal window in the project directory.
Setting up the API key in the Project
- Make a
.env.local
file in the project root directory and paste your API key in the format below
PEXELS_API_KEY="<YOUR API KEY>"
Loading dependencies and running the project
To install all dependencies:
npm install
To develop and run the project locally use
npm run dev
To create and deploy a build, run:
npm run build
npm run serve