CoolFace
Apppublic

leetcoder2008/libraryhub

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes
App README
markdown
# LibraryHub Backend

This is the backend for the LibraryHub application built with Python Flask.

## Setup Instructions

1. Install dependencies:

pip install -r requirements.txt


2. Run the application:

python app.py


The backend server will start on `http://localhost:5000`.

## API Endpoints

### Authentication
- `POST /api/signup` - Create a new user account
- `POST /api/signin` - Sign in to an existing account

### Books
- `GET /api/books` - Get all books
- `POST /api/books` - Add a new book (admin only)

### Borrowing
- `POST /api/borrow` - Borrow a book
- `POST /api/return` - Return a borrowed book
- `GET /api/user/<user_id>/borrowed` - Get currently borrowed books for a user
- `GET /api/user/<user_id>/history` - Get borrowing history for a user

### Feedback
- `POST /api/feedback` - Submit feedback

## Database

The application uses SQLite database (`library.db`) which is automatically created when the application starts.