Skip to content

This repository contains the backend API for a Book Store application. It includes endpoints for managing books, authors, and user authentication. The API is implemented in Go using the Echo framework and integrates with a MySQL database. The Postman collection provides examples for testing the API endpoints.

Notifications You must be signed in to change notification settings

humaid0x/Book-Store-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Book Store API

Postman Collection

Feel free to import the Postman collection into your Postman workspace to explore and test the API endpoints.

⚡️ Run Instructions

  1. Clone the repository:

    $ git clone [email protected]:humaid0x/Book-Store-API.git
  2. CD into the project directory:

    $ cd Book-Store-API
  3. Download module dependencies:

    $ go mod download
  4. Modify app.env contents as needed.

  5. Run the application:

    $ go run main.go

Book Routes

Create a Book

  • Endpoint: POST /books/
  • Body: {"authorID": 1, "bookName": "Sample Book", "description": "Lorem ipsum dolor sit amet"}

Read Books

  • Endpoint: GET /books/

Update a Book

  • Endpoint: PUT /books/{bookID}
  • Body: {"authorID": 2, "bookName": "Updated Book"}

Delete a Book

  • Endpoint: DELETE /books/{bookID}

Author Routes

Create an Author

  • Endpoint: POST /authors/
  • Body: {"name": "John Doe", "address": "123 Main St"}

Read Authors

  • Endpoint: GET /authors/

Update an Author

  • Endpoint: PUT /authors/{authorID}
  • Body: {"name": "Updated Author", "address": "456 Oak St"}

Delete an Author

  • Endpoint: DELETE /authors/{authorID}

Auth Routes

Sign In

  • Endpoint: POST /auth/signin
  • Body: {"username": "demo_user", "password": "demo_password"}

Sign Up

  • Endpoint: POST /auth/signup
  • Body: {"email": "[email protected]", "username": "demo_user", "password": "demo_password"}

About

This repository contains the backend API for a Book Store application. It includes endpoints for managing books, authors, and user authentication. The API is implemented in Go using the Echo framework and integrates with a MySQL database. The Postman collection provides examples for testing the API endpoints.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages