Quick POS With Inventory Management


Hello everyone!

Thank you for purchasing solution. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

Quick Start Guide


Setting up Quick POS With Inventory Management is very simple. You will receive the following files after extracting project compressed file:

  • DotNet
    • Published: It contains the build files for both SQL Server and MySQL Provider which you can directly deploy to your server.
    • Souce Code: It contains the complete source code for front-end and REST API. There are different REST API folders for SQL Server and MySQL database providers.
  • Laravel

Hosting


Prerequisites

In Order to host the application on Windows or Linux Server even you don't need to create database manully. you just need to change the connection string and based on you connection setting database will be created automatically once application initialize.

Change Connection String

Change the connection in appsettings.json file as describe as below image:

Host on IIS Server:


  • Copy all files and folders from either MySQLProviderBuild or SqlServerProviderBuild from Build Folder and Paste at
    C:\inetpub\wwwroot\{{yoursitename}}
  • Open the IIS
  • Add New Website
  • Enter you site name
  • Copy C:\inetpub\wwwroot\{{yoursitename}} folder path to physical Path.
IIS Hosting

IIS Hosting

Steps to Host .NET 8 API with Nginx and MySQL on Linux Server


Prerequisites:

  • A Linux server (Ubuntu/Debian/CentOS, etc.)
  • Nginx installed on your Linux server
  • .NET 8 installed on your server
  • MySQL server installed
  • SSH access to the server

1. Install .NET 8 SDK/Runtime on the Server

a. Update the package lists:

sudo apt-get update

b. Install dependencies:

sudo apt-get install -y wget apt-transport-https software-properties-common

c. Add the Microsoft package signing key:

wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

d. Install the .NET SDK or Runtime:

For the SDK:

sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0

For the runtime only:

sudo apt-get install -y dotnet-runtime-8.0

2. Install MySQL

a. Install MySQL server:

sudo apt-get install mysql-server

b. Secure the MySQL installation:

Run the MySQL secure installation script to secure your MySQL installation. Follow the prompts to configure root password and security settings.

sudo mysql_secure_installation

c. Log in to MySQL as root:

sudo mysql -u root -p

3. Create a MySQL Database and User

a. Create a new database:

CREATE DATABASE posdb;

b. Create a new MySQL user and grant privileges:

CREATE USER 'posuser'@'localhost' IDENTIFIED BY '4@#l364R]XsR';
GRANT ALL PRIVILEGES ON posdb.* TO 'posuser'@'localhost';
FLUSH PRIVILEGES;

c. Exit MySQL:

EXIT;

4. Copy the Build Files to the Linux Server

Use SCP or FTP to copy files to your server. For example, with SCP:

scp -r ./build/ user@your-server-ip:/var/www/posapp

5. Install Nginx

If Nginx isn't installed, use the following commands:

sudo apt update
sudo apt install nginx

6. Configure Nginx as a Reverse Proxy

a. Open the Nginx configuration file for your site:

sudo nano /etc/nginx/sites-available/posapp

b. Add the following configuration to proxy traffic to your .NET app:

