Skip to content

omarsaab96/posBackend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POS System Backend

This is the backend for a Point of Sale (POS) system built using Node.js and Express.js. It provides RESTful APIs for managing products, orders, customers, and more. The backend connects to a MongoDB database for storing and retrieving data.

Features

  • CRUD operations for products.
  • Database integration with MongoDB.
  • Middleware for request parsing and cross-origin resource sharing (CORS).
  • Environment variable management with dotenv.

Technologies Used

  • Node.js: JavaScript runtime.
  • Express.js: Web framework for building RESTful APIs.
  • MongoDB: NoSQL database for data storage.
  • Mongoose: Object Data Modeling (ODM) library for MongoDB.
  • dotenv: For managing environment variables.
  • cors: Middleware for enabling Cross-Origin Resource Sharing.

Project Structure

pos-system-backend/
├── data/
│   ├── products.json  # Product data
│   ├── orders.json    # Order data
├── routes/
│   ├── productRoutes.js
├── controllers/
│   ├── productController.js
├── app.js
├── package.json

Setup Instructions

  1. Clone the Repository

    git clone https://github.com/your-username/pos-system-backend.git
    cd pos-system-backend
  2. Install Dependencies

    npm install
  3. Set Up Environment Variables
    Create a .env file in the root directory and add the following:

    MONGO_URI=mongodb+srv://username:[email protected]/pos-system?retryWrites=true&w=majority
    PORT=5000
    
  4. Run the Application
    For development (with auto-restart):

    npm run dev

    For production:

    npm start

API Endpoints

Products

Method Endpoint Description
GET /api/products Retrieve all products
POST /api/products Add a new product

Additional endpoints for orders, customers, etc., will be added as the project expands.

Future Enhancements

  • Add authentication using JWT for secure access.
  • Implement order and inventory management modules.
  • Add real-time updates with Socket.IO for live order tracking.
  • Integrate reporting tools for sales and inventory analysis.

Contributing

Contributions are welcome! Feel free to fork this repository and submit pull requests.

License

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


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published