This is a RESTful API built with Express.js and MongoDB for managing Bengali books, authors, and their audio episodes. It also includes an admin panel.
-
Clone the repository:
git clone https://github.com/gokeihub/bookify_api_v2.git cd bookify_api_v2
-
Install dependencies:
pnpm install
-
Start the server:
nodemon start
-
Get all authors
GET /api/authors
Returns a list of all authors and their books.
-
Get a specific author
GET /api/authors/:id
Retrieves details of an author by ID.
-
Add a new author
POST /api/authors
Payload:
{ "name": "Author Name", "image": "Author Image URL" }
Adds a new author.
-
Update an author
POST /api/authors/:id/update
Payload:
{ "name": "Updated Name", "image": "Updated Image URL" }
Updates an author by ID.
-
Delete an author
GET /api/authors/:id/delete
Deletes an author by ID.
-
Add a book to an author
POST /api/authors/:id/books
Payload:
{ "title": "Book Title", "cover": "Cover URL", "episodes": [] }
Adds a new book under an author.
-
Update a book
POST /api/authors/:authorId/books/:bookId/update
Payload:
{ "title": "Updated Title", "cover": "Updated Cover URL" }
Updates a book under an author.
-
Delete a book
GET /api/authors/:authorId/books/:bookId/delete
Deletes a book under an author.
-
Add an episode to a book
POST /api/authors/:authorId/books/:bookId/episodes
Payload:
{ "book_name": "Episode Name", "audio_url": "Audio URL", "voice_owner": "Voice Owner" }
Adds an episode to a book.
-
Update an episode
POST /api/authors/:authorId/books/:bookId/episodes/:episodeId/update
Payload:
{ "book_name": "Updated Name", "audio_url": "Updated Audio URL", "voice_owner": "Updated Voice Owner" }
Updates an episode.
-
Delete an episode
GET /api/authors/:authorId/books/:bookId/episodes/:episodeId/delete
Deletes an episode from a book.
-
Get update version info
GET /update/api
Retrieves the latest version and update message.
-
Update version info
POST /update
Payload:
{ "latest_version": "1.0.2", "update_message": "New update available." }
Updates version info.
-
Delete version info
POST /delete
Deletes the version info.
The admin panel can be accessed at:
http://localhost:3000
This project is licensed under the MIT License.