Skip to content

An API with multiple functionalities that tracks expenses for the respective user (following the MVC architecture) | NodeJS + Express +MongoDB |

Notifications You must be signed in to change notification settings

Ryuk-hash/node.expense-tracker-backend

Repository files navigation

Expense Tracker API

A simple app that tracks expenses for the respective user. | NodeJS + Express +MongoDB |

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

First of all, simply clone/download the project to your local machine location.

Prerequisites

Recommended IDE:

VSCode
Others: Atom, Sublime or simply choose as per your comfortability and experience.

Knowledge:

Scripting: NodeJS
Database: SQL or NoSQL [Used here: MongoDB]
Hosting [Optional]: AWS or GCP or you can host it on the local machine as well. [Used here: Atlas for hosting on AWS]

 https://nodejs.dev

Installing

A step by step series of examples that tell you how to get a development env running.

Installing dependencies:

If you are using VSCode pop up the terminal (Ctrl + `) and make sure you're in the correct folder directory [final-expense-tracker] (if for some reason you are not, use 'cd + ' to visit the required directory).

npm i(nstall)

Now comes to your preference of hosting (as mentioned above I am using Atlas). I will be using Atlas to create a cluster which after successful hosting will contain all my database records and it has several functionalities like you can manually edit/delete your documents, create new collections, create an entire database. You can link a normal local-hosted database as well.

Basically the following details need to be used in order to successfully establish a connection with Atlas:

P.S: I'll not be including my account details here (duh), you will have to create your own account. Please watch a tutorial if you don't know how.

serviceID: '',  
accountSID: '',  
authToken: '',  
dataBase: '',  
dataBasePassword: ''  

After all the dependencies are installed and database link established and npm start (following message will be visible in console if successful) - then run the following command and a database-established message will be display (if it's not, there was some problem).

>> npm start  
App running on port: 3000
DB Connection Successful!

Running the tests

API Testing was done using Postman software. It's a very handy and useful tool, very easy to use once you get the hang of it.

Test-Collections:
Categories
Expenses
User
PhoneAuth

These above test-collections were created. In them, several http calls (GET, POST, PATCH, DEL) were made to specific routes as defined in the code.

As an example, one of them to display the list of all expenses is as follows:

ReturnsAllExpensesFromDatabase

Filtering inclusive

One of the features in this API is that we can make API Testing calls for the parameters (e.g: >, <, >=, <=) and these parameters are included in the postman tab on which the request is being made. As an example of parametric fetching results from the database:

ReturnsParametricExpensesFromDatabase

Built With

Authors

About

An API with multiple functionalities that tracks expenses for the respective user (following the MVC architecture) | NodeJS + Express +MongoDB |

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published