A full-stack MERN (MongoDB, Express, React, Node) bookstore application with CRUD functionality, Firebase authentication, React-Redux state management, and role-based route protection.
- React 18 (Vite for bundling and dev server)
- React Router 7 for client-side routing
- Redux Toolkit & RTK Query for global state management and data fetching
- Chakra UI + Tailwind CSS for styling and responsive layout
- Framer Motion for animations
- Chart.js / react-chartjs-2 for rendering analytical charts
- Axios for HTTP requests (used in some places alongside RTK Query)
- Node.js & Express for the server and RESTful APIs
- MongoDB & Mongoose for database and schema modeling
- CORS for cross-origin requests
- Dotenv for environment variable management
- Firebase (
firebase.auth()
,GoogleAuthProvider
) - Firestore not used for data in this project, but Realtime authentication state is used for the front-end.
- Custom backend endpoints sync user data (
/api/real-users
) with MongoDB using the Firebaseuid
.
┌─────────────────────────────────┐
│ React Frontend (Vite) │
│ - Redux Toolkit │
│ - React Router │
│ - Chakra UI / Tailwind │
│ - Firebase Auth Context │
└─────────────▲──────────────────┘
│
│ (HTTP, RTK Query / Axios)
│
┌─────────────┴──────────────────┐
│ Express.js Backend │
│ - RESTful API routes under │
│ /api/ │
│ - Admin & Private routes │
└─────────────▲──────────────────┘
│
│ (ODM via Mongoose)
│
┌─────────────┴──────────────────┐
│ MongoDB Atlas │
│ - Users, Books, Orders, etc. │
└─────────────────────────────────┘
-
Add Books to Cart and Checkout
-
View Books By Category
-
Central Home Page
-
View Order History
-
Contact Me Form
-
Register and Login
-
Register and Login With Google
-
User Registration & Login
- Firebase Authentication (Email/Password & Google OAuth)
- Automatic MongoDB record creation for new users (via
RealUser
collection)
-
Protected Routes
- PrivateRoute: Ensures that certain pages (e.g., Orders) are accessible only to logged-in users.
- AdminRoute: Allows only admin (or token-based) access to certain pages/statistics.
-
Redux Toolkit
- Centralized application state with
cartSlice
,booksApi
,ordersApi
,quotesApi
,realUsersApi
. - RTK Query for asynchronous data fetching and caching of books, orders, quotes, etc.
- Centralized application state with
-
Bookstore Essentials
- Browse books (with author info, reviews, quotes)
- Add to cart, place orders
- View past orders (protected route)
- Manage authors, reviews, and quotes from the admin perspective
-
UI/UX Enhancements
- Chakra UI & Tailwind CSS for styling
- Framer Motion for smooth animations
- SweetAlert2 for polished alerts and confirmations
- Chart.js integrated (via
react-chartjs-2
) for analytics
-
CRUD Operations
- Full suite of Create, Read, Update, Delete endpoints for books, authors, orders, users, reviews, and quotes.