Skip to content

xintongmi/accounting-book

Repository files navigation

Design Doc

Accounting Book Design Doc

Synopsis

This is a full-stack project aimed at tracking and analyzing home expenses

Tech Stack

Angular Spring Boot Gradle PostgreSQL Jasmine JUnit5 Docker Nginx Kubernetes Jenkins GCP Google Analytics

API Definition

HTTP Method Url Action
POST /api/accounts/{email}/books Add a new book
POST /api/accounts/{email}/books/{bookId}/items Add a new item to a book
GET /api/accounts/{email}/books List all books
GET /api/accounts/{email}/books/{bookId} Retrieve a book by {bookId}
GET /api/accounts/{email}/books/{bookId}/items?{query=target} List all items of a book with a query selector
PUT /api/accounts/{email}/books/{bookId} Update a book by {bookId}
PUT /api/accounts/{email}/items/{itemId} Update an item by {itemId}
DELETE /api/accounts/{email}/books/{bookId} Delete a book (and its items) by {bookId}
DELETE /api/accounts/{email}/items/{itemId} Delete an item by {itemId}

Resources

Account

public class Account {
    @Id
    @GeneratedValue(...) 
    private Long id;
    
    @Column(unique = true) 
    private String email;
    
    @OneToMany(...) 
    private List<AccountBook> accountBooks;
}

AccountBook

public class AccountBook {
    @Id
    @GeneratedValue(...)
    private Long id; 
    private String name;
    
    @OneToMany(...) 
    private List<SpendingItem> spendingItems;
    
    @ManyToOne(...)        
    @JoinColumn(...)       
    private Account account;
}

SpendingItem

public class SpendingItem {
    @Id
    @GeneratedValue(...)
    private Long id;
    private Category category;
    private String description;
    private String merchant;
    private Date date;
    private float amount;
    
    @ManyToOne(...)
    @JoinColumn(...)
    private AccountBook book;
}

Tests

The testing focus will be primarily on the web layer, ensuring comprehensive coverage of the following areas:

  1. HTTP request parsing - the appropriate handlers are accessed and parameters are accurately parsed.
  2. Responses are properly formatted in compliance with HATEOAS principles.

It's important to note that database operations, which are managed by JPA and devoid of customization logic, will not be included in the test coverage. Instead, Mokito will be utilized to mock all database queries. Additionally, security and authentication will be disabled during testing.

Contributor

Xintong Mi

License

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/

About

This project aims to track and analyze home expenses

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published