Project structure:

library-node-api/
│
├── src/
│   ├── config/
│   │   └── db.js              # MySQL connection pool
│   │
│   ├── routes/
│   │   ├── authors.js         # Author CRUD + top-borrowed endpoint
│   │   ├── books.js           # Book CRUD + filtering
│   │   └── borrowRecords.js   # BorrowRecord CRUD + overdue report
│   │
│   └── app.js                 # Express app setup (middleware, routes, CORS)
│
├── .env                       # Environment variables (DB credentials, port)
├── .env.example               # Safe-to-commit template showing what .env needs
├── .gitignore                 # Tells Git to ignore node\_modules and .env
└── package.json               # Project metadata and dependencies


Creating the project:
1) npm init -y                    # creates a package.json with default values automatically (the -y skips all the questions
2) npm install express mysql2 dotenv cors   # install dependencies
o express — the web framework that handles routing, middleware, and HTTP requests/responses
o mysql2 — the MySQL driver for Node.js; lets us connect to and query the MySQL database
o dotenv — loads environment variables from the .env file into process.env
o cors — middleware that adds the CORS headers so the React frontend can call this API
3) edit contents of package.json
4) Create .gitignore and .env files
This prevents Git from committing the node_modules folder (which is huge and can always be restored with npm install) and the .env file (which contains sensitive database credentials).
5) Edit the files in /src 

Run the project:
npm run dev       # top-level

