Skip to content

1. Installation

Aft edited this page May 18, 2024 · 8 revisions

smartMoney was built using Laravel framework.

Deployment

  1. Download source code smartMoney
git clone https://github.com/mrahmadt/smartMoney.git
cd smartMoney
  1. Follow Laravel Deployment
  2. Set Up Environment Configuration: Copy the example environment configuration to a new .env file:
cp .env.example .env
  1. Configure Environment Variables

Open the .env file and update the following essential settings:

a. Make sure you have created a database and a database user. Update the database credentials accordingly:

DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=sail
DB_PASSWORD=password

b. Firefly-III Integration Provide the URL and personal token for your Firefly-III instance:

FIREFLYIII_URL=https://moneycontrol.com
FIREFLYIII_TOKEN=eyJ0eXAiOiJKV1QiLC.....

c. Migrate Database Run the database migrations to set up the required tables:

php artisan migrate

d. Setup cron job: You need to add cron configuration entry to our server that runs the schedule:run command every minute.

* * * * * cd /path-to-your-smartMoney && php artisan schedule:run >> /dev/null 2>&1

Set Up SMS Parsing (Optional)

If you want to enable SMS parsing for transactions, update the following settings in the .env file:

Enable/Disable SMS Parsing

PARSE_SMS_ENABLED=true

Configure SMS Senders

Provide a JSON configuration for the SMS senders: The json keys are the SMS Senders (if SMS sender name not in the list, it will be ignored), and the values are the class names under "app/parseSMS". You will need to create a class that will parse each bank, you can find multiple banks included under "app/parseSMS", copy any file and modify it as you can see fit to your bank SMS formats.

PARSE_SMS_SENDERS='{"saib":"parseSAIB","stcpay":"parseSTCPay","alinmabank":"parseAlinmaBank","sab":"parseSAB","snb-alahli":"parseSNBAlAhli"}'

Store Invalid and Valid SMS

Should we save invalid SMS (SMS that did not pass our initial validation or SMS that we are not able to parse as bank transaction)

PARSE_SMS_STORE_INVALID_SMS=true

Should we keep valid SMS in database even after parsing them?

PARSE_SMS_STORE_VALID_SMS=true

Minimum SMS Length for Valid Transactions

Any SMS message below this length will be considered as invalid bank transaction

PARSE_SMS_MIN_SMS_LENGTH=30

Auto-Detect Non-Transaction SMS

Before parsing any SMS, smartMoney can try to detect if this SMS is an actual Bank transaction or just a message from your bank for whatever reason, if the SMS message determined that it's not a valid message and PARSE_SMS_STORE_INVALID_SMS is true, it will be saved in database.

PARSE_SMS_AUTO_DETECT_NON_TRANSACTION_SMS=true

Fallback to OpenAI for Parsing

If your SMS parse class for this specific SMS sender were not able to parse the SMS message, would you like to send the SMS message to Azure OpenAI to parse it? Keep in mind, your BANK SMS Message with all the information will be sent to Azure OpenAI. you can enable/disable this also in Sender SMS parse class.

PARSE_SMS_FAILBACK_OPENAI=true

Use OpenAI for Category Detection

Would you like to use Azure OpenAI to determine the correct category for each transaction, smartMoney will first try to determine the category of every transaction based on the destination/source of the transaction, if it is not able to determine the category, it can ask Azure OpenAI. Keep in mind, your BANK SMS Message with all the information will be sent to Azure OpenAI.

PARSE_SMS_DETECT_CATEGORY_OPENAI=true

Configure Azure OpenAI (Optional)

If using Azure OpenAI for SMS parsing and categorization, update the following settings: (I never tested it with OpenAI API, but it should work).

OPENAI_ENABLED=true
OPENAI_URL='https://AAAA.openai.azure.com/openai/deployments/VVVVV/chat/completions?api-version=2024-02-01'
OPENAI_TOKEN='3333333333'

Set Up Web Push Notifications (Optional)

Configure the VAPID keys for web push notifications: Generate the VAPID keys (required for browser authentication) with:

php artisan webpush:vapid
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=

Enable Abnormal Transaction Alerts (Optional)

Configure settings for abnormal transaction detection and alerts:

CAL_AVERAGE_TRANSACTIONS_WITHDRAWAL_ENABLED=true
CAL_AVERAGE_TRANSACTIONS_DEPOSIT_ENABLED=true

Auto-Detect and Create Bills (Optional)

Enable the bill detection feature:

BILL_DETECTOR_ENABLED=true
BILL_DETECTOR_MIN_AMOUNT=10
Clone this wiki locally