GithubHelp home page GithubHelp logo

sahilatahar / book-store Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 270 KB

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

Home Page: https://sahilatahar-book-store.vercel.app/

License: MIT License

JavaScript 76.41% HTML 1.95% SCSS 21.65%
book-store express expressjs mern-crud mern-project mongodb mongoose nodejs nodejs-api reactjs

book-store's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.