This project is a Personalized Savings Assistant that helps users analyze bank transactions (via CSV upload) to:
- Identify areas of overspending
- Set and track saving goals (e.g., vacation, mortgage, etc.)
- Display potential savings
- Offer congratulatory messages on milestones
- Provide smart recommendations using a suggestion engine
- 🧠 Transaction categorization using a Large Language Model (LLM)
- 📊 Expense tracking and budgeting
- 🎯 Personalized savings goals
- 📈 Interactive charts and visualizations
- 🤖 Recommendation engine for saving suggestions
- Node.js (>=18)
- npm or yarn
- LLM API key (e.g., OpenAI, Anthropic)
git clone https://github.com/your-username/personal-savings-assistant.git
cd personal-savings-assistant
Or create a new Astro project and integrate this code manually.
npm install
# or
yarn install
Create a .env
file in the root directory:
LLM_API_KEY=YOUR_API_KEY
npm run dev
# or
yarn dev
Then open http://localhost:4321 in your browser.
src/
├── components/ # UI components
├── lib/ # LLM service integration
├── pages/ # Astro pages
├── scripts/ # Client-side chart rendering
├── styles/ # CSS / Tailwind
data/ # Cached transaction & savings data
public/ # Static assets
.env # Environment variables
To render dynamic graphs:
- Create
src/scripts/chart.ts
:
import Chart from 'chart.js/auto';
export function renderLineChart(canvasId: string, data: any) {
const ctx = document.getElementById(canvasId) as HTMLCanvasElement;
new Chart(ctx, {
type: 'line',
data,
options: { responsive: true },
});
}
- In
index.astro
, import and invoke the function:
<script type="module">
import { renderLineChart } from '../scripts/chart.ts';
renderLineChart('myChart', myData);
</script>
- Create
src/lib/chatbotService.ts
:
import 'dotenv/config';
import { readFile, writeFile } from 'fs/promises';
export async function categorizeWithLLM(transaction: string): Promise<string> {
// Use fetch or OpenAI SDK to call LLM
const response = await fetch(/* ... */);
return await response.text();
}
- Use
LLM_API_KEY
for authentication.
-
Create a
data/
directory at the project root. -
Use functions like:
export async function loadCategoryCache() { /* ... */ }
export async function saveCategoryCache(data) { /* ... */ }
This keeps categorized transactions and savings suggestions locally cached.
- Add authentication (OAuth or email-based)
- Export monthly reports
- Gamify savings achievements
- Deploy to platforms like Vercel or Netlify
Feel free to fork the repo, raise issues, or contribute via pull requests! Let's build smarter savings habits together.
Built with ❤️ for CodeSprint 2025