This project is designed for recording personal expenses. Users can search, add, edit, and delete expenses, categorize expenses, and check the total expenses.
-
Users can register an account
(1). After registration, users can log in/out
(2). Only logged-in users can use the project services. -
Log in with a
Googleaccount, and upon successful verification, users are directed to their personal expense list page. -
View the list of expenses created by the user and the total amount.
-
Able to categorize expenses by year, month, and category , and display the total expense amount.
-
Able to view a pie chart showing the proportion of each category in the total expenses.
-
Add,Edit, andDeletean expense.
- Open a terminal and run
git cloneto download the project to your computer
$ git clone https://github.com/yuan6636/expense-tracker.git- Navigate to the
expense-trackerfolder
$ cd expense-tracker- Install packages with
npm
$ npm install- Ensure
config.jshas the correctpasswordanddatabasesettings
"development": {
"username": "root",
"password": "password",
"database": "record",
"host": "127.0.0.1",
"dialect": "mysql"
}- Set up the database
$ npm run dbsetup
$ npm run seed-
Obtain
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETfrom theGoogle API Console -
Create a
.envfile, and populate it with tne contents from.env.example. SetSESSION_SECRETto a value of your choice, andMYSQL_ROOT_PASSWORDto the password you set forMySQL.
SESSION_SECRET= <Your session secret>
GOOGLE_CLIENT_ID= <Your google client ID>
GOOGLE_CLIENT_SECRET= <Your google client secret>
MYSQL_ROOT_PASSWORD= <Your mysql server password>
- Run
app.js
$ npm run dev- If the terminal displays the following message, it means
serverhas started successfully
App is running on localhost:3000-
Open your browser and go to
http://localhost:3000to use the project -
To stop the
server, pressctrl + Cin the terminal
- Run the following command to perform tests
npm run testexpense-tracker.mp4
Developer: yuan6636