Git Product home page Git Product logo

fs-financial-tracker's Introduction

Financial Tracker API

Overview

The Financial Tracker API is designed to help users track their financial transactions. With the capability to record, update, retrieve, and delete transactions, this API makes managing personal finance data simple and straightforward.

Live URL

Live API

Live Website

flowchart

Table of Contents

Features:

  1. Add new transactions with type, name, and amount.
  2. Edit existing transactions.
  3. Delete transactions.
  4. Search transactions by name.
  5. Filter transactions by type.
  6. View aggregate data for total cash in, cash out, and balance.
  7. Secure with basic authentication.

Tech Stack:

  • Frontend: Vanilla JS and Bootstrap 5.
  • Backend: ExpressJS with in-memory data storage.

Installation

  1. Clone the repository:
git clone https://github.com/m-istighfar/week-8-m-istighfar.git
  1. Navigate to the project directory:
cd week-8-m-istighfar
  1. Install the necessary dependencies:
npm install
  1. Start the server:
npm start

Your server should start on http://localhost:3000/. Open this URL in your browser to access the app

API Endpoints

Transactions

Get all transactions:

  • Endpoint: /api/products
  • Method: GET
  • Response: A list of all transactions.

Get a specific transaction by ID:

  • Endpoint: /api/products/:id
  • Method: GET
  • Parameters: id - ID of the transaction.

Search by transaction name:

  • Endpoint: /api/products
  • Method: GET
  • Query Parameters:
    • name: Name or part of the name of the transaction you're looking for.
    • Example: /api/products?name=lunch

Filter transactions by type:

  • Endpoint: /api/products
  • Method: GET
  • Query Parameters:
    • type: The type of transactions you're interested in. It can be either "Kas Masuk" or "Kas Keluar".
    • Example: /api/products?type=Kas Masuk

Search and Filter Combined:

  • Endpoint: /api/products
  • Method: GET
  • Query Parameters:
    • name: Name or part of the name of the transaction you're looking for.
    • type: The type of transactions you're interested in.
    • Example: /api/products?name=lunch&type=Kas Keluar

Add a new transaction:

  • Endpoint: /api/roducts
  • Method: POST
  • Body:
    • type: Either "Kas Masuk" or "Kas Keluar".
    • name: Name/description of the transaction.
    • amount: Amount of money for the transaction.

Update a transaction:

  • Endpoint: /api/products/:id
  • Method: PUT
  • Parameters: id - ID of the transaction.

Partially update a transaction:

  • Endpoint: /api/products/:id
  • Method: PATCH
  • Parameters: id - ID of the transaction.
  • Body (example): You can include one or more of the following fields to update:
    • type: Either "Kas Masuk" or "Kas Keluar".
    • name: Name/description of the transaction.
    • amount: Amount of money for the transaction.
  • Description: This endpoint allows you to update specific fields of a transaction without affecting other fields. If a field is omitted from the body, it will remain unchanged in the database.

Delete a transaction:

  • Endpoint: /api/products/:id
  • Method: DELETE
  • Parameters: id - ID of the transaction.

Delete all transactions:

  • Endpoint: /api/products
  • Method: DELETE
  • Description: This endpoint deletes all transactions from the database. Use with caution as this operation is irreversible.

To use each request command, please use JSON format. Example:

{
  "name": "x",
  "amount": "y",
  "type": "Kas Masuk" or "Kas Keluar"
}

Authentication

To access the API, basic authentication is required:

  • Username: revou
  • Password: tim6

Contribute

Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.

License

This project is licensed under the MIT License.

fs-financial-tracker's People

Contributors

m-istighfar avatar wahyuwehaye avatar

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.