A non-account system that tracks and generate data insights about your spending.
- Nodejs
- MongoDB
- Clone this repository
git clone https://github.com/khianvictorycalderon/Spending-Tracker.git
cd backendnpm installto install dependencies.- Create an
.envfile inside thebackendfolder that contains:
PORT=<your-available-port>
CORS_ALLOW_ORIGIN=<your-frontend-origin>
MONGODB_URI=<your-mongodb-url>npm run devto test the backend.
cd frontendnpm installto install dependencies.- Create an
.envfile inside thefrontendfolder that contains:
VITE_API_URL=<your-express-url>npm run devto test the frontend.
- Make sure that PORT in the backend and PORT used in API URL in frontend are same
- Make sure that your frontend development and CORS_ALLOW_ORIGIN are same for development
The following is a list of installed dependencies and configuration settings used in this project.
You don’t need to install anything manually, as all dependencies are already managed through package.json.
This section is provided for reference only, to give you insight into how the project was set up.
npm install express mongoose cors dotenv bcryptjs cookie-parsernpm install --save-dev nodemon
- Update
package.json:"scripts": { "start": "node server.js", "dev": "nodemon server.js" },
npm install tailwindcss @tailwindcss/vite axios chart.js react-chartjs-2
- Update
vite.config.ts:import tailwindcss from '@tailwindcss/vite' export default defineConfig({ plugins: [ tailwindcss(), ], })
- Admin has one account only
- Admin logs in with default password of
admin123and default OTP of123456. - After logging in, Admin should immediately change the password.
- After each logout, a new OTP will be generated each time.
- Admin can now add users and track their spendings, and view data insights.
-
Login
- Navigate to the login page.
- Enter the default password and OTP (or your updated password if previously changed).
- Click Login.
-
Change Password
- Immediately after login, update your password to secure your account.
- Enter your old password, new password, and confirm new password.
- Click Update.
-
Add Users
- Go to the Track Spending page.
- In the Users panel, type the new user’s name and click Add.
- Existing users can be edited or deleted.
-
Track Spendings
- Select a user from the Users panel.
- Add spendings with Amount, Category, and Note.
- Spendings can be edited or deleted.
-
View Insights / Analytics
- Go to the Insights page.
- Choose to view All Users or a specific user.
- Select the chart type: Bar or Pie.
- View aggregated data and static stats (Total Users, Total Spendings, Average, Mode, Highest & Lowest Spender).
- Data is aggregated on the backend, so charts reflect combined spendings automatically.
-
Logout
- Click Logout to end the session.
- A new OTP is generated for the next login.