Skip to content

anshajkhare/expense-tracker-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Tracker Microservice

A microservice which can support an expense tracking application.

Installation

Get the source code

  $ git clone https://github.com/anshajkhare/expense-tracker-microservice.git
  $ cd expense-tracker-microservice

Setup Virtual Environment:

$ python3 -m venv .venv
$ source ./.venv/bin/activate
$ pip install --upgrade pip
$ pip3 install -r requirements.txt

Running Tests

To run tests, run the following command

$ python -m unittest discover tests -p '*_test.py'

Code Coverage:

$ coverage run --source=expense_service --branch -m unittest discover tests -p '*_test.py'

After running tests with code coverage, you can get the report

$ coverage report
Name                                  Stmts   Miss Branch BrPart  Cover
-----------------------------------------------------------------------
expense_service/__init__.py               2      0      0      0   100%
expense_service/service.py               23      1      0      0    96%
expense_service/tornado/__init__.py       0      0      0      0   100%
expense_service/tornado/app.py           83      4      8      3    92%
expense_service/tornado/server.py        41     41      2      0     0%
-----------------------------------------------------------------------
TOTAL                                   149     46     10      3    68%

Static Type Checker

$ mypy ./expense_service ./tests

Linter

$ flake8 ./expense_service ./tests

API Reference

Get all expenses

  GET /v1/expenses

Get an expense

  GET /v1/expenses/{id}
Parameter Type Description
id string [Required] ID of expense to be fetched

Create an expense

  POST /v1/expenses

Update an expense

  PUT /v1/expenses/{id}
Parameter Type Description
id string [Required] ID of expense to be updated

Delete an expense

  DELETE /v1/expenses/{id}
Parameter Type Description
id string [Required] ID of expense to be deleted

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages