Welcome to the BookStore project, a fully functional online book store built using the MERN (MongoDB, Express.js, React.js, Node.js) stack. This project allows users to browse, add, edit, and delete book entries, providing an intuitive and efficient way to manage your book collection.
Table of Contents
Features
Browse Books
- Users can easily browse through the list of books, either in table format or by specific card view, providing flexibility in how they view their collection.
Add New Books
- Add new entries for books to keep your collection up to date. Fill in the details, such as title, author, genre, and more, to maintain an organized library.
Edit Book Details
- Users have the ability to edit the details of existing books, ensuring that the information in the collection is accurate and up-to-date.
Delete Books
- Remove books from the list when they are no longer in your collection or for any other reason, ensuring that your library stays well-maintained.
Show Single Book
- To see single book information.
Tech Stack
This project is built using the following technologies:
- MongoDB: A NoSQL database for storing book information.
- Express.js: A Node.js web application framework used for building the server-side API.
- React.js: A JavaScript library for building the user interface and frontend components.
- Node.js: A JavaScript runtime environment for running server-side code.
- Tailwind CSS: A utility-first CSS framework for styling the frontend.
- Axios: A promise-based HTTP client for making API requests.
Folder Structure
The project has the following folder structure:
bookStore/
├── client/
├── server/
├── README.md
client/: Contains all the frontend code.client/src/: Includes all frontend components and page routes.
server/: Houses all the database models and backend logic.server/routes/: Contains all the route handlers.
Running the application locally on your machine
To run the BookStore project on your local machine, which consists of two main folders (client and server) with a MongoDB backend and an example .env file in the server folder, follow these steps:
Prerequisites:
Before you begin, make sure you have the following installed on your machine:
-
Node.js and npm (Node Package Manager): You can download them from nodejs.org.
-
MongoDB: Install and set up MongoDB on your local machine. You can download it from mongodb.com.
Steps:
-
Clone the Repository:
Open your terminal or command prompt and navigate to the directory where you want to clone the project. Then, run the following command:
git clone https://github.com/ayushsgithub/bookStore.git
-
Install Dependencies:
Navigate to the project folder and install dependencies for both the client and server:
cd bookStore/client npm install -
Set Up MongoDB:
- Make sure MongoDB is running locally on your machine. You can start MongoDB by running
mongodin your terminal.
- Make sure MongoDB is running locally on your machine. You can start MongoDB by running
-
Create a
.envFile:In the
serverdirectory, create a.envfile by copying the.env.examplefile and updating it with your MongoDB connection URI and any other environment variables:Edit the
.envfile with your MongoDB URI and any other necessary configurations. -
Start the Server:
In the
serverdirectory, start the Node.js server:This will start the server at
http://localhost:5000. -
Start the Client:
In the
clientdirectory, start the React client:This will start the React development server and open the application in your default web browser at
http://localhost:3000. -
Access the Application:
You should now be able to access the BookStore application in your web browser at
http://localhost:3000. You can interact with the online book store and test its features locally.
That's it! You've successfully set up and run the BookStore project on your local machine. You can now browse, add, edit, and delete books in your local BookStore.
- Clone this repository to your local machine.
- Install the required dependencies for both the client and server by navigating to the respective directories and running
npm install. - Set up your MongoDB database and configure the connection in the server.
- Start the server by running
npm startin the server directory. - Start the client by running
npm startin the client directory. - Access the BookStore project in your web browser at the specified URL.
Contributing
We welcome contributions from the community! If you'd like to contribute to the project, please follow our Contribution Guidelines.