Code Monkey home page Code Monkey logo

smallpaes / expense-tracker-mysql Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 3.0 12.64 MB

A practical web application built with Node.js, Express, and MySQL for you to readily record, view, and manage your expense with an account: Create, view, edit, delete, filter expenses are as easy as pie 🥧

JavaScript 24.11% CSS 57.66% HTML 18.22%
expense-tracker mysql sendgrid facebook nodejs expressjs sequelize passportjs facebook-login express-handlebars

expense-tracker-mysql's Introduction

Expense Tracker 💰

A practical web application built with Node.js, Express, and MySQL for you to readily record, view, and manage your expense with an account: Create, view, edit, delete, filter expenses are as easy as pie 🥧

Trial in this project 🤠

Re-built with MySQL

  • MySQL is used as DBMS in this version, instead of MongoDB
  • Sequelize is used as ORM for MySQL

Project First Look

Application Screen Shot in GIF

Features

Functions Detail URL
Sign up for an account 1. User can sign up an account by inputting name, email, password
2. User can get a warning message for invalid input format
3. User can be redirected to login page and receive a warning message for registered account
4. User can receive an email for successful registration
/users/register
Log in with email 1. User can log in using registered email
2. User can get a warning message for incorrect password or unregistered account
/users/login
Log in with Facebook account User can log in via Facebook with a Facebook account /auth/facebook
Reset password 1. User can choose to reset password by providing email
2. User can receive an email with reset link
3. User can reset email by visiting reset link
/users/reset
Log out User can log out of an account /users/logout
View all expenses 1. User can view expense detail after login
2. User can get an error message when no expense to display after login
/
View total expense 1. User can see total amount of all expense in number
2. User can see total amount of each category expense on bart chart
/
Create an expense 1. User can add an expense with related info after login
2. User can get a warning message for invalid input format
/expenses/new
Edit an expense User can update detail info of an expense after login /expenses/edit/:id
Delete an expense 1. User can delete an expense after login
2. User can receive a warning message before actual delete
/expenses/delete/:id
Filter expenses 1. User can filter expenses based on month and category after login /search
Page not found User can get an error message when travelling to a page not existing /:any_other_URL

Installation

The following instructions will get you a copy of the project and all the setting needed to run it on your local machine:

Prerequisites

Clone

Clone this repository to your local machine

$ git clone https://github.com/smallpaes/expense-tracker-mysql.git

Setup Datebase

Create and use expense_tracker database via MySQL Workbench

Run the following code

drop database if exists expense_tracker;
create database expense_tracker;
use expense_tracker;

Setup App

1. Create an SendGrid & Facebook account

2. Create and get a SendGrid API Key

Dashboard -> Settings -> API Keys -> Create API Key

3. Create an Facebook App and get the App ID & Secret

My Apps -> Create App -> Scenario: Integrate Facebook Login -> Settings -> Basic

4. Enter the project folder

$ cd expense-tracker-mysql

5. Install npm packages

$ npm install

6. Create .env file

$ touch .env

7. Store API Key in .env file and save

SENDGRID_KEY=<YOUR_SENDGRID_API_KEY>
FACEBOOK_ID=<YOUR_FACEBOOK_APP_ID>
FACEBOOK_SECRET=<YOUR_FACEBOOK_APP_SECRET>
FACEBOOK_CALLBACK=<YOUR_FACEBOOK_REDIRECT_URI>

8. Edit password in config.json file

/config/config.json

"development": {
  "username": "root",
  "password": "<YOUR_WORKBENCH_PASSWORD>",
  "database": "expense_tracker",
  "host": "127.0.0.1",
  "dialect": "mysql",
  "operatorsAliases": false
}

9. Create models

run the following code in console

$ npx sequelize db:migrate

10. Activate the server

$ npm run dev

11. Find the message for successful activation

> Express is listening on http://localhost:3000

You may visit the application on browser with the URL: http://localhost:3000


Authors

Mike Huang

expense-tracker-mysql's People

Contributors

smallpaes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.