Giter VIP home page Giter VIP logo

cashstash-old's Introduction

CashStash

Codeship Status for Ruaghain/CashStash

CashStash is a light-weight, money tracking application that will track day to day wallet expenses and bank transactions.

Development

CashStash uses Docker to deploy the several containers that it needs to run. They include:

  • mongo
  • express
  • angular

As you can infer from above, it makes use of MongoDB as the database engine, Express as the web server, and Angular 4 as the front-end. By default runs on port 3000.

Setup

To get CashStash working on an environment, you will have to install the community edition of Docker. Once this has been done, follow the steps outlined below for your OS to get it up and running.

MacOS

Navigate to the project root directory. Modify the .env file and set DOCKER_HOST_IP to localhost. Run the following command:

  • docker-compose up

Once the setup has completed, navigate to http://localhost:8000

Microsoft

Getting docker working on MS (Pre Windows 10) takes a bit more work. To get it working, do the following:

  • Run docker-machine start
  • When that's completed, run docker-machine env
  • Once that's completed, run the following: @FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i This sets the required environment variables needed to get the docker machine working.
  • Finally, when you've done that, run docker-compose up

If you make any changes to the code, and you'd like those reflected in the container, run the following:

  • docker-compose up --build

The --build rebuilds all the source, and deploys it to the container.

Debugging

Since you can't easily debug remotely, the easiest way to do it would be to get everything (except MongoDB) running locally without using Docker. To do that, do the following:

  • Install Node for your OS
  • Install yarn for your relevant OS.
  • Runyarn install in both the client and server directories.
  • From the source root directory run: docker-compose up mongo (This will only start the Mongo Container)
  • In the server directory run yarn run start
  • In the client directory run yarn run start:dev

Testing

All the code (both server and client side) needs to be unit tested. To facilitate this, all unit tests are run on every code check-in to the project on Github.

Client Side

If you wish to run client-side unit test manually run the following yarn run test in the client directory. To run the unit tests with coverage run yarn run test:coverage

Server Side

If you wish to run server-side tests, navigate to the Server directory, and run yarn run test

cashstash-old's People

Contributors

ruaghain avatar dependabot[bot] avatar

Watchers

James Cloos avatar

cashstash-old's Issues

Implement a Home page with general information.

Need to implement a home page. Populate it with general financial information of some description:

  • Will start off with a RSS feed component that will read information from a third party site.

Implement Category and Sub-Category management

Need to be able to create and update Categories for transactions. This will need to be done through a management screen. Need to have the ability to create sub-subcategories, and assign them to parent categories. A tree view component of some description?

  • Allow adding, updating and deleting of categories inline.

Need to implement the authorisation process.

Need to facilitate authorisation in the application. This will be accomplished by using JWT the returned token will get stored on the users machine, and will ultimately get submitted on each request.

Get Lazy loading working.

Need to try and get Lazy Loading working with the routes and webpack. Also need to get Express to use the HTML file and populate it with the generated webpack files.

Create a generic Datasource class.

Create a generic datasource class, that will cater for any type (REST, XML) of request to a server. The specific implementations will work out how to interpret the data from the server.

Needs to have the ability to emit an error message if there's a problem with anything - which will allow listening components to pick it up.

Define a standard response template for the server-side.

Need to define a standard response payload for successful requests to the server, along with a standard error response:

Successful feed:

{
  $totalResults: 50,
  $startIndex: 1,
  $itemsPerPage: 10
  $records: [
    {
      $id: 1,
      name: 'Current',
      openingBalance: 500.43
    },
    {
      $id: 2,
      name: 'Credit Card',
      openingBalance: 0.0
    }
  ]
}

Successful record:

{
  $id: 1,
  name: 'Current',
  openingBalance: 500.43
}

Error Response:

{
  $diagnoses: [
    $severity: 'error', //warning, or information
    $message: 'There was an error saving the record.'
    $applicationCode: '1234',
    $entity: 'Account'
    $records: [
      {
        $id: 1,
        name: 'Current',
        openingBalance: 500.43
      } 
    ]
  ]
}

Convert server code to Typescript

Need to convert the server-side code to typescript, and set up a compiler to handle it. This will facilitate the user of async and await in the relevant functions.

http://brianflove.com/2016/11/08/typescript-2-express-node/
http://brianflove.com/2016/10/04/typescript-declaring-mongoose-schema-model/

  • Update project to use ES6 (including getting the tests to work)

  • Make use of Async/Await

  • Handle Errors

This follows in from the best practices in the following URL: https://www.codementor.io/mattgoldspink/nodejs-best-practices-du1086jja

Investigate the use of GraphQL

  • Investigate using GraphQL as a replacement for the server-side REST implementation using node.
  • See how it plays with Swagger.

Need to facilitate localisation for the project.

Use Angular to facilitate localisation for the project.

Need to run "./node_modules/.bin/ng-xi18n" to generate the relevant files. See: https://angular.io/docs/ts/latest/cookbook/i18n.html

Researching that a bit more, seems like it wouldn't be something that could be used in services for instance - with regards to any messages that need to be returned to the user. A better approach would probably be something like: https://scotch.io/tutorials/simple-language-translation-in-angular-2-part-2

try and make use of the lodash get method.

Create a tree view component

Need to create a tree view component which will allow for drag and drop functionality to their respective nodes. Should

Might need some sort of TreeNode component to facilitate this?

  • Id - the Id of the relevant record.
  • Name - the name of the node.
  • Parent - the parent of the node.
  • Children - This is an array of child TreeNode's
  • Expanded - true, when it's open.
  • CanDrop - true if this node accepts being dropped on.

Need to create a Service that will actually emit each of the events for the TreeNode, they include:

  • NodeDropped - The node that was dropped on another
  • NodeExpanded - Which node was expanded.

Asynchronous action:

  • Get a list of all the parent records. Those without a child. (Add where clause support to the datasource component?)
  • Mark all of these with a + image
  • If the user clicks on the + make a call to the server to return all the child elements.
  • Dynamically add these child elements to the clicked parent. Have the position of the clicked parent. (How does angular do this?)

Synchronous

  • Get all the data,
  • Build up all the nodes based on the JSON received. Nesting as we process.

NOTE: Since this component works off events, it will be up to the relevant component which implements this, to dynamically create the nodes in situ when the click event has been intercepted - specifically for asynchronous processing.

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.