This project is a web frontend application for an online bookstore, developed with React and Vite. The application allows users to explore, purchase, and rent books, as well as manage their invoices and profiles.
- Authentication & Authorization: User registration and login with JWT.
- Book Catalog: Browse and search for available books.
- Shopping Cart: Add books for purchase or rental.
- Invoice Management: View purchase and rental history.
- User Profile: Manage personal information.
- Admin Panel: Manage books, users, and invoices (Admin only).
- Responsive Design: Optimized for different screen sizes.
- React: Library for building user interfaces.
- Vite: Fast development build tool.
- React Router: Page navigation.
- Material UI: UI components.
- Axios: HTTP client for API communication.
- JWT: Token-based authentication.
- Formik & Yup: Form handling and validation.
- Node.js (v14.0.0 or higher)
- npm (v6.0.0 or higher)
- Library REST API (Spring Boot) running at
http://localhost:8080
1️⃣ Clone the repository:
git clone https://github.com/Ne052003/Library-Frontend.git
cd library-frontend2️⃣ Install dependencies:
npm install3️⃣ Create a .env file in the root directory:
VITE_API_URL=http://localhost:8080/library4️⃣ Modify the vite.config.js file to add
base: "./",5️⃣ Start the development server:
npm run devOpen your browser at http://localhost:5173
📦 library-frontend
┣ 📂 public
┣ 📂 src
┃ ┣ 📂 api
┃ ┣ 📂 components
┃ ┣ 📂 context
┃ ┣ 📂 pages
┃ ┣ 📂 utils
┃ ┣ 📜 App.jsx
┃ ┣ 📜 main.jsx
┣ 📜 .env
┣ 📜 package.json
┣ 📜 vite.config.js
- Home Page: Users can browse the book catalog without logging in.
- Authentication: To purchase or rent, users must sign up and log in.
- Exploration: Users can search and view book details.
- Cart: Users can add books to the cart (purchase or rent).
- Invoices: Users can view their purchase and rental history.
- Administration: Admins can manage books, users, and invoices.
- User: Can browse books, purchase, rent, and view their history.
- Admin: Can access the admin panel to manage the application.
The application interacts with a Spring Boot REST API. Key endpoints:
POST /auth/register,POST /auth/login→ User authentication.GET /library/books,POST /library/books→ Book management.GET /library/users,POST /library/users→ User management.GET /library/bills,POST /library/bills→ Invoice management.
To build the application for production:
npm run buildThis generates a dist folder with optimized files ready for deployment on any static web server.
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request 🚀
Neoly Alexis Moreno - alxism16@gmail.com
Project Link: GitHub Repository