Senzura POS is a simple Point of Sale (POS) system built with Electron, Node.js, and MySQL. It provides basic functionalities for managing products, customers, processing sales, and generating reports.
- User Authentication: Secure login and registration for users.
- Product Management: Add, view, edit, and delete products with category support.
- Customer Management: Add, view, edit, and delete customer records.
- Point of Sale (POS): Intuitive interface for processing sales, adding products to cart, adjusting quantities, and calculating totals.
- Order Processing: Process orders and save transaction details to the database.
- PDF Receipt Generation: Automatically generate PDF receipts for completed orders.
- Sales Reports: View key sales metrics, including total revenue, total orders, total products sold, and top-selling products (monthly sales and top 5 products).
- Navigation: Easy navigation between different sections of the application.
- Currency: All monetary values are displayed in
Rs(Rupees).
- Electron: For building cross-platform desktop applications with web technologies.
- Node.js: Backend runtime for handling database interactions and business logic.
- MySQL: Relational database for storing application data (users, products, categories, customers, orders, order items).
- HTML/CSS (Tailwind CSS): For the user interface and styling.
- JavaScript: For frontend interactivity and backend logic.
- Chart.js: For creating interactive sales charts in the reports section.
- mysql2: MySQL client for Node.js.
Follow these steps to set up and run the Senzura POS system on your local machine.
- Node.js (LTS version recommended)
- MySQL Server
-
Create a MySQL Database: Open your MySQL client (e.g., MySQL Workbench, command line) and create a new database. The application expects a database named
senzura_pos.CREATE DATABASE senzura_pos; USE senzura_pos;
-
Create Tables: Execute the SQL queries from the
database_schema.sqlfile (which should be in your project root) to create the necessary tables. This file contains schemas forusers,categories,products,customers,orders, andorder_items.-- Example content from database_schema.sql CREATE TABLE categories ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL UNIQUE ); CREATE TABLE products ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, price DECIMAL(10, 2) NOT NULL, category_id INT, image_path VARCHAR(255), FOREIGN KEY (category_id) REFERENCES categories(id) ); CREATE TABLE customers ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, email VARCHAR(255) UNIQUE, phone VARCHAR(50) ); CREATE TABLE orders ( id INT AUTO_INCREMENT PRIMARY KEY, customer_id INT, total_amount DECIMAL(10, 2) NOT NULL, order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (customer_id) REFERENCES customers(id) ); CREATE TABLE order_items ( id INT AUTO_INCREMENT PRIMARY KEY, order_id INT, product_id INT, quantity INT NOT NULL, price_per_unit DECIMAL(10, 2) NOT NULL, FOREIGN KEY (order_id) REFERENCES orders(id), FOREIGN KEY (product_id) REFERENCES products(id) ); CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(255) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL );
-
Configure Database Connection: Ensure your
main/db.jsfile has the correct database connection details (host, user, password, database name).// main/db.js const mysql = require("mysql2"); const connection = mysql.createConnection({ host: "localhost", // Your MySQL host user: "root", // Your MySQL username password: "root", // Your MySQL password database: "senzura_pos", }); connection.connect((err) => { if (err) throw err; console.log("✅ Connected to MySQL"); }); module.exports = connection;
-
Clone the repository:
git clone <repository_url> cd Senzura/POS
-
Install Dependencies:
npm install
To start the Electron application, run:
npm start- Login/Register: The application will start on the login page. You can register a new user or use existing credentials.
- Dashboard (POS): After logging in, you'll be directed to the POS dashboard. Here you can:
- Search for products.
- Filter products by category.
- Add products to the cart.
- Adjust product quantities in the cart.
- Process payments (generates a PDF receipt on your desktop).
- Cancel orders.
- Products Tab: Manage your product inventory.
- Customers Tab: Manage customer information.
- Reports Tab: View sales statistics and charts.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open-source and available under the MIT License.