├── public ├── images │ ├── logo.png │ ├── favicon.ico │ └── icons │ │ ├── fonts │ │ ├── maktro-ms.eot │ │ ├── maktro-ms.ttf │ │ └── maktro-ms.woff │ │ └── style.css ├── ui │ ├── MaktroAccount.bmpr │ └── MaktroAccount.pdf ├── fonts │ ├── Roboto-Italic.ttf │ ├── Roboto-Medium.ttf │ └── Roboto-Regular.ttf └── statics │ └── login.html ├── .env.example ├── screenshots ├── screenshot-00.png ├── screenshot-01.png ├── screenshot-02.png ├── screenshot-03.png ├── screenshot-04.png ├── screenshot-05.png ├── screenshot-06.png ├── screenshot-07.png ├── screenshot-08.png ├── screenshot-09.png └── screenshot-10.png ├── files ├── invoice │ ├── 5ee39382d8ae560548cf9d2a.pdf │ ├── 5ee393d3ad986f210436eab6.pdf │ ├── 5ee3b807ad986f210436eab7.pdf │ ├── 5ee3bf6eea7c482f007afad9.pdf │ ├── 5ee3bf99ea7c482f007afadb.pdf │ ├── 5ee3bfcaea7c482f007afadc.pdf │ ├── 5ee3c003ea7c482f007afade.pdf │ └── 5ee3c023ea7c482f007afadf.pdf └── servicing │ ├── 5ed851ca5fb550256c6eb17d.pdf │ ├── 5edad8a30e0d5e23e8a01507.pdf │ ├── 5ee227355b1dce222cf01d42.pdf │ ├── 5ee22837b89a1311004d426e.pdf │ └── 5ee22dc853eb5132b8ff319a.pdf ├── .prettierrc.json ├── routes ├── api │ ├── sale.js │ ├── user.js │ ├── entry.js │ ├── return.js │ ├── expense.js │ ├── servicing.js │ ├── api.rest │ ├── product.js │ ├── customer.js │ └── index.js ├── dashboard.js ├── inventory.js ├── auth.js ├── user.js ├── entry.js ├── return.js ├── expense.js ├── product.js ├── customer.js ├── sale.js ├── servicing.js └── index.js ├── middlewares ├── AuthHandler.js ├── PermissionHandler.js ├── Search.js ├── Validator.js └── ServicingGenerator.js ├── .eslintrc.json ├── views ├── permission.ejs ├── modules │ ├── _alert.ejs │ ├── _footer.ejs │ ├── _header.ejs │ ├── _delete-form.ejs │ ├── _search.ejs │ ├── _search_only_date.ejs │ ├── _search-with-date.ejs │ ├── _pagination.ejs │ └── _navs.ejs ├── expenses │ ├── index.ejs │ ├── _data.ejs │ └── _collect-form.ejs ├── users │ ├── index.ejs │ ├── _data.ejs │ └── _collect-form.ejs ├── products │ ├── index.ejs │ ├── _data.ejs │ └── _collect-form.ejs ├── returns │ ├── index.ejs │ ├── _data.ejs │ └── _collect-form.ejs ├── servicing │ ├── index.ejs │ ├── _data.ejs │ └── _collect-form.ejs ├── inventories │ ├── index.ejs │ ├── _data.ejs │ └── _collect-form.ejs ├── entries │ ├── index.ejs │ └── _data.ejs ├── customers │ ├── index.ejs │ ├── _search-form.ejs │ ├── _data.ejs │ └── _collect-form.ejs ├── login.ejs ├── sales │ ├── index.ejs │ ├── _balance-form.ejs │ ├── _data.ejs │ └── _collect-form.ejs └── dashboard │ ├── _overview_returns.ejs │ ├── _overview_inventory.ejs │ ├── index.ejs │ ├── _overview_expense.ejs │ └── _overview_sales.ejs ├── models ├── Entry.js ├── Product.js ├── Inventory.js ├── User.js ├── Return.js ├── Customer.js ├── Servicing.js ├── Sale.js └── Expense.js ├── LICENSE.md ├── package.json ├── controllers ├── AuthController.js ├── UserController.js ├── InventoryController.js ├── ProductController.js ├── EntryController.js ├── ServicingController.js ├── CustomerController.js ├── DashboardController.js ├── ExpenseController.js └── ReturnController.js ├── app.js ├── .gitignore └── README.md /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/images/logo.png -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/images/favicon.ico -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Rename the file as just `.env` and add your values here 2 | DATABASE_URI= 3 | PORT= 4 | SECRET_KEY= -------------------------------------------------------------------------------- /public/ui/MaktroAccount.bmpr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/ui/MaktroAccount.bmpr -------------------------------------------------------------------------------- /public/ui/MaktroAccount.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/ui/MaktroAccount.pdf -------------------------------------------------------------------------------- /screenshots/screenshot-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-00.png -------------------------------------------------------------------------------- /screenshots/screenshot-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-01.png -------------------------------------------------------------------------------- /screenshots/screenshot-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-02.png -------------------------------------------------------------------------------- /screenshots/screenshot-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-03.png -------------------------------------------------------------------------------- /screenshots/screenshot-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-04.png -------------------------------------------------------------------------------- /screenshots/screenshot-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-05.png -------------------------------------------------------------------------------- /screenshots/screenshot-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-06.png -------------------------------------------------------------------------------- /screenshots/screenshot-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-07.png -------------------------------------------------------------------------------- /screenshots/screenshot-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-08.png -------------------------------------------------------------------------------- /screenshots/screenshot-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-09.png -------------------------------------------------------------------------------- /screenshots/screenshot-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/screenshots/screenshot-10.png -------------------------------------------------------------------------------- /public/fonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/fonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /public/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /public/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /public/images/icons/fonts/maktro-ms.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/images/icons/fonts/maktro-ms.eot -------------------------------------------------------------------------------- /public/images/icons/fonts/maktro-ms.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/images/icons/fonts/maktro-ms.ttf -------------------------------------------------------------------------------- /public/images/icons/fonts/maktro-ms.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/public/images/icons/fonts/maktro-ms.woff -------------------------------------------------------------------------------- /files/invoice/5ee39382d8ae560548cf9d2a.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee39382d8ae560548cf9d2a.pdf -------------------------------------------------------------------------------- /files/invoice/5ee393d3ad986f210436eab6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee393d3ad986f210436eab6.pdf -------------------------------------------------------------------------------- /files/invoice/5ee3b807ad986f210436eab7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee3b807ad986f210436eab7.pdf -------------------------------------------------------------------------------- /files/invoice/5ee3bf6eea7c482f007afad9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee3bf6eea7c482f007afad9.pdf -------------------------------------------------------------------------------- /files/invoice/5ee3bf99ea7c482f007afadb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee3bf99ea7c482f007afadb.pdf -------------------------------------------------------------------------------- /files/invoice/5ee3bfcaea7c482f007afadc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee3bfcaea7c482f007afadc.pdf -------------------------------------------------------------------------------- /files/invoice/5ee3c003ea7c482f007afade.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee3c003ea7c482f007afade.pdf -------------------------------------------------------------------------------- /files/invoice/5ee3c023ea7c482f007afadf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/invoice/5ee3c023ea7c482f007afadf.pdf -------------------------------------------------------------------------------- /files/servicing/5ed851ca5fb550256c6eb17d.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/servicing/5ed851ca5fb550256c6eb17d.pdf -------------------------------------------------------------------------------- /files/servicing/5edad8a30e0d5e23e8a01507.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/servicing/5edad8a30e0d5e23e8a01507.pdf -------------------------------------------------------------------------------- /files/servicing/5ee227355b1dce222cf01d42.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/servicing/5ee227355b1dce222cf01d42.pdf -------------------------------------------------------------------------------- /files/servicing/5ee22837b89a1311004d426e.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/servicing/5ee22837b89a1311004d426e.pdf -------------------------------------------------------------------------------- /files/servicing/5ee22dc853eb5132b8ff319a.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shahriarpshuvo/maktro-ms/HEAD/files/servicing/5ee22dc853eb5132b8ff319a.pdf -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": true, 5 | "singleQuote": true, 6 | "endOfLine": "lf" 7 | } 8 | -------------------------------------------------------------------------------- /routes/api/sale.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const SaleController = require('../../controllers/SaleController'); 3 | 4 | router.get('/:id', SaleController.getSale); 5 | 6 | module.exports = router; 7 | -------------------------------------------------------------------------------- /routes/api/user.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const UserController = require('../../controllers/UserController'); 3 | 4 | router.get('/:id', UserController.getUser); 5 | 6 | module.exports = router; 7 | -------------------------------------------------------------------------------- /routes/api/entry.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const EntryController = require('../../controllers/EntryController'); 3 | 4 | router.get('/:id', EntryController.getEntry); 5 | 6 | module.exports = router; 7 | -------------------------------------------------------------------------------- /routes/dashboard.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const DashboardController = require('../controllers/DashboardController'); 3 | 4 | router.get('/', DashboardController.read); 5 | 6 | module.exports = router; 7 | -------------------------------------------------------------------------------- /routes/api/return.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const ReturnController = require('../../controllers/ReturnController'); 3 | 4 | router.get('/:id', ReturnController.getReturn); 5 | 6 | module.exports = router; 7 | -------------------------------------------------------------------------------- /routes/api/expense.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const ExpenseController = require('../../controllers/ExpenseController'); 3 | 4 | router.get('/:id', ExpenseController.getExpense); 5 | 6 | module.exports = router; 7 | -------------------------------------------------------------------------------- /routes/api/servicing.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const ServicingController = require('../../controllers/ServicingController'); 3 | 4 | router.get('/:id', ServicingController.getServicing); 5 | 6 | module.exports = router; 7 | -------------------------------------------------------------------------------- /routes/api/api.rest: -------------------------------------------------------------------------------- 1 | ### All Product 2 | GET http://localhost:8000/api/products 3 | ### Single Product 4 | GET http://localhost:8000/api/products/5ed0bbe691e0f72cec2b7168 5 | ### Servicing 6 | GET http://localhost:8000/api/servicing/5ed18e7a883fd117189303a0 -------------------------------------------------------------------------------- /middlewares/AuthHandler.js: -------------------------------------------------------------------------------- 1 | module.exports = (req, res, next) => { 2 | if (req.session.user) { 3 | res.locals.user = req.session.user; 4 | return next(); 5 | } 6 | req.flash('error', 'You must be logged in first!'); 7 | res.redirect('/'); 8 | }; 9 | -------------------------------------------------------------------------------- /routes/inventory.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const InventoryController = require('../controllers/InventoryController'); 3 | 4 | router.get('/:page', InventoryController.read); 5 | router.get('/', InventoryController.read); 6 | 7 | module.exports = router; 8 | -------------------------------------------------------------------------------- /routes/api/product.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const ProductController = require('../../controllers/ProductController'); 3 | 4 | router.get('/', ProductController.getProducts); 5 | router.get('/:id', ProductController.getProduct); 6 | 7 | module.exports = router; 8 | -------------------------------------------------------------------------------- /routes/api/customer.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const CustomerController = require('../../controllers/CustomerController'); 3 | 4 | router.get('/', CustomerController.getCustomers); 5 | router.get('/:id', CustomerController.getCustomer); 6 | 7 | module.exports = router; 8 | -------------------------------------------------------------------------------- /routes/auth.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const AuthController = require('../controllers/AuthController'); 3 | 4 | router.get('/', AuthController.read); 5 | router.post('/login', AuthController.login); 6 | router.get('/logout', AuthController.logout); 7 | 8 | module.exports = router; 9 | -------------------------------------------------------------------------------- /middlewares/PermissionHandler.js: -------------------------------------------------------------------------------- 1 | module.exports = (role) => { 2 | return (req, res, next) => { 3 | if (req.session.user) { 4 | const currentUserRole = req.session.user.role; 5 | if (role.includes(currentUserRole)) { 6 | return next(); 7 | } 8 | } 9 | res.render('permission'); 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /routes/user.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const UserController = require('../controllers/UserController'); 3 | 4 | router.post('/', UserController.create); 5 | router.get('/:page', UserController.read); 6 | router.get('/', UserController.read); 7 | router.patch('/:id', UserController.update); 8 | router.delete('/:id', UserController.delete); 9 | 10 | module.exports = router; 11 | -------------------------------------------------------------------------------- /routes/entry.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const EntryController = require('../controllers/EntryController'); 3 | 4 | router.get('/:page', EntryController.read); 5 | router.get('/', EntryController.read); 6 | router.post('/', EntryController.create); 7 | router.patch('/:id', EntryController.update); 8 | router.delete('/:id', EntryController.delete); 9 | 10 | module.exports = router; 11 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "extends": [ 9 | //"airbnb-base" 10 | ], 11 | "globals": { 12 | "Atomics": "readonly", 13 | "SharedArrayBuffer": "readonly" 14 | }, 15 | "parserOptions": { 16 | "ecmaVersion": 11 17 | }, 18 | "rules": { 19 | "indent": ["error", 2] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /routes/return.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const ReturnController = require('../controllers/ReturnController'); 3 | 4 | router.post('/', ReturnController.create); 5 | router.get('/:page', ReturnController.read); 6 | router.get('/', ReturnController.read); 7 | router.patch('/:id', ReturnController.update); 8 | router.delete('/:id', ReturnController.delete); 9 | 10 | module.exports = router; 11 | -------------------------------------------------------------------------------- /routes/expense.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const ExpenseController = require('../controllers/ExpenseController'); 3 | 4 | router.post('/', ExpenseController.create); 5 | router.get('/:page', ExpenseController.read); 6 | router.get('/', ExpenseController.read); 7 | router.patch('/:id', ExpenseController.update); 8 | router.delete('/:id', ExpenseController.delete); 9 | 10 | module.exports = router; 11 | -------------------------------------------------------------------------------- /routes/product.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const ProductController = require('../controllers/ProductController'); 3 | 4 | router.post('/', ProductController.create); 5 | router.get('/:page', ProductController.read); 6 | router.get('/', ProductController.read); 7 | router.patch('/:id', ProductController.update); 8 | router.delete('/:id', ProductController.delete); 9 | 10 | module.exports = router; 11 | -------------------------------------------------------------------------------- /routes/customer.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const CustomerController = require('../controllers/CustomerController'); 3 | 4 | router.post('/', CustomerController.create); 5 | router.get('/:page', CustomerController.read); 6 | router.get('/', CustomerController.read); 7 | router.patch('/payment', CustomerController.updateBalance); 8 | router.patch('/:id', CustomerController.update); 9 | router.delete('/:id', CustomerController.delete); 10 | 11 | module.exports = router; 12 | -------------------------------------------------------------------------------- /views/permission.ejs: -------------------------------------------------------------------------------- 1 | <%- include('./modules/_header', {page: "Permission Denied"}); %> 2 | <%- include('./modules/_navs', {page: ''}); %> 3 | 4 | 5 |