Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Express API

This project is a RESTful API built with Node.js and Express, designed to manage logistics centers. It utilizes MongoDB for data storage and implements JWT for authentication. The API is versioned to ensure backward compatibility.

Features

  • CRUD operations for logistics centers
  • JWT authentication for secure access
  • Versioned API routes

Project Structure

node-express-api
├── src
│   ├── controllers          # Contains controllers for handling requests
│   ├── models               # Contains Mongoose models
│   ├── routes               # Contains route definitions
│   ├── middlewares          # Contains middleware functions
│   ├── utils                # Contains utility functions
│   ├── app.js               # Initializes the Express application
│   └── server.js            # Starts the server
├── config                   # Configuration files
│   └── db.js                # MongoDB connection configuration
├── package.json             # NPM package configuration
├── .env                     # Environment variables
├── .gitignore               # Files to ignore in Git
└── README.md                # Project documentation

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd node-express-api
    
  2. Install dependencies:

    npm install
    
  3. Create a .env file in the root directory and add your MongoDB connection string and JWT secret:

    MONGODB_URI=<your_mongodb_connection_string>
    JWT_SECRET=<your_jwt_secret>
    

Usage

  1. Start the server:

    npm start
    
  2. The API will be running on http://localhost:4000.

API Endpoints

Logistics Centers

  • GET /api/v1/logistics-centers: Retrieve all logistics centers
  • GET /api/v1/logistics-centers/:id: Retrieve a logistics center by ID
  • POST /api/v1/logistics-centers: Create a new logistics center
  • PUT /api/v1/logistics-centers/:id: Update an existing logistics center
  • DELETE /api/v1/logistics-centers/:id: Delete a logistics center

Contributing

Feel free to submit issues or pull requests for improvements or bug fixes.

License

This project is licensed under the MIT License.

About

RESTful API for managing logistics centers, products, stock alerts, and route data, built with Node.js, Express, and MongoDB.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages