Monday, October 31, 2011

Geldzin2: Categories & Budget

In version 1.3, I add features required to manage categories and a simple budget. All this can be done from a single page, as shown in the screenshot below (with randomly generated data).


At top/left section is where you manage categories. All financial transactions must be itemized (or categorized). In the context of categories, you then can create a budget (as seen at top/right section). A category can have any number of budget items, each specifying budget amounts for each month of the year. Annual and monthly totals are displayed at bottom for convenience and quick reference.

My philosophy on personal budgeting is that a budget should initially be designed around expenses only (as opposed to incorporating income). I take this approach for two reasons: (1) everyone has expenses regardless of income, and (2) knowing expenses first helps shape an informed strategy for obtaining income to cover the expenses. A budget is simply rules on how you plan to use money (and doesn't necessarily mean you have that money). Income should later be considered when balancing the budget (in light of actual financial activity) and for forecasting. Once you know how much you must spend, the question then becomes: "how shall I get all this money?". An expense-only budget also helps bring to the forefront your lifestyle and priorities.

Sunday, October 16, 2011

Geldzin2: Accounts

In Geldzin2, accounts are the hub of user activity, used to coordinate the various features the user experiences when using the application. The following are planned features for version 1.2 (developer build available Sun Oct-23, 2011):
  • Accounts are created when a user activates their profile.
  • An account can be linked to multiple users (up to 2), primarily so that each user can have their own login.
  • One of the account users can be designated the primary user (the first user assigned to an account is by default the primary). This user is the only one allowed to schedule the account for deletion.
  • Accounts can be free or paid. This implementation will support only free accounts.
  • Accounts can be personal or business. This implementation will support features appropriate for personal financial management only.
  • When a user is removed from an account, the user is scheduled for deletion. The user can no longer log into the the account thereafter.
  • When an account is disabled, its users are also disabled, meaning that they cannot log in thereafter.
  • When an account is deleted, its users are disabled and removed when the account is removed.
As usual, a developer build of the previous version can be previewed at http://jubilee.homeip.net:84/geldzin2/. To test-drive the application, login as guest/geldzin (for username/password).

NOTE: The guest account is reset every night, so do not expect changes to persist day-to-day. Although the developer drop allows users to register new accounts, this information is lost when a new build is deployed.

Thursday, October 06, 2011

Recipe#9: Setup Repository On VisualSVN


Overview: At the start of a software project, you need somewhere to store and version your source code, from where it can also be shared with others on your team. I use VisualSVN Server as my SCM server.
Use case: I am starting the redesign of my financial webapp (Geldzin) and need a new source repository for the project where I will check in source files and other resources, and launch builds + automated tests from.
How-To:
* Open VisualSVN Server. Right-click: Repositories > Create New Repository.
* Provide name {geldzin2} and check "create default structure". [OK].
* If you don't already have users configured, use the "Users" node to create a few.
* If you don't already have user groups configured, use the "Groups" node to create some. Add users to groups so that permissions be set on group rather than individual users.
* Setup security for the repository. Right-click newly created repository, select Properties | Security tab. Set Everyone -> No Access. [Add]. Select group or user [OK]. Give this group Read/Write permissions. [OK].

Monday, October 03, 2011

Recipe#8: Setting Up Parent Maven Project In Eclipse

Whenever you create Maven projects, a best practice is to start with a parent project from which child modules will inherit. The parent POM defines global settings and doesn't itself produce a deliverable. Child modules would include the deliverables, project documentation (user guides and API docs), libraries (if this is a dependency for other projects), etc. It eases maintenance and extensibility tremendously.

This recipe assumes you have Java (see recipe#2), Maven2 (see recipe#6),  and Eclipse (see recipe#3) configured.

In Eclipse:
* File > New > Other. Select Maven | Maven Project [Next]. Use default workspace location [Next]. Select "maven-archetype-quickstart" [Next]. Provide archetype parameters [Finish].
* Update the POM, providing #properties, #description, #licenses, #organization and #developers information, and plugin information for the compiler and surefire (test) plugins. Notice that #packaging ought to be pom.


<?xml version="1.0" encoding="UTF-8"?>
<project ...>
    <modelVersion>4.0.0</modelVersion>
   
    <groupId>com.strive</groupId>
    <artifactId>geldzin2</artifactId>
    <packaging>pom</packaging>
    <version>0.1-SNAPSHOT</version>
   
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.6</jdk.version>
    </properties>
   
    <name>Geldzin2</name>
    <description>
        An online personal financial management application.
    </description>
   
    <licenses>
         <license>
              <name>The Apache Software License, Version 2.0</name>
              <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
              <distribution>repo</distribution>
        </license>
    </licenses>
   
    <organization>
        <name>Strive Consulting, LLC</name>
        <url>http://www.strive-ltd.com</url>
      </organization>

    <developers>
          <developer>
            <id>prideafrica</id>
            <name>Jubz Madagascar</name>
            <organization>Strive Consulting, LLC</organization>
            <organizationUrl>http://www.strive-ltd.com</organizationUrl>
            <roles>
                <role>Architect</role>
                <role>Developer</role>
            </roles>
          </developer>
    </developers>
   
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.9</version>
                </plugin>           
            </plugins>
        </pluginManagement>
    </build>
</project>

Saturday, October 01, 2011

Recipe#7: Simple Maven Webapp in Eclipse

How to create a webapp using Maven, and run it on Jetty in Eclipse. This recipe creates an initial webapp that I want to use as playground for ExtJS 4.x. Requires that you already have Eclipse and Maven configured. Everything is done in the Eclipse IDE.

* Menu File > New > Other.
* Select a wizard: Maven > Maven Project [Next].
* Select project name and location: use default workspace location. [Next].
* Select an archetype: maven-archetype-webapp. [Next].
* Specify archetype parameters: Group Id {com.strive}, Artifact Id {extjs4-projects}, Version {0.1-SNAPSHOT}, Package {com.strive.extjs4projects}. [Finish].
* Create the Java sources directory (src/main/java) and set it as a source folder (right-click: Build Path > Use as Source Folder).
* Open the POM and update #name:{ExtJS4 Sample Projects}, remove #dependencies, #build/finalName:{extjs4}.
* Specify properties and plugins (compiler, surefire, war, and jetty) in the POM:

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jdk.version>1.6</jdk.version>
  </properties>
  <build>
    <finalName>extjs4</finalName>    
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
        </configuration>
      </plugin>
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.9</version>
      </plugin>
      <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>maven-jetty-plugin</artifactId>
          <version>6.1.26</version>
          <configuration>
            <contextPath>/${project.build.finalName}</contextPath>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.1.1</version>
      </plugin>
    </plugins>    
  </build>


* Create a Jetty launch configuration to run the webapp in Eclipse: Run > Run configurations. Maven Build | New. Name {JettyRun}, browse workspace and select current project, Goals {jetty:run}. [Apply] then [Run].