This project is a React application that allows users to search for books using the Open Library API and add them to a personal bookshelf stored in localStorage.
- Search for books in real-time as you type
- Display search results in a list of cards
- Add books from the search results to a personal bookshelf
- View and manage the personal bookshelf
- React
- React Router
- Axios for API requests
- Tailwind CSS for styling
- Vite for build tool and development server
- Node.js (version 14 or higher)
- npm (version 6 or higher)
-
Clone the repository:
git clone https://github.com/yourusername/book-search-app.git cd book-search-app
-
Install dependencies:
npm install
-
Install Tailwind CSS:
npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p
-
Configure Tailwind to remove unused styles in production by adding the following to your
tailwind.config.js
:/** @type {import('tailwindcss').Config} */ module.exports = { content: [ "./index.html", "./src/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {}, }, plugins: [], }
-
Add the Tailwind directives to your CSS file (
src/index.css
):@tailwind base; @tailwind components; @tailwind utilities;
-
Start the development server:
npm run dev
-
Open your browser and navigate to:
http://localhost:5174/
This application can be deployed on Vercel.
-
Build the application:
npm run build
-
Push your code to GitHub if it's not already there:
git add . git commit -m "Initial commit" git push origin main
-
Deploy to Vercel:
- Go to Vercel and sign up if you haven't already.
- Click on the "New Project" button.
- Import your repository from GitHub.
- Follow the prompts to configure your project.
- Once configured, Vercel will automatically build and deploy your project.