Skip to content

An online book store application featuring CRUD (Create, Read, Update, Delete) functionalities for managing a collection of books. πŸ€–

License

Notifications You must be signed in to change notification settings

sahilatahar/book-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Book Store - MERN Project πŸ“š

This MERN (MongoDB, Express.js, React.js, Node.js) project, "book-store," is an online book store application featuring CRUD (Create, Read, Update, Delete) functionalities for managing a collection of books. πŸ€–

Features πŸ”

  • Book Collection Management:
    • Add new books with detailed information like - image, title, description, price, author. πŸ“·
    • View the list of available books with their details. πŸ“š
    • Edit existing book information. πŸ–‹οΈ
    • Delete books from the collection. πŸ—‘οΈ

Live Preview πŸ’»

Check out the live demo of the Book Store application:

Technologies Used πŸ› οΈ

The project utilizes the following technologies:

Frontend πŸ’»

  • React.js: A JavaScript library for building user interfaces. 🌐
  • Vite.js: A build tool that aims to provide a faster and leaner development experience for modern web projects. ⏱️
  • Sass/SCSS: A preprocessor scripting language that is interpreted or compiled into Cascading Style Sheets (CSS). 🎨
  • Context API: Used for state management in React.js applications. 🧩
  • ESLint: A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. πŸ”

Backend πŸ”₯

  • Node.js: A JavaScript runtime environment for executing JavaScript code server-side. πŸ’»
  • Express.js: A web application framework for Node.js used to build APIs and web apps. πŸš€
  • MongoDB: A NoSQL database used to store application data. πŸ’Ύ
  • Mongoose: An ODM (Object Data Modeling) library for MongoDB and Node.js. πŸ¦Έβ€β™‚οΈ
  • dotenv: A zero-dependency module that loads environment variables from a .env file into process.env. 🌿

Project Structure πŸ“Š

client/
  β”œβ”€β”€ src/
  β”‚   β”œβ”€β”€ assets/
  β”‚   β”œβ”€β”€ context/
  β”‚   β”‚   └── Context.jsx
  β”‚   β”œβ”€β”€ pages/
  β”‚   β”‚   β”œβ”€β”€ Books/
  β”‚   β”‚   β”‚   β”œβ”€β”€ Book/
  β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Book.jsx
  β”‚   β”‚   β”‚   β”‚   └── Book.scss
  β”‚   β”‚   β”‚   β”œβ”€β”€ Books.jsx
  β”‚   β”‚   β”‚   └── Books.scss
  β”‚   β”‚   └── Editor/
  β”‚   β”‚       β”œβ”€β”€ Editor.jsx
  β”‚   β”‚       └── Editor.scss
  β”‚   β”œβ”€β”€ App.jsx
  β”‚   β”œβ”€β”€ index.scss
  β”‚   └── main.jsx
  β”œβ”€β”€ .env
  β”œβ”€β”€ .eslintrc.cjs
  β”œβ”€β”€ .gitignore
  β”œβ”€β”€ index.html
  β”œβ”€β”€ package-lock.json
  β”œβ”€β”€ package.json
  └── vite.config.js

server/
  β”œβ”€β”€ config/
  β”‚       └── dbConfig.js
  β”œβ”€β”€ controllers/
  β”‚       └── booksController.js
  β”œβ”€β”€ models/
  β”‚       └── Book.js
  β”œβ”€β”€ routes/
  β”‚       └── Books.js
  β”œβ”€β”€ services/
  β”‚       └── bookService.js
  β”œβ”€β”€ .env
  β”œβ”€β”€ .gitignore
  β”œβ”€β”€ index.js
  β”œβ”€β”€ package-lock.json
  β”œβ”€β”€ package.json
  └── vercel.json

Description

The client directory contains the front-end part of the application built with React.js. It includes:

  • src/assets: Assets used in the application (images, etc.).
  • src/context: Context file(s) used for state management (Context.jsx).
  • src/pages: Components representing different pages/routes in the app (Books, Editor, etc.).
  • src/App.jsx: Main React component representing the root of the application.
  • src/index.scss: Main SCSS file for styling.
  • src/main.jsx: Main entry point for the React app.

The server directory contains the back-end part of the application built with Node.js and Express.js. It includes:

  • config: Configuration files, e.g., database configuration (dbConfig.js).
  • controllers: Controllers handling the business logic for different routes (booksController.js).
  • models: Mongoose models or schemas representing entities (Book.js).
  • routes: API routes and their corresponding controller functions (Books.js).
  • services: Additional services or utilities for the application (bookService.js).

Getting Started πŸš€

To run the application locally, follow these steps:

  1. Clone the Repository:
    git clone https://github.com/sahilatahar/book-store.git
    cd book-store
  2. Setup the Client:
    cd client
    npm install
    # Or yarn install if using yarn
    
  3. Setup the Server:
    cd ../server
    npm install
    # Or yarn install if using yarn
    
  4. Set up Environment Variables:
    • Frontend (.env in client/): Create a .env file in the client/ directory and add VITE_API_URL=server_url_here.
    • Backend (.env in server/): Create a .env file in the server/ directory and add MONGODB_URI=your_mongodb_uri and PORT=your_preferred_port_number.
  5. Run the Application:
    • Start the React client:
      cd ../client
      npm run dev
      # Or yarn start if using yarn
      
    • Start the Node.js server:
      cd ../server
      npm run dev
      # Or yarn start if using yarn
      
  6. Access the Application: Open your web browser and visit http://localhost:5173 to use the book store application.

Contribution 🀝

Contributions are welcome! If you'd like to improve this project, please fork the repository and create a pull request. Feel free to open an issue if you find any bugs or have suggestions for enhancements.

License πŸ“„

This project is licensed under the MIT License. You can find more details in the LICENSE file.

Note

This project was created while learning backend development. It may contain code or practices that reflect a learning phase. However, contributions to improve and enhance the project are encouraged.

About

An online book store application featuring CRUD (Create, Read, Update, Delete) functionalities for managing a collection of books. πŸ€–

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published