This is a full-stack bookstore application built with a React frontend and an Express backend. The application allows users to browse books, add them to a cart, and complete purchases. Admin users can manage books and view sales.
- Frontend: Built with React, Redux, and TailwindCSS.
- Backend: Built with Express, MongoDB, and Cloudinary for image storage.
- Authentication: JWT-based authentication with role-based access control.
- Cart Management: Persistent cart storage using localStorage.
- Admin Dashboard: Manage books and view sales.
Ensure you have the following installed:
- Node.js (v16 or later)
- npm or yarn
- MongoDB (local or cloud instance)
- Cloudinary account (for image uploads)
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install- Create a .env file in the backend directory with the following variables:
PORT=5000
MONGO_URL=<your-mongodb-connection-string>
JWT_SECRET=<your-jwt-secret>
JWT_EXPIRATION=1d
CLOUDINARY_NAME=<your-cloudinary-name>
CLOUDINARY_KEY=<your-cloudinary-api-key>
CLOUDINARY_SECRET=<your-cloudinary-api-secret>
LIVE_URL=<frontend-url>- Start the backend server:
npm run dev- Access the backend at: http://localhost:5000
1.Navigate to the frontend directory:
cd frontend/bookstoreui- Install dependencies:
npm install- Create a .env file in the frontend/bookstoreui directory with the following variable:
VITE_BACKEND_URL=http://localhost:5000- Start the development server:
npm run dev- Open the application in your browser at: http://localhost:5173