Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
megastary committed Oct 19, 2023
2 parents 8cbbc7b + 90c95ec commit cbc6f36
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 49 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
directory: "/"
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
Expand Down
69 changes: 37 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
# Small Business Fridge [![HitCount](http://hits.dwyl.io/houby-studio/small-business-fridge.svg)](http://hits.dwyl.io/houby-studio/small-business-fridge)
# Small Business Fridge

[![GitHub version](https://badge.fury.io/gh/houby-studio%2Fsmall-business-fridge.svg)](https://badge.fury.io/gh/houby-studio%2Fsmall-business-fridge)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/houby-studio/small-business-fridge/issues)
[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/houby-studio/small-business-fridge/blob/master/LICENSE)
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/houby-studio/small-business-fridge&style=flat)](https://github.com/houby-studio/small-business-fridge/pulls)

[![Build Status](https://travis-ci.com/houby-studio/small-business-fridge.svg?branch=master)](https://travis-ci.com/houby-studio/small-business-fridge)
[![Known Vulnerabilities](https://snyk.io/test/github/houby-studio/small-business-fridge/badge.svg)](https://snyk.io/test/github/houby-studio/small-business-fridge)
[![npm dependencies](https://david-dm.org/houby-studio/small-business-fridge.svg)](https://david-dm.org/)
[![codebeat badge](https://codebeat.co/badges/e58b4ed5-72d8-4d96-8722-d5d54b3f6605)](https://codebeat.co/projects/github-com-houby-studio-small-business-fridge-master)
[![Maintainability](https://api.codeclimate.com/v1/badges/65ee38e7c21e47a0fc76/maintainability)](https://codeclimate.com/github/houby-studio/small-business-fridge/maintainability)
[![Coverage Status](https://coveralls.io/repos/github/houby-studio/small-business-fridge/badge.svg?branch=master)](https://coveralls.io/github/houby-studio/small-business-fridge?branch=master)
[![Inline docs](http://inch-ci.org/github/houby-studio/small-business-fridge.svg?branch=master&style=shields)](http://inch-ci.org/github/houby-studio/small-business-fridge)
## 2023 UPDATE

This simple system is alive and kicking for 4 years already in our office! While imperfect, it has enabled us to share 4379 pieces of drinks and food in total cost of 76374 CZK as of today.
We actually keep expanding to other colleagues, adding more products and features. That has obviously shown certain weak points of this system and for that very reason we have dusted off our javascript skills to get this system back on track!
You can expect fixes of many features, updating all dependencies, some most needed new features and who knows, maybe some magical ✨AI✨ add-ons?

## Disclaimer

This tool is exclusively made by us and used by us, but we have commited anyways to make it FOSS and configurable to allow others to use it if they want!
There are however couple things that may need some customizations on your end, whether you fork it or open a pull request on this repository. The list of gotchas:

- Authentication is written for Microsoft Entra ID (Azure Active Directory)
- Application is in czech language and there is no internalization package currently
- Application has the minimum required features required for this model - no alternative methods for orders, payments, administration etc.

## Super simple e-shop for colleagues

*Ever had some nice colleague, who delivers refreshments to your office and allows you to buy it without any profit?*
Yes? Awesome!
*Do you always carry enough change to pay it outright?*
No?
*Do you write it down on a paper and pay it off later?*
Maybe? That's nice, but..
*How often do you forget to write it down?*
*How often does the paper get lost?*
*How often do you want to know how much you spent and when?*
*How often does your colleague AKA supplier wonder how much stuff is left and how much money did he put into it?*
*How often do you dream about seeing all those data in wonderful tables and graphs?*
**I made an answer for all those questions!**

**Small Business Fridge** is project which aims exactly on solving this common situation. It offers simple, mostly intuitive e-shop which shows what products are available, how many and for how much.
Customers can buy product with one simple click. The only other thing they have to do is to take the product and consume it. They also receive nice e-mail notification.
**Small Business Fridge** offers simple, mostly intuitive e-shop which shows what products are available, how many and for how much.
Customers can buy product with one simple click. The only other thing they have to do is to take the product and consume it. They also receive simple e-mail notification.
This obviously comes with many other utilities such as:

- page to display order history, total amounts spent
- page to display order history, total amount spent
- page for supplier to add products to the stock
- page for supplier to automatically create invoices for all customers and send it to their e-mail addresses
- page for supplier to automatically create invoices (read QR code) for all customers and send it to their e-mail addresses
- page to mark invoice as paid from both customer and supplier side
- page for admin who can view all the standard pages across all the customers and suppliers
- colorful graphs which are hopefully useful

*But what if I do not want to launch browser to buy product even though it is super easy?*
No problem! There is actually API for simple IoT device which is placed directly on the fridge, which allows customers to press some buttons and voilà, they just bought your favorite refreshment!
The simple IoT device is Arduino based project which will be placed on GitHub also very soon.
No problem! You can either assign kiosk role to a user, which can be logged on a some thin client with browser next to a fridge, eventually with touch screen display to allow easy shopping right at the fridge,
or there is API for anything you can and want to make! We have also worked and used for some time simple Arduino ESP32 device which may be found here [Small business fridge IoT keypad](https://github.com/houby-studio/small-business-fridge-keypad)

The whole system is running on Node.js with Express.js framework and stores data in MongoDB. It is also strongly secured (I believe) by using Azure passport allowing you to use your company ID to login and manage everything. Also it should be pretty lightweight, as we run it on a potato without any problems.
The whole system is running on Node.js with Express.js framework and stores data in MongoDB. We have made everything in our power to secure this application by using Azure passport allowing you to use your company ID to login and manage everything.
It should be pretty lightweight, as we run it on a potato without any problems for around 20 users.

## Want to know more?

Expand All @@ -64,7 +57,7 @@ Go checkout [Wiki](https://github.com/houby-studio/small-bussiness-fridge/wiki)

### MIT

Copyright 2019 Jakub Šindelář
Copyright 2023 Jakub Šindelář

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand All @@ -74,6 +67,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

## Development

One way

- You can customize docker-compose.dev.example.yaml to develop with all required tools in containers
- Not tested, we debug main application directly on our computer and use containers to run database and other dev tools

Second way

- Download and install NodeJS
- Install dependencies `npm install`
- Copy `defaults.env` as `.env` and configure variables
- Start server with `npm start` or run debug task in VSCode

For linux users, you may want to allow node to bind to system protected ports

`sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which node))`
`sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which node))`
12 changes: 12 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 1.0.0 | :white_check_mark: |

## Reporting a Vulnerability

We have configured all default automation tools provided by Github to check for updates and vulnerabilities.
If you feel like something else should be done, feel free to open discussion or an issue.
25 changes: 12 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"http-errors": "~2.0.0",
"method-override": "^3.0.0",
"moment": "^2.29.4",
"mongoose": "^7.6.2",
"mongoose": "^7.6.3",
"mongoose-unique-validator": "^4.0.0",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
Expand All @@ -45,12 +45,12 @@
"eslint-plugin-promise": "^6.1.1",
"handlebars": "^4.7.7",
"mocha": "^10.2.0",
"nock": "^13.3.4",
"nock": "^13.3.6",
"nyc": "^15.1.0",
"passport-mock-strategy": "^2.0.0",
"proxyquire": "^2.1.3",
"resnap": "^1.0.1",
"sinon": "^16.1.0",
"sinon": "^16.1.3",
"supertest": "^6.3.3"
}
}

0 comments on commit cbc6f36

Please sign in to comment.