Skip to content

orbanszlrd/unsplash-demo

Repository files navigation

Unsplash Demo

Testing the Unsplash API

Screenshots

Desktop Screenshot

Development

Prerequisites

Install Git, the free and open source distributed version control system.
Install Node.js which includes Node Package Manager.
Install Yarn Package Manager.

Clone and install

Run git clone [email protected]:orbanszlrd/unsplash-demo.git to clone the repository from GitHub.
Run yarn install or npm install to install the dependencies.

Development server

Run yarn dev or npm run dev for a dev server.
Navigate to http://localhost:3000
The app will automatically reload if you change any of the source files.

Build

Run yarn build or npm run build to build the project.

Start the app locally

Run yarn start or npm run start to start the app.
Navigate to http://localhost:3000

Deployment

The app is configured to be hosted on cPanel

  • Push the latest changes to the repository where the app is hosted
  • Update the checked out branch
  • Create a new Node.js application
  • Copy the .next folder in the root directory of the app
  • Install the dependencies
  • Configure the environment variables
  • Start the app
  • Enjoy

If you want to deploy it on Vercel, you need to make some changes to it

  • Delete the custom server file: server.js
  • Revert the the start script in the package.json to its initial value, next start

Configuration

In order to use the Unsplash API, you need to have a Developer Account on Unsplash.

Further help

React - Getting Started
Next.js - Documentation
Vercel - Documentation
Unsplash Developers - Documentation
Unsplash Developers - User Authentication Workflow