Code Monkey home page Code Monkey logo

martikk / warehouse-backend Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 753 KB

The InStock backend is a RESTful API built with Node.js, Express.js, and MySQL. It manages warehouses and inventory with CRUD operations, validation, and error handling. Using Knex.js for database interaction, it supports environment-based configuration, migrations, and seed data.

Home Page: https://www.youtube.com/watch?v=_kAHgS-aRPc

JavaScript 100.00%
api-client api-rest warehouse warehouse-management warehouse-management-system node node-js nodejs warehouses

warehouse-backend's Introduction

warehouse-backend

Welcome to the official video repository of Warehouse . Visit the video link: Warehouse-Instock.

Dreamy Dates Website Dreamy Dates Website

Table of Contents

Introduction

The InStock backend is a RESTful API designed to manage warehouses and inventory items. It provides endpoints for CRUD operations on warehouses and inventory, with validation and error handling mechanisms.

Features

  • CRUD operations for warehouses and inventory items.
  • Validation for request bodies.
  • Error handling for common scenarios.
  • Environment variable configuration for database and server settings.

Technologies Used

  • Node.js
  • Express.js
  • Knex.js
  • MySQL (using mysql2 package)
  • dotenv for environment variables
  • validator for email validation
  • nodemon for development

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/instock-backend.git
    cd instock-backend
    1. Install dependencies:
    npm install

Environment Variables

Create a .env file in the root directory and configure the following variables:

PORT=3000
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=password
DB_NAME=your_database

API Endpoints

Warehouse Endpoints

  • GET /api/warehouses: Retrieve all warehouses.
  • GET /api/warehouses/ : Retrieve a specific warehouse by ID.
  • POST /api/warehouses: Create a new warehouse.
  • PUT /api/warehouses/ : Update an existing warehouse by ID.
  • DELETE /api/warehouses/ : Delete a warehouse by ID.
  • GET /api/warehouses/
  • /inventories: Retrieve inventories for a specific warehouse.
  • Inventory Endpoints GET /api/inventories: Retrieve all inventory items.
  • GET /api/inventories/ : Retrieve a specific inventory item by ID.
  • POST /api/inventories: Create a new inventory item.
  • PUT /api/inventories/ : Update an existing inventory item by ID.
  • DELETE /api/inventories/ : Delete an inventory item by ID.

Database Migrations and Seeds

To run migrations:

npx knex migrate:latest

To run seeds:

npx knex seed:run

warehouse-backend's People

Contributors

martikk avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

goddie2023

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.