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.
- 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.
-
Git - Download & Install Git. OSX and Linux machines typically have this already installed.
-
Node.JS - Download & Install Node.JS, and the npm package manager.
-
PostgresQL - Download & Install PostgresQL, and make sure it's running on the default port (27017).
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
To start the application, use the following command:
npm run dev
If you would like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
This project is MIT License.
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
);
CREATE TABLE units (
id SERIAL PRIMARY KEY,
unit VARCHAR(50) UNIQUE NOT NULL,
name VARCHAR(255) NOT NULL,
note TEXT
);
CREATE TABLE suppliers (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
address TEXT,
phone VARCHAR(50)
);
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
);
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
);
CREATE TABLE sales (
id SERIAL PRIMARY KEY,
customer VARCHAR(255),
operator VARCHAR(255) NOT NULL
);
CREATE TABLE purchases (
id SERIAL PRIMARY KEY,
supplier VARCHAR(255),
operator VARCHAR(255) NOT NULL
);
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
);
CREATE TABLE customers (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
address TEXT,
phone VARCHAR(50)
);
CREATE TABLE auth (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL
);
If you have any questions or issues, please open an issue at the issue tracker