Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhurtado714-itesm/go-rest-api
https://github.com/dhurtado714-itesm/go-rest-api
docker gin-gonic golang mariadb
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dhurtado714-itesm/go-rest-api
- Owner: DHurtado714-itesm
- Created: 2024-09-14T17:46:25.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-14T17:49:28.000Z (5 months ago)
- Last Synced: 2025-02-10T23:54:16.215Z (4 days ago)
- Topics: docker, gin-gonic, golang, mariadb
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📚 Book Management API with Go and MariaDB
Welcome to the **Book Management API**! This is a simple RESTful API built with [Go](https://golang.org/) and [Gin](https://github.com/gin-gonic/gin) that allows you to manage a collection of books using a MariaDB database. 🚀
## 🛠️ Features
- 📖 **Get All Books**: Retrieve a list of all books in the collection.
- ➕ **Add a New Book**: Add a new book to the collection.
- ✏️ **Edit a Book**: Update the details of an existing book.
- ❌ **Delete a Book**: Remove a book from the collection.## 🚀 Getting Started
### Prerequisites
Before you begin, make sure you have the following installed:
- [Go](https://golang.org/dl/) (version 1.18 or later)
- [Docker](https://www.docker.com/get-started) (to run MariaDB)
- [Git](https://git-scm.com/)### 🔧 Installation
1. **Clone the Repository**
```bash
git clone https://github.com/your-username/book-management-api.git
cd book-management-api
```2. **Start MariaDB with Docker**
```bash
docker run --name book-db -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=bookdb -p 3306:3306 -d mariadb:latest
```3. **Run the Application**
```bash
go run main.go
```4. **Access the API**
The API will be available at `http://localhost:8080`.## 📚 API Endpoints
The following endpoints are available:
- **GET /books**: Retrieve a list of all books.
- **POST /books**: Add a new book.
- **PUT /books**: Update a book by ID.
- **DELETE /books/:id**: Delete a book by ID.