Skip to content

Node.js server for managing products and clients with MongoDB CRUD operations.

Notifications You must be signed in to change notification settings

zeon-X/rich-cotton-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Server with MongoDB - CRUD Operations

This is a simple Node.js server application that provides CRUD (Create, Read, Update, Delete) operations for managing products and clients in a MongoDB database.

Table of Contents

  • Getting Started
    • Prerequisites
    • Installation
  • Project Structure
  • Usage
    • Starting the Server
    • API Endpoints
  • Technologies Used
  • Contributing
  • License

Getting Started

Prerequisites

Before you begin, ensure you have the following installed on your machine:

Installation

  1. Clone this repository to your local machine:

  2. Install project dependencies:

Project Structure

The project is organized into the following directories:

  • controllers: Contains controller functions for CRUD operations.
  • models: Defines Mongoose models for products and clients.
  • routes: Defines Express routes for handling API requests.
  • index.js: Sets up the Express application and connects to MongoDB.

Usage

Starting the Server

To start the server, run the following command in your project directory:

The server will be running on port 3000 by default.

API Endpoints

  • Products

    • Create a new product: POST /product
    • Get all products: GET /product/get
    • Get a single product by ID: GET /product/:id
    • Update a product by ID: PUT /product/update/:id
    • Delete a product by ID: DELETE /product/:id
  • Clients

    • Create a new client: POST /client
    • Get all clients: GET /client/get
    • Get a single client by ID: GET /client/:id
    • Update a client by ID: PUT /client/update/:id
    • Delete a client by ID: DELETE /client/:id

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • Cors
  • dotenv
  • nodemon

Contributing

Contributions are welcome! If you'd like to contribute to this project, please fork the repository and create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Node.js server for managing products and clients with MongoDB CRUD operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published