This is a demo app written using TypeScript/React/Vite that allows the user to browse Unsplash photos using the Unsplash Photo API.
- In the root directory of the project run
npm install
to install the dependencies. - Create a
.env.local
file in the root directory and add the following environment variable with your local testing Unsplash API access key (replaceXXXXXXX
):
VITE_UNSPLASH_ACCESS_KEY=XXXXXXX
- Run
npm run dev
to run the app on localhost. The app should be available at the default Vite server port at http://localhost:5173/
- Create a
.env.production
file in the root directory of the project and specify your production environment Unsplash API key the same way the.env.local
file was configured. - Build the app using
npm run build
. The files in the generateddist
directory can be uploaded to your hosting provider.
Run npm run test
to run some example test cases using Vitest and React Testing Library.