A Simple Expense Manager that helps Users track their Expenses.
git clone https://github.com/ish-u/expense-manager.git
cd expense-manager
-
Install Packages
cd server npm i
-
Obtain the URI for your Cluster and OpenStackExchange API KEY :-
-
Generate
YOUR SECRET KEY
usingrequire('crypto).randomBytes(64).toString('hex')
-
Set Up
.env
file with the following variablesDB_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
-
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/
-
Base URL -
http://localhost:5000/
-
POST /api/signin
-
Header
"Content-Type": "application/json"
-
Body
"username": username, "password": password,
-
Response
-
Success
- Status Code :
200
- Data
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlVzxXIwMiIsImlhdCI6MTYyNzIwODk4M30.d3KdCfAYrv2yircz9fBUwObJZHM9_4aVFKmbfR2Hx3Y" }
- Status Code :
-
Error
- Status Code
701
- Status Code
-
-
-
POST /api/signin
-
Header
"Content-Type": "application/json"
-
Body
"name": name, "username": username, "email": email, "password": password,
-
Response
- Success
- Status Code :
200
- Status Code :
- Error
- Status Code
701
- Status Code
- Success
-
-
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 } }
- Status Code :
- Error
- Status Code :
701
- Status Code :
- Success
-
-
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 }
- Status Code :
- Error
- Status Code :
701
- Status Code :
- Success
-
-
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
- Status Code :
- Error
- Status Code :
701
- Status Code :
- Success
-
-
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
- Status Code :
- Error
- Status Code :
701
- Status Code :
- Success
-
-
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
- Status Code :
- Error
- Status Code :
701
- Status Code :
- Success
-
-
GET /getReport
-
Header
authorization: "Bearer " + TOKEN,
-
Response
- Success
- Status Code :
200
- Data
Currency - USD
{ "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" ] }
- Status Code :
- Error
- Status Code :
701
- Status Code :
- Success
-