The project is split into two main parts:
- Backend: A RESTful API built with Express and Mongoose.
- Frontend: A responsive SPA built with React and Vite.
- Book Inventory Management:
- Full CRUD operations (Create, Read, Update, Delete).
- Search by title, author, or category.
- Filter by publication year or specific categories (e.g., Fiction).
- Inventory controls: Update available copies and categories.
- Deletion safety: Books can only be deleted if stock is zero.
- Customer Directory:
- Manage customer profiles (Name, Age, Membership).
- Search and filter customers.
- Membership badges (Bronze, Silver, Gold, Platinum).
- Modern UI/UX:
- Dashboard-style interface with tabbed navigation.
- Real-time feedback (loading states, success/error notifications).
- Responsive design for mobile and desktop.
- Node.js & Express.js (v5.2.1)
- MongoDB with Mongoose (v9.1.1)
- CORS for secure frontend-backend communication
- Dotenv for environment variable management
- Nodemon for development efficiency
- React (v19)
- Vite (Build tool)
- CSS Modules & Modern CSS (Gradients, Flexbox, Grid)
- Fetch API for backend integration
- Node.js (v18+ recommended)
- MongoDB (Local instance or MongoDB Atlas)
cd Backend
npm install
# Create a .env file and add:
# MONGO_URI=your_mongodb_connection_string
npm run seed # Optional: Seed sample data
npm run dev # Runs on http://localhost:3000# In a new terminal
cd Frontend
npm install
npm run dev # Runs on http://localhost:5173| Entity | Method | Endpoint | Description |
|---|---|---|---|
| Books | GET | /books |
Get all books |
| Books | POST | /books |
Create new book |
| Books | PATCH | /books/:id/copies |
Update stock quantity |
| Books | DELETE | /books/:id |
Delete book (if copies=0) |
| Customers | GET | /customers |
Get all customers |
| Customers | POST | /customers |
Register new customer |
.
βββ Backend/ # Express API
β βββ models/ # Mongoose Schemas
β βββ routes/ # API Route Handlers
β βββ seed.js # Database Seeder
βββ Frontend/ # React Vite App
βββ src/
β βββ components/ # UI Components (Books/Customers)
β βββ App.jsx # Main App Logic