Giter VIP home page Giter VIP logo

neusol's Introduction

NeuSol

status status

Basic expense tracking software. This is my first project using the Fat-Free Framework.

It uses the Fat Free Framework, a lightweight PHP framework, and follows the example in Fat-Free CRUD with MVC

It also makes use of the following components:

The code is structured as follows:

  • app : Actual application code. Follows an MVC arrangement.
    • classes : Misc classes that are autoloaded by the Framework.
      1. Fm : Form shortcuts
      2. phpGraph : PHP SVG graph class
      3. Sc : Misc. Shorcuts (to use in view templates and reduce typing)
    • models : Data Access Objects.
    • controllers : Main classes that do stuff. Some classes worth mentioning:
      1. AppMain : Main window (shows the welcome dashboard)
      2. BackupController : Handles backups and restores
      3. ImportController : Manages bulk imports
      4. RptSummary : Generate year summary reports
    • views : Mostly PHP templates as HTML with embedded codes. But also JavaScript is in there.
  • config : FatFree configuration files.
  • data : contains data that will be editable from the web interface.
    • rules.php : Used to assign categories to posting date.
    • triggers.php : Used to generate postings automatically (i.e. to balance accounts)
    • Importers/ : Contains classes used when importing bank data
  • lib : symlink to PHP libraries
  • scripts : utility scripts for bootstraping and maintenance
    • init.sql : Use php index.php /restore scripts/init.sql to initialize the MySQL database.
    • newtest : ./scripts/newtest ../NeuSol ../NeuDev to copy production to test.
    • secfg : Apply selinux contexts and UNIX permissions.
    • upgrade.sql : Upgrade schema.
  • submodules : where all the git modules are registered.
  • ui : static files that used for rendering the user interface.

Requirements

  • Web Server (Tested on Apache 2.4.52)
  • PHP (Tested on 7.4.26)
  • MariaDB (Tested on 10.3.32)

The web server must have mod_rewrite enabled and allow .htaccess overrides.

Installation

  1. Create a directory in your web server, e.g. NeuSol. The name NeuDev is special for a test instance. In that case the nonprod-config.ini is also read and needs to be configured.
  2. git clone --recursive https://github.com/iliu-net/NeuSol.git NeuSol
  3. If on a SELINUX system you may need to run:
    • scripts/secfg
  4. Create a database and a database user
    • create database pfm;
    • GRANT ALL PRIVILEGES ON pfm.* TO 'pfm'@'localhost' IDENTIFIED BY 'mypass';
  5. Configure this in config/config.ini
  6. Initialize the database schema:
    • php index.php /orestore scripts/init.sql
  7. Point your web-browser to your app directory.

Customizations

  • More in-depth business rules can be created in:
    • data/rules.php
    • data/triggers.php
  • Custom importers can be added in:
    • data/Importers/*.php

Notes

  • Balance is the amount at the end of the day.

Learning points

OK, so this is my first try at an FatFree MVC web application. So somethings I learned:

  1. We need to dwelve better into FatFree's autoloading capabilities and how namespaces are handled.
  2. In routes.ini we declare route => {controller}->{method}, I think it would be cleaner if we had: route => {controller}->view, and then in the view function we declare: function view($f3,$params). Well, $params[0] has the route itself, which actually should refer to a view in the view folder.
  3. The models are actually DAO. We should name these accordingly with a DAO suffix. (This has to do with the fact that we are using a flat namespace)
  4. There ought to be a good way to abstract how reports are done. We are not there yet.
  5. When FatFree makes the Hive available in templates as variables, these variables are already escaped. If you want to use the raw variables (unscaped) you should use the $f3->get method to read the Hive directly.

neusol's People

Contributors

alejandroliu avatar

Stargazers

Thành Nhân avatar  avatar

Watchers

James Cloos avatar  avatar

neusol's Issues

Rules Editor

  • Should open on its own window
  • Code editor:
  • Condition
    • PHP snipped that returns a constant
    • no match, no match + stop, match + stop, match + excute rule, match + execute rule + stop
  • Rule
    • API for adding additional rows, classify, set flags

Tables

  • rules

    • id
    • priority
    • dependancies
    • condition (function to check if it applies)
    • code
  • hits

    • id
    • month
    • count

iPhone Entry screen

Flow:

  1. From NeuSol, we register an user. It connects to the External web server. Defines the connection
    and returns a PIN that the user can use to login
  2. The user uses their smartphone to connect to the external web server and provides the PIN.
    All transactions from that user are then saved in there. (Data is kept for a few days)
  3. On a regular basis NeuSol will connect to the external web server and retreive data.

Hide accounts

Some accounts get closed but we would like to ignore them for data entry.

Equity Positions

  • Show accounts (with entries)
  • Add/Edit Entry:
    • account
    • quarter
    • value

Backup Web GUI

  • backup to a downloadable file
  • backup to directory on server

Backup should include

  • data files
  • MySQL

Authentication

  • Should be an optional module
  • oidentd
  • transaction auditing

Calculator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.