Skip to content

Instantly share code, notes, and snippets.

@suhailvs
Last active March 29, 2021 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suhailvs/3c1d6b42824d1eb4672813068c0f5164 to your computer and use it in GitHub Desktop.
Save suhailvs/3c1d6b42824d1eb4672813068c0f5164 to your computer and use it in GitHub Desktop.

ESell

1.1 Complete Module wise explanation

Control Panel

  • Users - Create users. Need username, password, First name, Last name etc. These users can login to our site.
  • Roles - eg: Agent, Employee, Admin etc
  • User Roles: Assign roles to users. eg: Arun(user) -> Agent(role), Lavanya(user) -> Agent(role)
  • Sync Menu: Create new modules and menus

Billing

  • Customers - Create customers that can be added in billing
  • Customer Import - To Import Customers as CSV
  • Bill Entry - Billing Screen
  • Bill Return - For return of billing

Purchase

  • Purchase Return
  • Purchase Entry: Purchase Screen
  • Product Stock
  • Suppliers - Create Suppliers that can be added in purchase
  • Import Suppliers - To Import Suppliers as CSV
  • Change Stock - Change stock of products

Products

  • Items: create products
  • Import Products - CSV import Products
  • Cess - Cess taxes like: Kerala Flood cess, Corona Cess
  • Export - Product CSV Export
  • Unit of measure - Different types of units such as: Piece, Bundle. This can be used for products such as A4 paper(eg: 1 Bundle=500 pieces of A4 paper)
  • Unit Conversions - eg: 1bundle = 500 pieces for A4, 1budle = 50 pieces for Lexi pen etc)

Outlets

  • Locations
  • Outlets

Accounts

  • Accounts Ledger -
  • Daily Account Closing

Agents

  • Agents - Create Agents. These agents can login to our system using their mobile number
  • Item Stocks - view stock of Prodects
  • Agent Orders
  • Agent Employee - Employees under agent

Expense

  • Expense Masters -
  • Expenses - Expeses for agents
  • Expense Report

Reports

  • Pdf Reports - Sales Register, Sales Summary, HSN Summary, Registered Customers as PDF
  • Physical Stock Register - Sales, purchase, opening balance, closing balance of a daterange as numbers
  • Balance Sheet
  • Stock and Financial Reports - Sales, purchase, opening balance, closing balance of a daterange as Amount
  • GST Reports - Gst wise reports as PDF
  • Expired Products
  • Most Selling Products in Number - Bar Chart
  • Most Selling Products in Revenue - Bar Chart
  • Outlet Wise Sales - Pie chart with drill down
  • Product Wise Sales - Pie chart with drill down
  • Time Series Graph
  • Reoder Level

1.2 Technical Architecture Followed

Deployment Architecture

  • Django API gateway is currently deployed in a Digital Ocean on Linux OS with Apache. Each App is deployed in different droplets of Digital Ocean to improve the availability of the gateway.

Backend:

If you want to have a quick look or just run the project locally, you can get started by either forking this repository or just cloning it directly:

git clone git@gitlab.com:DonamsInnovations/esell-backend.git
cd esell-backend

create a virtualenv and install the projects dependencies:

pip install -r requirements.txt

Create a local database:

python manage.py migrate

Start development server:

python manage.py runserver

Data Architecture

  • Data is stored in PostgresSQL db in respective droplets of Digital Ocean.

1.3 Technical Documentation

Permission and Roles

UI (User interface)

  • Angular 8 (Need to upgrade to angular 11)

Login pages and error pages are controlled by main controller

All the rest of the pages are controlled by Layout module.

We have three separate part in Layout module: Menu Side bar, Top navbar and Content layer. We use bootstrap3( Need to upgrade to Bootstrap 5). Ngx bootstrap for dropdowns and modals. Font Awesome for Icons.

Data Layer

  • The Data layer. The data is managed by Postgres.

  • Tables: Agents, Users, UserRole, Role, Purchase, PurchaseItems, Billings, BillingItems, SystemConfig

schema

Backend

  • Django 2.2 we use Django Rest Framework for create api endpoint for Angular app.

Installations

apache2, python3.6+, python3-pip, virtualenv, libapache2-mod-wsgi-py3, postgresql, postgresql-contrib

Migrate and Populate Database

python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py createadminuser
python3 manage.py populatedb

Digitalocean Setup

$ apt-get update
$ apt-get install python3-pip apache2 libapache2-mod-wsgi-py3
$ apt install libpq-dev

Change dir: $ cd /var/www/ Clone the repo: $ git clone https://gitlab.com/DonamsInnovations/esell-backend.git backend Change dir: $ cd backend Create virtual and install django::

$ apt install python3-pip
$ pip3 install virtualenv
$ virtualenv --python=/usr/bin/python3.8 venv
$ source venv/bin/activate	
$ apt-get install build-essential python3-dev python3-pip python3-setuptools python3-wheel python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info libpq-dev
$ pip install -r requirements.txt

Install PostgreSQL::

