crud-golang

📚 Book CRUD – Golang

This project is a simple application that facilitates CRUD operations (Create, Read, Update, Delete) for book data using the Go (Golang) programming language. It uses a JSON file for data storage, making it a great resource for learning backend development without the complexity of setting up a database.

📁 Project Structure

.
├── main.go            # Main entry point of the application
├── handler/           # HTTP request handlers
│   └── book.go
├── model/             # Data structure definition for Book
│   └── book.go
├── storage/           # Functions to read/write from JSON file
│   └── book.go
├── data/
│   └── books.json     # Book data storage file
├── static/            # Static files (HTML, CSS, JS if needed)

🚀 Getting Started

  1. Clone the repository:

    git clone https://github.com/seaavey/crud-golang
    cd crud-golang
    
  2. Run the application:

    go run main.go
    
  3. Open your browser and go to:

    http://localhost:8080
    

🔗 API Endpoints

Method Endpoint Description
POST /books Add a new book
GET /books Retrieve all book data
GET /books/{id} Retrieve a specific book by ID
PUT /books/{id} Update a book
DELETE /books/{id} Delete a book by ID

📝 Sample Book Data (JSON Format)

{
  "id": "1",
  "title": "Learn Golang",
  "author": "John Doe"
}

â„šī¸ Additional Notes

âš™ī¸ Technologies Used


📄 License

This project is licensed under the MIT License – © 2025 Muhammad Adriansyah