Giter Site home page Giter Site logo

inventory-api-go's Introduction

Go Inventory API

Overview

Go Inventory API is an open-source RESTful API designed for efficient inventory management. It provides functionalities for managing suppliers, products, and categories. Leveraging the power of Go, Gorm, and Gin, it offers a robust backend solution for stock level monitoring and CRUD operations on inventory data.

Tech Stack

  • Go: The primary programming language used for developing the API.
  • Gin: A web framework used for routing and middleware.
  • Gorm: An ORM library for Go, used for database operations.
  • Database: I recommend using Neon.tech's managed PostgreSQL database for storing inventory data.

Features

  • Stock checking for specific products.
  • Listing out-of-stock and low-stock products.
  • CRUD operations for suppliers, categories, and products.

API Endpoints

Suppliers

  • List all suppliers: GET /api/v1/suppliers
  • Create a new supplier: POST /api/v1/suppliers
  • Get a supplier by ID: GET /api/v1/suppliers/:id
  • Update a supplier by ID: PUT /api/v1/suppliers/:id
  • Delete a supplier by ID: DELETE /api/v1/suppliers/:id
  • Get products by supplier ID: GET /api/v1/suppliers/products/:supplierId

Categories

  • List all categories: GET /api/v1/categories
  • Create a new category: POST /api/v1/categories
  • Get a category by ID: GET /api/v1/categories/:id
  • Update a category by ID: PUT /api/v1/categories/:id
  • Delete a category by ID: DELETE /api/v1/categories/:id

Products

  • List all products: GET /api/v1/products
  • Create a new product: POST /api/v1/products
  • Get a product by ID: GET /api/v1/products/:id
  • Update a product by ID: PUT /api/v1/products/:id
  • Delete a product by ID: DELETE /api/v1/products/:id
  • Check stock for a product: GET /api/v1/suppliers/{supplierId}/products/{productId}/stock
  • List out-of-stock products: GET /api/v1/products/out-of-stock
  • List low-stock products: GET /api/v1/products/low-stock

Getting Started

These instructions will get you a copy of the project up and running on your local machine or in a Docker container for development and testing purposes.

Prerequisites

  • Go (Version 1.22)
  • Docker (if running the application in a Docker container)
  • Gorm
  • Gin

Installing and Running Locally

  1. Clone the repository to your local machine:

    git clone https://github.com/russelldias98/inventory-api-go.git

Running with Docker

To containerize the Go Inventory API, follow these steps using Docker:

  1. Build the Docker image: This step compiles your application into a Docker image. Replace <your-image-name> with your preferred image name.

    docker build -t <your-image-name> .
  2. Run the Docker container: This step compiles your application into a Docker image. Replace <your-image-name> with your preferred image name.

docker run -p 3000:3000 <your-image-name> .

After executing these steps, your Go Inventory API should be running inside a Docker container and accessible via http://localhost:3000.

Contributing

We welcome contributions to make this project even better. There are several ways you can contribute:

  • Reporting bugs.
  • Suggesting enhancements.
  • Submitting pull requests.

Acknowledgments

  • Gorm for the ORM support.
  • Gin for the web framework.
  • All contributors and supporters of the project.

inventory-api-go's People

Contributors

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