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
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.
To get a local copy up and running, follow these simple steps.
Make sure you have Node.js and npm installed:
Check if npm is installed:
npm -v
- Clone the repo
git clone https://github.com/Taks0708/SOFTENG310-FinTrack.git
- Navigate to the project directory
cd SOFTENG310-FinTrack
- Install dependencies for the frontend and backend separately.
cd frontend
npm install
To run the frontend:
npm start
cd backend
npm install
To run the backend:
npm start
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
.
In the frontend directory, you can run:
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.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
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.
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.
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>
-
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 thebackend
folder. -
Creating a PostgreSQL Database: Follow the instructions on the Aiven website to create your PostgreSQL database.
-
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.
-
Place the .env File: Once the .env file is configured, place it in the
backend
folder. -
CA Certificate: Ensure that you have your CA certificate from Aiven in the file
backend/src/certs/ca.crt
, as theCA_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.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork and clone the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push --set-upstream origin feature/AmazingFeature
) - Open a Pull Request
Check contribution document for more detail: Contribution
Distributed under the Apache-2.0 License. See Licnese for more information.
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.
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.
To learn more about the technologies and frameworks used in this project, check out the following links:
- Create React App Documentation: Information about getting started with Create React App.
- React Documentation: Official React documentation.
- Code Splitting: Learn about code splitting in React apps.
- Analyzing the Bundle Size: Techniques to analyze your bundle size.
- Making a Progressive Web App: Guide to making your app a PWA.
- Advanced Configuration: Configuration details for Create React App.
- Deployment: Instructions for deploying your React app.
- Troubleshooting: Tips for common issues, including build failures.