Skip to content

A full-featured e-commerce book store built with MERN stack (MongoDB, Express.js, React.js, Node.js) that allows users to browse, purchase books and admins to manage the inventory.

Notifications You must be signed in to change notification settings

Vignesh025/Book-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

⚠️ Note: Wait for a minute for the data to load. The website will take some time to get the data from backend as the backend is hosted on a free tier in render.

Book-store

A full-featured e-commerce book store built with MERN stack (MongoDB, Express.js, React.js, Node.js) that allows users to browse, purchase books and admins to manage the inventory.

🚀 Features

  • User Authentication: Firebase authentication for users and JWT for admin
  • Book Management: Admins can add, edit, and delete books
  • Shopping Cart: Users can add/remove books and manage quantities
  • Order Processing: Secure checkout process with order history
  • Admin Dashboard: Analytics and inventory management
  • Responsive Design: Mobile-first approach using Tailwind CSS
  • State Management: Redux Toolkit for global state management
  • Real-time Updates: Instant UI updates on cart modifications

🛠️ Tech Stack

Frontend

  • React.js with Vite
  • Redux Toolkit for state management
  • Tailwind CSS for styling
  • Firebase Authentication
  • React Router DOM for routing
  • Swiper.js for carousels
  • Chart.js for analytics
  • Axios for API requests
  • React Hook Form for form handling
  • SweetAlert2 for notifications

Backend

  • Node.js
  • Express.js
  • MongoDB with Mongoose
  • JWT for admin authentication
  • Bcrypt for password hashing
  • CORS for cross-origin requests

🔧 Installation & Setup

Prerequisites

  • Node.js
  • MongoDB
  • Firebase account

Frontend Setup

cd Book-store-frontend
npm install
npm run dev

Backend Setup

cd Book-store-backend
npm install
npm run start:dev

Environment Variables

Frontend (.env)

VITE_API_KEY=your_firebase_api_key
VITE_AUTH_DOMAIN=your_firebase_auth_domain
VITE_PROJECT_ID=your_firebase_project_id
VITE_STORAGE_BUCKET=your_firebase_storage_bucket
VITE_MESSAGING_SENDER_ID=your_firebase_sender_id
VITE_APP_ID=your_firebase_app_id

Backend (.env)

DB_URL=your_mongodb_connection_string
JWT_SECRET_KEY=your_jwt_secret
PORT=5000

📱 Application Structure

Frontend Routes

  • / - Home page with featured books
  • /login - User login
  • /register - User registration
  • /admin - Admin login
  • /dashboard - Admin dashboard
  • /cart - Shopping cart
  • /checkout - Checkout process
  • /orders - Order history
  • /books/:id - Individual book details

Backend Endpoints

  • /api/books - Book management
  • /api/orders - Order management
  • /api/auth - Authentication
  • /api/admin - Admin statistics

👥 User Roles

Customer

  • Browse books
  • Add to cart
  • Place orders
  • View order history
  • Manage profile

Admin

  • Manage book inventory
  • View sales analytics
  • Process orders
  • Access admin dashboard

🔒 Security Features

  • JWT authentication for admin
  • Firebase authentication for users
  • Protected routes
  • Secure password handling
  • CORS configuration

🚀 Deployment

The application is deployed on:

  • Frontend: Vercel
  • Backend: Render
  • Database: MongoDB Atlas

📝 License

This project is licensed under the MIT License.

About

A full-featured e-commerce book store built with MERN stack (MongoDB, Express.js, React.js, Node.js) that allows users to browse, purchase books and admins to manage the inventory.

Topics

Resources

Stars

Watchers

Forks

Languages