# π BookExplorer API
BookExplorer is a Django REST Framework (DRF)-powered backend project that allows users to search, fetch, and save books using the Open Library API. It supports searching by title, fetching by ISBN, and prevents duplicate entries β all via clean, well-structured REST APIs.
## π Features
π Search books by title using Open Library's public API
π Fetch book details using ISBN (title, author, publish date, cover, description)
βοΈ Save books to local database with duplicate prevention
π Admin-only deletion of books
π Pagination, filtering, searching, and ordering
π¦ API-first architecture for React/JS frontend consumption
## π Tech Stack
Python 3.10
Django 5.1
Django REST Framework
Open Library API (external)
SQLite (dev), deploy-ready with PostgreSQL
Insomnia/Postman/React-compatible API
## βοΈ Getting Started
### 1. Clone the repo
git clone https://github.com/AtharvaZalkikar/bookexplorer-backend.git
cd bookexplorer-backend
## 2. Create a virtual environment
python -m venv venv
\\# On Windows:
venv\\\\Scripts\\\\activate
\\# On Mac/Linux:
source venv/bin/activate
## 3. Install dependencies
pip install -r requirements.txt
## 4. Run migrations
python manage.py migrate
## 5. Run the development server
python manage.py runserver
π Authentication
- All GET and POST endpoints are publicly accessible.
- DELETE and PUT operations on books require authentication and are restricted to staff/admin users.
- Authentication system is DRF-ready (token-based or session-based login support).
π API Endpoints
| Endpoint | Method | Description | Auth Required |
| ------------------------ | ----------- | -------------------------------------- | ------------- |
| /search-open?title=... | GET | Search books from Open Library | No |
| /fetch-book/?isbn=... | GET | Fetch book details from Open Library | No |
| /fetch-and-save/ | POST | Fetch from ISBN and save to DB | No |
| /save-from-search/ | POST | Save book (manual or from search list) | No |
| /books/ | GET | List all saved books (with filters) | No |
| /books/<id>/ | DELETE | Delete a book | β
Yes (Admin) |
| /books/<id>/ | PUT/PATCH | Update a book | β
Yes (Auth) |
##πFiltering, Search, and Ordering
You can use the following query params on /books/:
- ?search=tolkien β matches title or author
- ?ordering=published_date β ascending
- ?ordering=-title β descending by title
- ?published_date=2001 β exact match filter
π§βπ» Author
Atharva Zalkikar GitHub
π Roadmap
β Backend API completed with testing π¨ React / Tailwind frontend integration (up next!) π Deployment to global server