Skip to content

SpringBoot based restful backend + Angular frontend for cash flow management

Notifications You must be signed in to change notification settings

lucassimao/Cashflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 

Repository files navigation

Cash flow

This is a pet project for cash flow management whose goal is to practice microservices architecture development. The idea is to transform the excel spreadsheet found here in a webapp, using spring boot to implement the microservice on the backend and Angular on the frontend

Tech stack

  • Spring boot / Java11/
  • JWT
  • MySQL
  • Docker
  • Angular/TypeScript

How to run with the development environment

  • Ensure a properly configured MySQL database instance is running and create a new database to be used by this application
  • edit the properties spring.datasource.url, spring.datasource.username, spring.datasource.password in the file src/main/resources/application.properties and ensure they are properly configured for your enviroment. Property names are self explanatory.
  • Use the following commands to create the mysql server container and databases

docker pull mysql

docker run --name mysql-db -p 3306:3306 -e MYSQL_ROOT_PASSWORD= ? -e MYSQL_USER=app -e MYSQL_PASSWORD=123 -e MYSQL_DATABASE=cash_flow -d mysql

docker exec -it mysql-db mysql -u root -p -e "create database cash_flow_tests; grant all on cash_flow_tests.* to app"

  • If you have apache maven (3.1+) on your system's classpath, just run:

mvn spring-boot:run

  • otherwise anf if you are on a linux box, run:

./mvnw spring-boot:run

  • ... on a windows machine

./mvnw.bat spring-boot:run

How to run in production mode

mvn -Dspring-boot.run.profiles=production spring-boot:run

How to run the integration tests

mvn -Dspring.profiles.active=integrationtest test

Tasks - Backend

  1. CRUD of Book entries groups [done]
  2. CRUD of Book entries ( expenses or incomes ) [done]
  3. Signup api, Login with JWT and Multitenancy : [done]
    1. CRUD operations on book entries groups and book entries must be scoped to the logged user
    2. Signup api must be public
  4. Reports [done]
    1. Annual, monthly and Daily reports of income and expenses
  5. Cash flow goals - to define income and expenses goals in order to compare with the real cash flow [done]

Tasks - Frontend

  1. CRUD of Book entries groups
  2. CRUD of Book entries ( expenses or incomes )
  3. Cash flow goals - to define income and expenses goals in order to compare with the real cash flow
  4. Reports
    1. Annual, monthly and Daily reports of income and expenses
  5. Signup from
  6. Login form

Reference and articles

  1. Java Money and the Currency API
  2. Working with Relationships in Spring Data REST
  3. GLOSSÁRIO DE TERMOS USADOS NAS ÁREAS DE FINANÇAS, CONTABILIDADE E JURÍDICA
  4. Spring Boot - Unit Testing and Mocking with Mockito and JUnit
  5. Spring Boot testing features

Tips

  1. Creating a generic user

    curl -i -H "content-type: application/json" -d '{"name":"Lucas Simão","email":"lsimaocosta@gmail.com","password":"123"}' -v http://localhost:8080/users

  2. Authenticatig as admin using curl in development enviroment

    curl -i -H "content-type: application/json" -d '{"username":"admin@mycashflow.com","password":"123"}' -v http://localhost:8080/login

  3. Beteween the response headers from the previous request, will be the Authorization one. Just send the header value in any request

    curl -i -H "content-type:application/json" -H "authorization: $AUTHORIZATION_TOKEN" -d '{"type":"Expense","description":"credit card" }' http://localhost:8080/bookEntryGroups

About

SpringBoot based restful backend + Angular frontend for cash flow management

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published