server {
    listen 80;
    server_name yourdomain.com;
                        
    location / {
        proxy_pass http://localhost:5000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
                        
    error_log /var/log/nginx/posapp-error.log;
    access_log /var/log/nginx/posapp-access.log;
}

c. Enable the configuration:

sudo ln -s /etc/nginx/sites-available/posapp /etc/nginx/sites-enabled/

d. Test the Nginx configuration:

sudo nginx -t

e. Restart Nginx to apply changes:

sudo systemctl restart nginx

7. Run the .NET App

a. Use systemd to create a service for your .NET app:

sudo nano /etc/systemd/system/posapp.service

b. Add the following content:

[Unit]
Description=posapp .NET Web API
After=network.target

[Service]
WorkingDirectory=/var/www/posapp
ExecStart=/usr/bin/dotnet /var/www/posapp/POS.API.dll
Restart=always
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-posapp
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target

c. Reload systemd and start the service:

sudo systemctl daemon-reload
sudo systemctl start posapp.service
sudo systemctl enable posapp.service

8. Open the Firewall (Optional)

sudo ufw allow 'Nginx Full'
sudo ufw reload

9. Verify

Visit http://yourdomain.com or http://your-server-ip in your browser to check if the .NET API is running.

Host .NET 8 API with Apache and MySQL on Linux Server


Prerequisites:

  • A Linux server (Ubuntu/Debian/CentOS, etc.)
  • Apache installed on your Linux server
  • .NET 8 installed on your server
  • MySQL server installed
  • SSH access to the server

1. Install .NET 8 SDK/Runtime on the Server

a. Update the package lists:

sudo apt-get update

b. Install dependencies:

sudo apt-get install -y wget apt-transport-https software-properties-common

c. Add the Microsoft package signing key:

wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

d. Install the .NET SDK or Runtime:

For the SDK:

sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0

For the runtime only:

sudo apt-get install -y dotnet-runtime-8.0

2. Install MySQL

a. Install MySQL server:

sudo apt-get install mysql-server

b. Secure the MySQL installation:

Run the MySQL secure installation script to secure your MySQL installation. Follow the prompts to configure root password and security settings.

sudo mysql_secure_installation

c. Log in to MySQL as root:

sudo mysql -u root -p

3. Create a MySQL Database and User

a. Create a new database:

CREATE DATABASE posdb;

b. Create a new MySQL user and grant privileges:

CREATE USER 'posuser'@'localhost' IDENTIFIED BY '@4"l364R]XsR';
GRANT ALL PRIVILEGES ON posdb.* TO 'posuser'@'localhost';
FLUSH PRIVILEGES;

c. Exit MySQL:

EXIT;

4. Copy the Build Files to the Linux Server

Use a tool like SCP or FTP to copy the build files to your Linux server. For example, with SCP:

scp -r ./build/ user@your-server-ip:/var/www/posapp

5. Install Apache

If Apache isn't installed, install it with the following commands (Ubuntu):

sudo apt update
sudo apt install apache2

6. Install and Configure mod_proxy

a. Enable the necessary modules for Apache to proxy requests to your .NET app:

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_wstunnel

b. Restart Apache to apply changes:

sudo systemctl restart apache2

7. Configure Apache to Reverse Proxy to Your .NET App

a. Create a new Apache virtual host file:

sudo nano /etc/apache2/sites-available/posapp.conf

b. Add the following configuration to proxy traffic from Apache to your .NET app:

<VirtualHost *:80>
    ServerName yourdomain.com

    ProxyPreserveHost On
    ProxyPass / http://localhost:5000/
    ProxyPassReverse / http://localhost:5000/

    ErrorLog ${APACHE_LOG_DIR}/posapp-error.log
    CustomLog ${APACHE_LOG_DIR}/posapp-access.log combined
</VirtualHost>

c. Enable the new virtual host and disable the default one:

sudo a2ensite posapp.conf
sudo systemctl reload apache2

8. Run the .NET App

a. Use a process manager like systemd to ensure the app runs in the background. Create a service file for your app:

sudo nano /etc/systemd/system/posapp.service

b. Add the following content:

[Unit]
Description=posapp .NET Web API
After=network.target

[Service]
WorkingDirectory=/var/www/posapp
ExecStart=/usr/bin/dotnet /var/www/posapp/POS.API.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-posapp
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target

c. Reload systemd and start your app:

sudo systemctl daemon-reload
sudo systemctl start posapp.service
sudo systemctl enable posapp.service

9. Verify

Visit http://yourdomain.com or http://your-server-ip in your browser. You should see your .NET API responding and interacting with the MySQL database.


Summary

You have successfully:

  • Installed .NET 8 SDK/Runtime on your Linux server.
  • Installed and secured MySQL, and created a database and user.
  • Published and deployed your .NET 8 API to the server.
  • Installed and configured Apache as a reverse proxy for your application.
  • Set up a systemd service to manage your .NET application.
  • Configured your application to connect to the MySQL database.

Your application is now up and running, accessible via your domain or server IP.

Running local copy


Prerequisites - .Net

.NET CORE 8 SDK and VISUAL STUDIO 2022, SQL SERVER or MySql 8 +

  • Based on your requirement choose the SQL or MySQL API in respective folder of source.
  • Open solution file POS.sln from .Net core folder into visual studio 2022.
  • Right click on solution explorer and Restore nuget packages.
  • Change database connection string in appsettings.Development.json in POS.API project.
  • From Solution Explorer, Right click on POS.API project and click on Set as Startup Project from menu.
  • To run project Press F5.

Prerequisites - Angular

Although POS can be run without any development experience, it would be much easier if you already have some experience. The following instructions allow you to run a local copy on your machine.

Install tools

If you have not yet installed nodejs, please Download and globally install nodejs : https://nodejs.org
Note: download Recommended For Most Users version

A detailed instruction on how to install NodeJS is available here.

Note: Make sure you have Node version >= 4.0 and NPM >= 3 . Also globally installed typescript.

Installing Angular-CLI globally is as simple as running this simple command: npm install -g @angular/cli

After the tools is installed, go inside of the Angular directory and run below command to install dependencies:

Run npm install -f to install node dependencies defined in package.json.

Running local copy

To run a local copy in development mode, replace REST API URI (apiUrl) variable in environment file inside src --> environments -->environment.ts

execute ng serve and go to http://localhost:4200 in your browser.

To run the local copy in production mode and build the sources, execute ng build. This will builds a production version of the application. All html,css and js code is minified and put to dist folder. The contents of this folder you can to put to your production server when publishing the application.

Configuration


  • Users:
    In the initial Script two user has been created as below: [email protected] is Admin user and using this account you can add more users.
  • SMTP Settings:
    In order to send email You need to configure the Default SMTP Settings under the Admin Area.
  • Company Settings:
  • Change Title, Currency, Billing Address, Phone Number and Email from Company Profile inside the Setting.
    Company Profile

Re-deploy the Changes After Customization on the server.


Build .Net Project

  • Publish the dotnet project.
  • For the front-end, create the ClientApp folder inside the Publish folder.
Build Angular Project
  • Run npm run build that will create dist/posadminportal foder.
  • copy all the files & folders inside dist/posadminportal and past it into ClientApp(created in step-2) folder.
  • Now, Copy Publish Folder into your server.

.Net Core Project Structure


The project structure is as follows:

POS.sln/                * Projects Solution
│   │
│   ├──POS.API                  * REST API Controller, Dependancy configuration, Auto mapper profile 
│   │
│   ├──POS.MediatR              * Command handler, Query handler, Fluent API validation
│   │
│   ├──POS.Repository           * Each entity repository
│   │
│   ├──POS.Domain               * Entity framework dbContext 
|   |
│   ├──POS.Common               * Generic repository and Unit of work patterns
│   │ 
│   ├──POS.Data                 * Entity classes and DTO classes
│   │
│   ├──POS.Helper               * Utility classes

Support and Feedback


All questions you can send via the contact form HERE.

I will answer all questions within 24-48h in the order they were received.

Please do not panic if I do not answer too long – I love my buyers and I’ll answer for all questions ;)

Support for my items includes:

  • Answering questions about how to use the item.
  • Answering technical questions about the item (and included third party assets).
  • Help with defects in the item or included third party assets.
  • Item updates to ensure ongoing compatibility and to resolve security vulnerabilities.

Item support does not include:

  • Installation of the item.
  • Hosting, server environment, or software.
  • Support for third party plug-ins.
  • Plugins integration.
  • Support for issues caused by user modifications in the solution’s code, styling and general functionality.

More information about the terms of support you can see here: https://themeforest.net/page/item_support_policy

Conclusion


Thank you for your purchase!

Thanks for reading the Instruction, hope it’s been really helpful and resolved most of your concerns.


Don’t forget to rate if you enjoy the product! It is very important for us to have certain goal.