Skip to content

ish-u/expense-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Manager

A Simple Expense Manager that helps Users track their Expenses.

Demo

img

Run Locally

Clone the project

  git clone https://github.com/ish-u/expense-manager.git
  cd expense-manager

Setup Server

  • Install Packages

    cd server
    npm i
  • Obtain the URI for your Cluster and OpenStackExchange API KEY :-

    • Set Up Atlas

    • Connect to Cluster

    • Generate YOUR SECRET KEY using require('crypto).randomBytes(64).toString('hex')

    • Set Up .env file with the following variables

      DB_CONNECTION={YOUR CLUSTER URI}
      ACCESS_TOKEN_SECRET={YOUR SECRET KEY}
      CURRENCY_API_TOKEN={YOUR OPENSTACKEXCHANGE API KEY}
      
  • Run the Server using

    npm run dev
  • The Server will be live at http://localhost:5000

Setup Client

  • Install Packages

    cd client
    npm install
  • Set Up .env file as following:

    VUE_APP_API=http://localhost:5000/api
    
  • Run the Client using either

    npm run serve
    
  • The Application will be live at http://localhost:8080/

API Reference

  • Base URL - http://localhost:5000/

  • Sign In

    POST /api/signin
    • Header

      "Content-Type": "application/json"
    • Body

      "username": username,
      "password": password,
    • Response

      • Success

        • Status Code :200
        • Data
          {
              "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlVzxXIwMiIsImlhdCI6MTYyNzIwODk4M30.d3KdCfAYrv2yircz9fBUwObJZHM9_4aVFKmbfR2Hx3Y"
          }
      • Error

        • Status Code 701
  • Sign Up

    POST /api/signin
    • Header

      "Content-Type": "application/json"
    • Body

      "name": name,
      "username": username,
      "email": email,
      "password": password,
    • Response

      • Success
        • Status Code :200
      • Error
        • Status Code 701
  • Get Dashboard Data

    GET /dashboard
    • Header

      authorization: "Bearer " + TOKEN,
    • Body

          "name": name,
          "username": username,
          "email": email,
          "password": password,
      • URL Parameter Type Description
        reqCurrnecySymbol string Required. Currency of Total Amount
    • Response

      • Success
        • Status Code : 200
        • Data
        {
            "transactions": [
            {
                "_id": "60fd15d984af3d003be4a248",
                "username": "User02",
                "DateTime": "2021-07-25T12:58:00.000Z",
                "Amount": 5000,
                "Currency": "INR",
                "Description": "Food",
                "Category": "Food",
                "__v": 0
            },
            {
                "_id": "60fd21d60e4eb50f65ab60cb",
                "username": "User02",
                "DateTime": "2021-07-03T08:28:00.000Z",
                "Amount": 500,
                "Currency": "INR",
                "Description": "Food",
                "Category": "Food",
                "__v": 0
            }
            ],
            "totalAmount": 5500,
            "currencySymbols": [
                {
                    "ID": "ALL",
                    "Symbol": "Lek"
                },
                {
                    "ID": "XCD",
                    "Symbol": "$"
                },
                {
                    "ID": "EUR",
                    "Symbol": ""
                },
                {
                    "ID": "BBD",
                    "Symbol": "$"
                },
                {
                "ID": "BTN",
                "Symbol": null
                },
                ...
                ],
            "exchangeRates": {
                "AED": 3.6732,
                "AFN": 79.608879,
                "ALL": 103.828805,
                "ARS": 96.34195,
                ...
                "ZWL": 322
            }
        }
      • Error
        • Status Code :701
  • Get Expense Data (Transactions)

    GET /getExpense
    • Header

      authorization: "Bearer " + TOKEN,
    • Response

      • Success
        • Status Code : 200
        • Data
          {
              "_id": "60fd15d984af3d003be4a248",
              "username": "User02",
              "DateTime": "2021-07-25T12:58:00.000Z",
              "Amount": 5000,
              "Currency": "INR",
              "Description": "Food",
              "Category": "Food",
              "**v": 0
          },
          {
              "_id": "60fd21d60e4eb50f65ab60cb",
              "username": "User02",
              "DateTime": "2021-07-03T08:28:00.000Z",
              "Amount": 500,
              "Currency": "INR",
              "Description": "Food",
              "Category": "Food",
              "**v": 0
          }
      • Error
        • Status Code : 701
  • Save Expense Data (a Transactions)

    POST /saveExpense
    • Header

      "Content-Type": "application/json",
      authorization: "Bearer " + TOKEN,
    • Body

      "date": Date,
      "time": Time,
      "Amount": Amount,
      "Currency": Currency,
      "Category": Category,
      "Description": Description,
    • Response

      • Success
        • Status Code : 200
      • Error
        • Status Code : 701
  • Edit Expense Data (a Transactions)

    POST /updateExpense
    • Header

      "Content-Type": "application/json",
      authorization: "Bearer " + TOKEN,
    • Body

      "date": Date,
      "time": Time,
      "Amount": Amount,
      "Currency": Currency,
      "Category": Category,
      "Description": Description,
    • URL Parameter Type Description
      id string Required. ID of the Document to be Updated
    • Response

      • Success
        • Status Code : 200
      • Error
        • Status Code : 701
  • Delete Expense Data (a Transactions)

    POST /deleteExpense
    • Header

      "Content-Type": "application/json",
      authorization: "Bearer " + TOKEN,
    • URL Parameter Type Description
      id string Required. ID of the Document to be Deleted
    • Response

      • Success
        • Status Code : 200
      • Error
        • Status Code : 701
  • Get Report

    GET /getReport
    • Header

      authorization: "Bearer " + TOKEN,
    • Response

      • Success
        • Status Code : 200
        • Data
          {
              "categoryMoney": {
                  "Fuel": 667.165031198157,
                  "Home": 2624.850141334595,
                  "Food": 500
              },
              "weekMoney": {
                  "26": "1750.00",
                  "27": "1374.85",
                  "28": "567.17",
                  "29": "100.00",
                  "30": 0
              },
              "range": [
                  "Thu Jul 01 2021",
                  "Sat Jul 31 2021"
              ]
          }
          Currency - USD
      • Error
        • Status Code : 701

Releases

No releases published

Packages

No packages published