Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

📚 Book Management System

A modern web application for managing books with Node.js backend, Express API, and JSON file database.

Features

  • 📖 Book Listing: View all books with search and filter functionality
  • ➕ Create Books: Add new books with comprehensive form
  • 📋 Book Details: View detailed information about individual books
  • ✏️ Edit Books: Update existing book information
  • 🗑️ Delete Books: Remove books from the collection
  • 🔍 Search & Filter: Find books by title, author, genre, or rating
  • 📱 Responsive Design: Works on desktop, tablet, and mobile devices
  • 🎨 Modern UI: Beautiful gradient design with smooth animations

Tech Stack

  • Backend: Node.js with Express.js
  • Frontend: HTML5, CSS3, Vanilla JavaScript
  • Database: JSON file (data/books.json)
  • Styling: Modern CSS with gradients and animations
  • API: RESTful API endpoints

Project Structure

UIProject/
├── data/
│   └── books.json          # JSON database file
├── public/
│   ├── index.html          # Main book listing page
│   ├── create.html         # Create new book page
│   ├── book-details.html   # Book details page
│   ├── styles.css          # Main stylesheet
│   └── script.js           # Frontend JavaScript
├── server.js               # Node.js server and API
├── package.json            # Project dependencies
└── README.md              # This file

Installation & Setup

  1. Install Dependencies

    npm install
  2. Start the Server

    # Development mode (with auto-restart)
    npm run dev
    
    # Production mode
    npm start
  3. Access the Application

    • Open your browser and go to http://localhost:3000
    • The application will be ready to use!

API Endpoints

Method Endpoint Description
GET /api/books Get all books
GET /api/books/:id Get book by ID
POST /api/books Create new book
PUT /api/books/:id Update book
DELETE /api/books/:id Delete book

Pages

1. Book Listing Page (/)

  • Displays all books in a responsive grid
  • Search functionality by title, author, or genre
  • Filter by genre and rating
  • Click on any book to view details

2. Create Book Page (/create)

  • Form to add new books
  • Required fields: Title, Author
  • Optional fields: Genre, Published Year, Description, ISBN, Pages, Rating, Cover Image
  • Automatic redirect to book details after creation

3. Book Details Page (/book/:id)

  • Detailed view of individual books
  • Shows all book information including cover image
  • Edit and delete options
  • Navigation back to book listing

Book Data Structure

Each book object contains:

{
  "id": "1",
  "title": "Book Title",
  "author": "Author Name",
  "genre": "Genre",
  "publishedYear": 2024,
  "description": "Book description...",
  "isbn": "978-1234567890",
  "pages": 300,
  "rating": 4.5,
  "coverImage": "https://example.com/image.jpg"
}

Features in Detail

Search & Filter

  • Search: Real-time search across title, author, and genre
  • Genre Filter: Filter books by specific genres
  • Rating Filter: Show books with minimum rating (2+, 3+, 4+ stars)

Responsive Design

  • Mobile-first approach
  • Adaptive grid layout
  • Touch-friendly interface
  • Optimized for all screen sizes

User Experience

  • Loading states for better feedback
  • Success/error messages
  • Smooth animations and transitions
  • Intuitive navigation

Development

Adding New Features

  1. Update the API endpoints in server.js
  2. Modify the frontend JavaScript in public/script.js
  3. Update the UI in the respective HTML files
  4. Style changes in public/styles.css

Database

  • The JSON file (data/books.json) serves as the database
  • Data persists between server restarts
  • Easy to backup and version control
  • Can be easily migrated to a real database later

Troubleshooting

Common Issues

  1. Port already in use

    # Change port in server.js or use different port
    PORT=3001 npm start
  2. CORS issues

    • The server includes CORS middleware
    • If issues persist, check browser console for errors
  3. Image loading errors

    • Default fallback images are provided
    • Check image URLs in the book data

Debug Mode

# Run with debug logging
DEBUG=* npm start

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is open source and available under the MIT License.

Support

For questions or issues, please check the troubleshooting section or create an issue in the repository.


Happy Reading! 📚✨

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages