GithubHelp home page GithubHelp logo

golang_rest_api's Introduction

Rest API - Golang Project

This is a sample RESTful API project built using Golang, featuring book categories and user entities. The application supports CRUD operations for managing categories, users, and books. The project is dockerized and utilizes PostgreSQL as its database.

Table of Contents

Getting Started

To get started with this project, follow the steps below:

  1. Clone the repository:

    git clone https://github.com/your-username/rest_api_sample.git
    cd rest_api_sample
    
  2. Set up your database: PostgreSQL database and update the database configuration in the config/config.go file.

  3. Dockerize the API:

    docker build -t my-api
    
  4. Compose up the docker-compose.yml

    docker-compose up -d
    
    

API Documentation

Category Endpoints

  • GET /category: Retrieve all categories.
  • GET /category/{id}: Retrieve a specific category by ID.
  • POST /category: Create a new category.
  • PUT /category/{id}: Update a category by ID.
  • DELETE /category/{id}: Delete a category by ID.

User Endpoints

  • GET /user: Retrieve all users.
  • GET /user/{id}: Retrieve a specific user by ID.
  • POST /user: Create a new user.
  • PUT /user/{id}: Update a user by ID.
  • DELETE /user/{id}: Delete a user by ID.

Book Endpoints

  • GET /book: Retrieve all books.
  • GET /book/{id}: Retrieve a specific book by ID.
  • POST /book: Create a new book.
  • PUT /book/{id}: Update a book by ID.
  • DELETE /book/{id}: Delete a book by ID.

Swagger Implementation

The API documentation is available using Swagger. Visit /swagger/index.html after running the application to explore and interact with the API. The application will be accessible at localhost.

License

This project is licensed under the MIT License.

golang_rest_api's People

Contributors

furkandogmus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.