Skip to content

Diliwije/devops-pos-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here is a comprehensive README.md file for your project, including all API endpoints, setup instructions, and project structure.

# DevOps POS System Backend

A robust Point of Sale (POS) system backend built with Node.js, Express, and MongoDB. This project includes features for user authentication, customer management, product tracking, and order processing.

## 🚀 Features
- **User Authentication**: Secure Sign-up and Login with JWT and Bcrypt hashing.
- **Customer Management**: Full CRUD operations for customer data.
- **Product Management**: Manage inventory, prices, and stock levels.
- **Order Processing**: Create and retrieve customer orders.
- **Security**: Middleware-protected routes for sensitive operations.

## 🛠️ Tech Stack
- **Runtime**: Node.js
- **Framework**: Express.js
- **Database**: MongoDB (Mongoose ODM)
- **Authentication**: JSON Web Token (JWT)
- **Security**: Bcrypt.js
- **Configuration**: Dotenv

## 📋 Prerequisites
- Node.js installed on your local machine.
- MongoDB Atlas account or local MongoDB instance.

## ⚙️ Installation & Setup

1. **Clone the repository:**
   ```bash
   git clone <your-repository-url>
   cd "devops pos system"
  1. Install dependencies:

    npm install
  2. Configure Environment Variables: Create a .env file in the root directory and add the following:

    SERVER_PORT=3000
    MONGO_URI=your_mongodb_connection_string
    JWT_SECERET=your_jwt_secret_key
  3. Run the application:

    node index.js

🔌 API Endpoints

🔐 User Routes (/api/v1/users)

Method Endpoint Description Auth Required
POST /signup Register a new user No
POST /login User login to receive JWT No

👥 Customer Routes (/api/v1/customers)

Method Endpoint Description Auth Required
POST /create Create a new customer Yes
PUT /update/:id Update customer by ID No
DELETE /delete/:id Delete customer by ID No
GET /find-by-id/:id Get specific customer No
GET /loadall Get all customers No

📦 Product Routes (/api/v1/products)

Method Endpoint Description Auth Required
POST /create Create a new product Yes
PUT /update/:id Update product details No
DELETE /delete/:id Delete product by ID No
GET /find-by-id/:id Get product details No
GET /load-all List all products No

🛒 Order Routes (/api/v1/orders)

Method Endpoint Description Auth Required
POST /create Place a new order Yes
GET /find-all Retrieve all orders No

Note: For endpoints where "Auth Required" is Yes, you must include the JWT token in the request header as:
Authorization: Bearer <your_token>

📂 Project Structure


devops pos system/
├── controller/      # Request handlers
├── middleware/      # Auth & custom middlewares
├── module/          # Mongoose schemas (Models)
├── routes/          # Express route definitions
├── .env             # Environment variables
├── index.js         # Entry point
└── package.json     # Project dependencies

📝 License

This project is licensed under the ISC License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors