Expense-tracker project

Introduction

I am a newbie in learning the programming language of JS (javascript), HTML, CSS. We know that everyone make the Todo-list project when they were also newbies, and me too. After learning the make the todo-list project by Express and Node.js, using the database by MongoDB and SQL. I want to enhance my memory and keep using the technique that I just learn. So, this project needs to have some features:

  • It doesn't cost me more than two weeks.

  • Can use a simple template to produce the web page. (Cause I want to learn the Back-end system)

  • Can operate the database and is easy to use a lot of different syntaxes in the same logical function.

  • In the future, I can extend more features if I finish it. (like the analysis, figure, and connection of other cloud storage)

The expense-tracker can be matched with the above that is why I choose it.

Technique aspect

For the code environment, I use these package of techniques as following:

  1. Node.js & Express:
    that is the base environment for the back-end system. Express is a much light package for setting up the server and Node.js can help me to write the JS code on my terminal. Of course, it has a handlebar and session in Express that I don't need to download other packages.

  2. MongoDB:
    it is a NoSQL database. For this project, it doesn't need to have many tables to take the relationship with each. Just use simple data, like the categories, users, and expense records. Only three tables can connect together. For SQL, I consider it can be used for complicated tables, like the record of food or sweet recipe because it needs comments, materials, food style, etc.

  3. Passport for local, FB & Google:
    it is very important to verify the user by the verification of the package. Passport can do it easily and it is always used with Node and Express.

  4. MVC model:
    I use this model to design the process of programming because it will be added the expansion of features and modify the code easily in the future. For example, if you want to add some feature, you can add the function of code in the controller and set the route in the modules.

The Challenge

In this project, there are some challenges that I meet as following:

  • First, it cost me a lot of time to consider the configuration of folders and the structure of MVC. Like what kind of files should be put in the models, and what kind of controllers should I do. I tried to write the routes of all features that can make me think easily. After writing the routes, I start to follow the step of MVC model so that can make me work fluently.

  • M: create or modify the database models.

  • V: write the view page of the feature in HTML.

  • C: write the logical program for this feature in the controller folder.

  • It also consumes a lot of time by searching the technical document for the syntax. Sometimes, you may have some errors or bugs when implementing the code and need to fix them, or you try to add a new feature that you had never made it. The way to a solution maybe is by google the problem, and watch the official document. However, the important point is you need to type the point of a keyword. It will not help you to solve the problem fast if you type the wrong keyword.

  • Some problems are about the order for implementing the program. For example, you want to edit the expense and update it in the database and show it on the page but it didn’t work even it didn’t show the error for you and everything looks normal. You have to think about the order of program execution clearly or it will take you a lot of time to fix that.

Conclusion

It is very important to think about the design of route, database, or the configuration of MVC model before starting to code that. You will make the project very fluent if you prepare everything well and can reduce the layers of error.

GitHub: Expense-tracker