A simple app that tracks expenses for the respective user. | NodeJS + Express +MongoDB |
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.
VSCode
Others: Atom, Sublime or simply choose as per your comfortability and experience.
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
A step by step series of examples that tell you how to get a development env running.
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!
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:
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:
- NodeJS - JavaScript Runtime Environment
- Express - Web Application Framework
- VSCode - IDE
- MongoDB: - Database /NoSQL/
- Hosting on Atlas (cloud service): - Cloud Database
- Postman: - API Testing
- [Optional] GUI for MongoDB: - Software i.e. GUI version for MongoDB
- Mandeep Singh - Ryuk-hash