This is a Next.js project bootstrapped with create-next-app
.
-
clone the repo to your local machine
-
Then do a npm install to install the dependencies.
npm i
- To Run Locally, run the development server:
npm run dev
# or
yarn dev
- Open http://localhost:3000 with your browser to see the result.
here is a overall folder and file structure for the application
these are the reusable functional react components.
these are the server side code which are imported into the pages/api folder.
all the static files are located here.
here are the context api files.
all the scss files are located here.
all the environment variables are located here.
all the advanced configuration is located here.
documentation foe the application.
there are two pages
- home page
- favorite page
to get random pictures. unsplash api is used. api is called in home page. api keys are set in env.local folder. 10 images are pre rendered. images are pre rendered using getStaticProps in homePage.
to get the images fetchImages is called from the lib/get-images.js homepage functionalities
- like photos
- like count will dynamically change
- like images will be saved in a database(AIRTABLE)
all the photos which are liked comes to the favorites page. images are rendered in clint side. using node fetch api for the api calls throughout the application. hooks are used to call the initial render of the favorites images.
- remove the favorite images.