Skip to content

Financial Tracker for SOFTENG 310 Project in the University of Auckland by Team Meow Meow Kitty Cats (Group 6).

License

Notifications You must be signed in to change notification settings

Taks0708/SOFTENG310-FinTrack

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

Financial Tracker

Financial Tracker for SOFTENG 310 Project at the University of Auckland by Team Meow Meow Kitty Cats (Group 6). This project allows users to input and track their income and expenses for a certain period.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Testing
  4. Available Scripts
  5. Configuration of the .env File
  6. Contributing
  7. License
  8. Contact
  9. Libraries/APIs
  10. Learn More
  11. Acknowledgments

About The Project

The project is a web app that uses React.js and Tailwind for the frontend, and Express.js for the backend. The database used is PostgreSQL.

To run the web app locally, make sure to run the frontend and backend in separate terminals. If you come across errors with logging in, the backend probably isn't running.

You can contact UPI yois920 with an email or message Discord username Taks7. Please only contact us if you are absolutely stuck with the set up after the project is handed off.

Built With

  • React
  • Express
  • PostgreSQL
  • Tailwind CSS

(back to top)

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

Make sure you have Node.js and npm installed:

Check if npm is installed:

npm -v

Installation

  1. Clone the repo
    git clone https://github.com/Taks0708/SOFTENG310-FinTrack.git
  2. Navigate to the project directory
    cd SOFTENG310-FinTrack
  3. Install dependencies for the frontend and backend separately.

Frontend

cd frontend
npm install

To run the frontend:

npm start

Backend

cd backend
npm install

To run the backend:

npm start

Testing

The backend has some unit tests for the controller classes to ensure that the functions registered to each endpoint works. In order to run these tests, go to the backend directory and enter:

npm start

The coverage of these tests can be seen by entering the following when in the backend directory:

npm run coverage

Do note that this will generate some folders in the backend directory. These folders have already been added to the .gitignore, and shouldn't be pushed to the main repository.

If the tests fail, make sure that all backend dependencies have been installed. If, for some reason, they aren't being installed by an npm install, enter npm install --save-dev mocha chai sinon nyc .

(back to top)

Available Scripts

In the frontend directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can't go back!

If you aren't satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

(back to top)

Configuration of the .env File

In order to access the PostgreSQL database hosted by Aiven for storing user and transaction data, a .env file is required in the backend folder. This file should include the following fields:

PG_USER=<your_database_user>
PG_HOST=<your_database_host>
PG_DATABASE=<your_database_name>
PG_PASSWORD=<your_database_password>
PG_PORT=<your_database_port>
CA_CERT_PATH=../certs/ca.crt
CIPHER=<your_cipher_string>
REACT_APP_GEMINI_API_KEY=<your_gemini_api_key>

Instructions:

  1. Obtain the .env File: Please copy the above or use .env.template in the backend folder. You may also need to create your own PostgreSQL database on Aiven for personal security reasons. When using .env.template, please rename to .env and put it in the backend folder.

  2. Creating a PostgreSQL Database: Follow the instructions on the Aiven website to create your PostgreSQL database.

  3. Fill in the .env File: After creating your database, fill in the fields in the .env file with your database's information:

    • PG_USER: Your database user.
    • PG_HOST: The host of your database.
    • PG_DATABASE: The name of your database.
    • PG_PASSWORD: Your database password.
    • PG_PORT: The port number (default is usually 5432).
    • CIPHER: This can be any string you want; it's used to encrypt tokens.
    • REACT_APP_GEMINI_API_KEY: This can be created on the Gemini API page.
  4. Place the .env File: Once the .env file is configured, place it in the backend folder.

  5. CA Certificate: Ensure that you have your CA certificate from Aiven in the file backend/src/certs/ca.crt, as the CA_CERT_PATH is prefilled.

Once these steps are completed, the database should work automatically, regardless of whose database you're using. If you encounter any errors, double-check that all fields are filled out correctly.

Please contact us if need any help.

(back to top)

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork and clone the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push --set-upstream origin feature/AmazingFeature)
  5. Open a Pull Request

Check contribution document for more detail: Contribution

(back to top)

License

Distributed under the Apache-2.0 License. See Licnese for more information.

(back to top)

Contact

You can contact UPI yois920 with an email or message Discord username Taks7. Please only contact us if you are absolutely stuck with the set up after the project is handed off.

(back to top)

Libraries/APIs

This project utilizes several libraries and APIs to enhance functionality:

  • React: A JavaScript library for building user interfaces.
  • Tailwind CSS: A utility-first CSS framework for styling.
  • Express: A minimal and flexible Node.js web application framework.
  • Axios: A promise-based HTTP client for making requests to the backend.
  • Recharts: A charting library for creating graphical representations of transaction history.
  • date-fns: A modern JavaScript date utility library for manipulating dates.
  • Gemini API: Used for providing financial advice to users.
  • Chai: An assertion library for Node.js and browsers, used for testing.
  • Sinon: A library for creating spies, mocks, and stubs for JavaScript testing.

Feel free to refer to the documentation of each library/API for more information on their usage.

(back to top)

Learn More

To learn more about the technologies and frameworks used in this project, check out the following links:

(back to top)

Acknowledgments

(back to top)

About

Financial Tracker for SOFTENG 310 Project in the University of Auckland by Team Meow Meow Kitty Cats (Group 6).

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published