Book Store (MERN Stack)

Tech Stack
Overview
This Book Store project is a full-stack MERN (MongoDB, Express.js, React, Node.js) application that implements a complete book management system with CRUD operations. The backend is an Express.js REST API with Mongoose ODM for MongoDB, featuring proper routing, input validation, error handling, and CORS policy configuration. The frontend is a React SPA with React Router for client-side navigation, featuring a clean UI for browsing, adding, editing, and deleting books. The project covers real-world patterns including environment-based configuration, API error handling with user-friendly messages, loading states, and responsive design. It serves as both a learning resource for the MERN stack and a reference implementation for full-stack JavaScript architecture.
Challenges
- •Setting up proper CORS configuration to allow the React frontend and Express backend to communicate during development on different ports
- •Implementing robust error handling that provides helpful feedback on both the API and UI sides
- •Structuring the project in a way that demonstrates clean full-stack architecture patterns for reference purposes
Solutions
- •Configured CORS middleware with environment-specific origin whitelisting, supporting both development (localhost:3000) and production domains
- •Built a centralized error handling middleware on the backend that returns consistent error shapes, paired with a React error boundary and toast notification system on the frontend
- •Organized the codebase with clear separation: models/routes/controllers on the backend, components/pages/services on the frontend, with shared API type definitions
Results
Full-stack MERN application demonstrating CRUD operations