Code Monkey home page Code Monkey logo

warehouse-api's Introduction

RestAPI for a Parts Warehouse

Simple REST API for Parts Warehouse built with FastAPI and MongoDB.

Endpoints

Method Endpoint Input Action Output
POST /part {
"serial_number": [str],
"name": [str],
"description": [str],
"category": [str],
"quantity": [int],
"price": [float],
"location": {
   "room": [str],
   "bookcase": [str],
   "shelf": [int],
   "cuvette": [int],
   "column": [int],
   "row": [int]
   }
}
Add new part Part
GET /part/<part_id>/ Get part by its ID Part
PUT /part/<part_id>/ Selected fields from Add part endpoint.
Updating the 'location' field requires providing all subfields.
Update part details Part
DELETE /part/<part_id>/ Delete part -
GET /part/search Query params:
-serial_number [str]
-name [str]
-description [str]
-category [str]
-min_quantity [int]
-max_quantity [int]
-min_price [float]
-max_price [float]
-room [str]
-bookcase [str]
-shelf [int]
-cuvette [int]
-column [int]
-row [int]
Search parts by params List of parts that meet all provided criteria
GET /category Get all categories List of categories
POST /category {
"name": [str],
"parent_name": [str]
}
Add new category Category
GET /category/<category_id>/ Get category by its ID Category
PUT /category/<category_id>/ Selected fields from Add category endpoint. Update category details Category
DELETE /category/<category_id>/ Delete category -

Installation

1. Clone the repository.

git clone https://github.com/bartekbednarz013/warehouse-API.git

2. Navigate to the 'warehouse-API' directory.

cd warehouse-API

3. Build the container.

docker compose build

4. Run the container.

docker compose up

5. Go to http://127.0.0.1:8000/docs to conveniently browse the API.

warehouse-api's People

Contributors

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