Project is a tool to help track spending and manage budgets.
Project is also a side project for me to try out different technologies. I choose to implement a financial tool because it is something that will be useful for the rest of my life so I will be motivated to keep working on it.
- Git
- Spring Boot
- Maven
- Thymeleaf
- NPM
- npm-watch
- browserify
- MithrilJS
Goals:
- module parts so that I can rewrite some things in a different language if/when I desire.
- fast development cycle
- spring-boot-devtools handles rebuilding and reloading the java application
- npm-watch handles rebuilding the web app
- use latest releases of technologies
Thoughts on programming:
- Use yoda conditions (e.g. constant.equals(values) instead of value.equals(constant)) everywhere. In places where value may be null this prevents a null pointer exception and elsewhere it maintains consistency.
- Validation layer should only use information provided in the object being validated, i.e. don' check the state of the application or DB (e.g. don't check if username is already taken in validation layer)
- Need a better way of defining/validating form data on frontend.
- Database changes should not break existing code. Existing code should run without issue against new and old versions of the code
Thoughts on accounting: I should probably integrate with some existing tool, or at least get an understanding of them in order to improve my design accounting http://hledger.org/
NPM scripts can be used to build both the mithril web app and the spring boot application. The NPM script calls maven to build the spring application.
Build javascript web app. This will bundle all the javascript for the mithril web app into a single file (src/main/resources/static/js/app.js)
npm run -s build-js
Build static resources. If the application is running the resources will be hot-reloaded without restarting the application.
npm run -s build-static
Build java class files. If the application is running spring-dev-tools will trigger an automatic restart on a classpath change.
npm run -s build-java
Launch application
npm run -s launch
Launch application and watch for any changes. If changes are detected in the un-bundled javascript files then we first rebuild the web app then rebuild the spring application. After rebuilding the spring some application the changes will either be visible on refresh or after spring-boot-devtools has automatically restarted the application
npm run -s watch