$ apt-get install postgresql postgresql-contrib
$ sudo -u postgres psql
ALTER USER postgres WITH PASSWORD 'rootVidhyaDhan123#!';
create database vidhyadhanbackend;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
\q

VirtualHost::

$ vim /etc/apache2/sites-available/yearns_backend.conf 
<VirtualHost *:80>
	ServerName yearnsapi.donams.com
    WSGIDaemonProcess yearnsapp python-home=/var/www/yearns.donams.com/backend/venv python-path=/var/www/yearns.donams.com/backend
    WSGIProcessGroup yearnsapp
    WSGIPassAuthorization On
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptAlias / /var/www/yearns.donams.com/backend/backend/wsgi.py
    ErrorLog /var/www/yearns.donams.com/backend/error.log
    CustomLog /var/www/yearns.donams.com/backend/access.log combined
</VirtualHost>

Give Permission to Logs folder and l.log file:

chmod 777 logs
cd logs 
chmod 777 l.log

restart apache::

$ a2ensite backend.conf
$ service apache2 restart

to test celery::

celery -A backend worker -l info -B
celery -A backend worker -l info -B --concurrency=1

to see process ps aux | grep celery

to kill celery pkill -9 -f 'celery'

Celery Installation

Install Rabbitmq:

$ echo 'deb http://www.rabbitmq.com/debian/ testing main' |
     sudo tee /etc/apt/sources.list.d/rabbitmq.list

$ apt-get update
$ apt-get install rabbitmq-server

To run on mac :

/usr/local/sbin/rabbitmq-server

Daemonization here is a nice tutorial

$ apt-get install supervisor

Then, add /etc/supervisor/conf.d/celery_proj_worker.conf file Also add /etc/supervisor/conf.d/celery_proj_beat.conf file super visor logs can be found in:

/var/log/supervisor/

update change for supervisor:

$ supervisorctl reread
$ supervisorctl update

Finally we can start the services :

$ supervisorctl start projworker
$ supervisorctl start projbeat

or even check the status/stop/restart:

$ supervisorctl stop projworker
$ supervisorctl restart projworker
$ supervisorctl status projworker

1.4 Modules which are Stable / not released

Stable Not released for H&C
Users Balance Sheet
Roles Locations
User Roles Reoder Level
Sync Menu Outlets
Customers Accounts Ledger
Customer Import Daily Account Closing
Bill Entry Agent Orders
Purchase Entry Agents
Product Stock Item Stocks
Suppliers Agent Employee
Import Suppliers Expense Masters
Items Expenses
Cess Expense Report
Product CSV Export Expired Products
Pdf Reports Most Selling Products in Number
Physical Stock Register Most Selling Products in Revenue
Stock and Financial Reports Outlet Wise Sales
GST Reports Product Wise Sales
Bill Return
Purchase Return
Change Stock
Import Products
Unit of measure
Unit Conversions
Time Series Graph

1.5 Ongoing fixes

  • Stock Valuation Report - From Date to To Date (Last Purchase Rate) -
  • Stock Valuation Report - Search Based on Tax Rate (0,5,12,18,28) - Add Tax Column in the report
  • Stock and Financial - PDF Print
  • Stock and Financial - Add Item Name
  • Stock and Financial - PDF print - Min 40+, Add Maximum items per page -
  • Every Report - Header should be neat -
  • Non Billable Items - Bill Entry - Show in a different color -
  • Non - Billable Items - Re-Test
  • Non - Billable Items - Re-Test on Reports and Total Amount -
  • Item Stock - PDF Print (Min 40+, Add Maximum items per page ), Item Search Option, Add Data Table
  • HandC - ESell - New Database - Initial Stock 1000 - Initial Stock Rate based on Whole Sale Rate
  • Initial Stock Update - Stock Update - Add Rate (0 Rates will be updated with new rate, if no rate it will not update)
  • Physical Stock - PDF Print -
  • Get Non-Billable Items Info -
  • Not Billable Items - Duplicate and Mark with Non Billable - Item Name - Add a flag [NON-B]
  • Get Estimate Bill/Report -
  • Non-Billable Items should go to Estimate Bill -
  • New DB should set by March 30
  • Give Copy Reports - Stock Valuation report, Item Wise Stock Report, Tax wise report - (Last whole sale rate)

1.6 Client base

  • H and C Store, kunnamkulam

1.7 handling service request from the client

  1. Ticket based service queries for the client
  2. QA/QC should get the service queries from the client
  3. QA/QC will internally communicate with the development team and sales team
  4. Development team will take immediate actions on the ticket and will try to solve the queries in the prescribed deadlines
  5. After proper testing and make sure that the patch is stable, then it will release to the client
  6. QA/QC will close the ticket on confirmation with th

1.8 communication with the client

  1. Frequent communication channel will be provisioned by the QA/QC team
  2. Different questions on the usage of the application will be asked and discussed with the client as per their convenience
  3. Maintain a friendly atmosphere with the client to make themselves as well as ourselves comfortable in all respects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment