This is a BookSelfs Website built using Node.js, React, and MySQL. The website allows users to manage a list of books, including adding, updating, and deleting book records.
- Features
- Technologies Used
- Setup Instructions
- Prerequisites
- Backend Setup
- Frontend Setup
- Running the Application
- Database Setup
- Contributing
- License
- Add new books
- Update existing books
- Delete books
- View a list of all books
- Backend: Node.js with Express
- Frontend: React
- Database: MySQL
- Node.js and npm installed
- MySQL installed and running
-
Clone the repository:
git clone https://github.com/navinAce/BookSelfs.git
-
Install dependencies:
npm install
-
Set up the database:
- Create a MySQL database named
book_database
. - Update the database connection settings in your
db.js
or.env
file.
- Create a MySQL database named
-
Set up
package.json
and run the backend server:npm init "dev": "nodemon -r dotenv/config --experimental-json-modules src/index.js" npm run dev
-
Navigate to the frontend directory:
cd ../frontend
-
Install dependencies:
npm install
-
Run the frontend server:
npm run dev
- The backend server will be running at
http://localhost:8000
. - The frontend server will be running at
http://localhost:5173
.
Open your browser and navigate to http://localhost:5173
to use the application.
Since the database files are not included in the repository, you need to set up the MySQL database manually:
-
Create the database:
CREATE SCHEMA bookdatabase; USE bookdatabase;
-
Create the necessary tables:
CREATE TABLE books ( id INT AUTO_INCREMENT, bookName VARCHAR(50) NOT NULL, authorName VARCHAR(50) NOT NULL, price VARCHAR(50) NOT NULL, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id) ); DESC books;
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.