/aumo

📜 The digital receipt of the future.

Primary LanguageJavaScript

logo

📜 The digital receipts of the future.

Github Actions Widget Github Actions Widget2 GoReport Widget GoDoc Widget

Tons of paper receipts are produced and then immediately thrown away, for the creation of which are used trees and a human toxic chemical, requiring thousands of decares of forests to be cut down and resulting in spreading of diseases.

Aumo is a mobile application, accompanied by a hardware device and a web server, which aims at removing paper receipts by replacing them with a digital equivalent. Receipt printers of shops and restaurants will be equipped with Aumo. Clients will take their digital receipts by approaching their phone (through our mobile application) to Aumo, establishing a connection via NFC (Near-Field Communication) technology.

Incentive for using the digital receipt, as opposed to the paper alternative, will be points which users receive when choosing Aumo over the traditional option. Points can be exchanged for bonuses, which can either be discounts or physical items, provided by the shop or restaurant.

Getting started

Paper

  • pandoc
  • texlive-latex-base
  • texlive-latex-extra
  • texlive-fonts-recommended
  • texlive-fonts-extra
  • texlive-lang-cyrillic
  • cm-super
# Ubuntu
$ sudo apt install pandoc texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-lang-cyrillic cm-super
# Arch
$ yay -S pandoc texlive-core texlive-latexextra texlive-fontsextra texlive-langcyrillic 

Run make in the corresponding directory

Backend

Found in the root of the repo

  • go
  • mysql
  • redis

Fill in the .env file in the root of the project

MYSQL_DATABASE=aumo
MYSQL_USER=root
MYSQL_PASSWORD=
MYSQL_HOST=localhost
MYSQL_PORT=3306

ADDRESS=:8080
COOKIE_SECRET=good-password

REDIS_URL=localhost:6379
REDIS_DATABASE=0
REDIS_URL_TEST=localhost:6379
REDIS_DATABASE_TEST=1

BACKEND_URL=http://localhost:8080/api/v1
FRONTEND_URL=http://localhost:3000
INITIAL_ADMIN_PASSWORD=123456

# Set ENV to PROD if you want to send confirmation emails, otherwise set it to DEV
ENV=PROD
SMTP_HOST=smtp.foo.com
SMTP_USER=foo@bar.com
SMTP_PASS=foobar

Create the needed databases:

CREATE DATABASE aumo; -- for dev / prod
CREATE DATABASE aumo_test; -- for tests

Run the server:

$ go run cmd/aumo/main.go

The server should automatically create the initial admin with the INITIAL_ADMIN_PASSWORD password and admin@deliriumproducts.me email.

If you want to get some data to work with, run:

$ mysql -u root -p aumo < data.sql

Admin panel

Found in the web/ directory

  • node.js
  • yarn

Instal deps:

$ yarn

Fill in .env:

BACKEND_URL=localhost:8080/api/v1

Start in dev:

$ yarn dev

Start in prod:

$ yarn build && yarn start

Mobile

Found in the client/ directory

  • android sdk
  • jdk
  • node.js
  • yarn

Install deps:

$ yarn 

Build for android (only needed the first time OR when installing / changing native code)

$ yarn android

Build for iOS (only needed the first time OR when installing / changing native code)

$ yarn ios

Start normally after having installed the iOS app or APK:

$ yarn start

In order to build a release apk, you need to generate a keystore using:

$ keytool -genkeypair -v -keystore aumo.keystore -alias aumo -keyalg RSA -keysize 2048 -validity 10000

... and then move the generated file in client/android/app.

Next you need to make a file called release.keystore.properties in the client/android/keystores directory. It should contain:

key.store=aumo.keystore
key.alias=aumo
key.store.password=***
key.alias.password=***

The final apk can be installed using:

$ yarn android --variant=release