Skip to content

gokeihub/bookify_api_v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bengali Books API

Overview

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.

Installation

  1. Clone the repository:

    git clone https://github.com/gokeihub/bookify_api_v2.git
    cd bookify_api_v2
  2. Install dependencies:

    pnpm install
  3. Start the server:

    nodemon start

API Endpoints

Authors

  • 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.

Books

  • 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.

Episodes

  • 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.

Version Management

  • 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.

Admin Panel

The admin panel can be accessed at:

http://localhost:3000

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published