Skip to content

AshfaqueSami2/Sam-Nursury-Backend

Repository files navigation

SamNursury Backend

Backend

This is the backend of the Project Name. It is built using Node.js, Express.js, and MongoDB.

Table of Contents

Installation

Prerequisites

  • Node.js (v14.x or later)
  • MongoDB (v4.x or later)
  • npm (v6.x or later)

Setup

  1. Clone the repository:
    git clone https://github.com/your-username/your-backend-repository.git
    cd your-backend-repository
    
npm install

PORT=5000
MONGO_URI=your_mongodb_uri

npm run start:dev
The server will start on http://localhost:5000.

API Endpoints

Products

.GET /api/products - Get all products

.GET /api/products/ - Get a product by ID

POST /api/products - Create a new product

PUT /api/products/ Update a product by ID

DELETE /api/products/ Delete a product by ID

Orders

GET /api/orders - Get all orders

GET /api/orders/ Get an order by ID POST /api/orders - Create a new order

PUT /api/orders/ Update an order by ID

DELETE /api/orders/ Delete an order by ID (protected route)

Environment Variables

PORT - Port number for the server to run on (default: 5000)

MONGO_URI - MongoDB connection string

Contributing

Fork the repository

Create your feature branch (git checkout -b feature/your-feature)

Commit your changes (git commit -m 'Add some feature')

Push to the branch (git push origin feature/your-feature)

Open a pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published