Skip to content
/ pos Public

Point of Sale Application, develop with expressjs and postgresql

License

Notifications You must be signed in to change notification settings

aryajava/pos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Point of Sales (POS)

Introduction

This is a simple full stack application designed to help record sales and purchases in stores. It is built using modern web technologies to ensure efficiency and scalability.

Technologies

Backend

ExpressJS PostgresQL Node.JS Socket.IO

Frontend

EJS JQuery Bootstrap DataTables

Features

  • User authentication and authorization: Secure login and role-based access control.
  • Record sales and purchases: Track sales and purchase transactions.
  • Manage customers, suppliers, goods, and units: CRUD operations for managing customers, suppliers, goods, and units.
  • Generate and export reports in various formats: Create and export reports in formats like CSV, Excel, etc.
  • Real-time notifications using Socket.IO: Receive real-time alerts and updates.
  • Responsive design using Start Bootstrap - SB Admin 2: Mobile-friendly and responsive UI design.
  • Data validation and error handling: Ensure data integrity and handle errors gracefully.
  • File uploads and image processing with Sharp: Upload files and process images efficiently.
  • Flash messages for user feedback: Display success and error messages to users.
  • DataTables for responsive tables: Use DataTables for interactive and responsive tables.
  • Select2 for enhanced select boxes: Enhance select boxes with search and multi-select capabilities.

Table of Contents

Prerequisites

Installation

To install the dependencies, run the following command:

npm install

Create a .env file in the root of your project and add the following lines:

DB_HOST=your_db_host_here
DB_PORT=your_db_port_here
DB_NAME=your_db_name_here
DB_USER=your_db_user_here
DB_PASSWORD=your_db_password_here
SESSION_SECRET=your_session_secret_here

Usage

To start the application, use the following command:

npm run dev

Contributing

If you would like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

License

This project is MIT License.

Database Structure

User Table

CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  name VARCHAR(255) NOT NULL,
  password VARCHAR(255) NOT NULL,
  role VARCHAR(50) NOT NULL
);

Unit Table

CREATE TABLE units (
  id SERIAL PRIMARY KEY,
  unit VARCHAR(50) UNIQUE NOT NULL,
  name VARCHAR(255) NOT NULL,
  note TEXT
);

Supplier Table

CREATE TABLE suppliers (
  id SERIAL PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  address TEXT,
  phone VARCHAR(50)
);

SaleItem Table

CREATE TABLE sale_items (
  id SERIAL PRIMARY KEY,
  invoice VARCHAR(50) NOT NULL,
  itemcode VARCHAR(50) NOT NULL,
  quantity INTEGER NOT NULL,
  sellingprice DECIMAL(10, 2) NOT NULL,
  totalprice DECIMAL(10, 2) NOT NULL
);

PurchaseItem Table

CREATE TABLE purchase_items (
  id SERIAL PRIMARY KEY,
  invoice VARCHAR(50) NOT NULL,
  itemcode VARCHAR(50) NOT NULL,
  quantity INTEGER NOT NULL,
  purchaseprice DECIMAL(10, 2) NOT NULL,
  totalprice DECIMAL(10, 2) NOT NULL
);

Sale Table

CREATE TABLE sales (
  id SERIAL PRIMARY KEY,
  customer VARCHAR(255),
  operator VARCHAR(255) NOT NULL
);

Purchase Table

CREATE TABLE purchases (
  id SERIAL PRIMARY KEY,
  supplier VARCHAR(255),
  operator VARCHAR(255) NOT NULL
);

Goods Table

CREATE TABLE goods (
  id SERIAL PRIMARY KEY,
  barcode VARCHAR(50) UNIQUE NOT NULL,
  name VARCHAR(255) NOT NULL,
  stock INTEGER NOT NULL,
  purchaseprice DECIMAL(10, 2) NOT NULL,
  sellingprice DECIMAL(10, 2) NOT NULL,
  unit VARCHAR(50) NOT NULL,
  picture TEXT
);

Customer Table

CREATE TABLE customers (
  id SERIAL PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  address TEXT,
  phone VARCHAR(50)
);

Auth Table

CREATE TABLE auth (
  id SERIAL PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  password VARCHAR(255) NOT NULL
);

Contact

If you have any questions or issues, please open an issue at the issue tracker