Skip to content

Commit 72c9d59

Browse files
committed
Generated by Spark: integrate with superbase auth
1 parent b01a3c7 commit 72c9d59

11 files changed

Lines changed: 656 additions & 27 deletions

File tree

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Supabase Configuration
2+
# Replace with your actual Supabase project values
3+
VITE_SUPABASE_URL=https://your-project-id.supabase.co
4+
VITE_SUPABASE_ANON_KEY=your-anon-key-here
5+
6+
# Get these values from:
7+
# 1. Go to https://supabase.com/dashboard
8+
# 2. Create a new project or select existing
9+
# 3. Go to Settings > API
10+
# 4. Copy the Project URL and anon/public key

README_NEW.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# 记账 (Vue Expense Tracker)
2+
3+
A modern, secure expense tracking application built with Vue 3, Vuetify (Material Design), and Supabase authentication.
4+
5+
## ✨ Features
6+
7+
- 🔐 **Secure Authentication** - Email/password login with Supabase Auth
8+
- 💰 **Easy Expense Entry** - Quick expense recording with categories and notes
9+
- 📊 **Visual Charts** - Monthly/yearly expense analysis with category breakdowns
10+
- 📱 **Mobile-First Design** - Optimized for iPhone and mobile devices
11+
- 🎨 **Material Design** - Beautiful, intuitive interface with Vuetify 3
12+
- ☁️ **Cloud Sync** - Secure data storage with Supabase
13+
- 🔒 **Data Privacy** - Row-level security ensures your data stays private
14+
15+
## 🚀 Quick Start
16+
17+
### Prerequisites
18+
19+
1. **Supabase Account** - Sign up at [supabase.com](https://supabase.com)
20+
2. **Node.js** - Version 18+ recommended
21+
22+
### Setup
23+
24+
1. **Configure Supabase**
25+
```bash
26+
# Copy environment template
27+
cp .env.example .env
28+
29+
# Edit .env with your Supabase credentials
30+
# Get these from your Supabase dashboard
31+
```
32+
33+
2. **Create Database Schema**
34+
- Open your Supabase dashboard
35+
- Go to SQL Editor
36+
- Run the contents of `supabase-schema.sql`
37+
38+
3. **Install & Run**
39+
```bash
40+
npm install
41+
npm run dev
42+
```
43+
44+
4. **Start Tracking!**
45+
- Register with your email
46+
- Confirm your email address
47+
- Start tracking expenses
48+
49+
## 🛠️ Tech Stack
50+
51+
- **Framework**: Vue 3 with Composition API
52+
- **UI Library**: Vuetify 3 (Material Design)
53+
- **Backend**: Supabase (Auth + Database)
54+
- **Build Tool**: Vite
55+
- **Charts**: Chart.js with vue-chartjs
56+
- **Icons**: Material Design Icons
57+
58+
## 📋 Setup Details
59+
60+
For detailed setup instructions, see [SUPABASE_SETUP.md](./SUPABASE_SETUP.md)
61+
62+
## 🏗️ Architecture
63+
64+
- **Authentication**: Supabase Auth with Row Level Security
65+
- **Database**: PostgreSQL with user-isolated expense data
66+
- **Frontend**: Vue 3 Composition API with TypeScript
67+
- **Styling**: Vuetify 3 Material Design components
68+
- **Charts**: Chart.js for expense visualization
69+
70+
## 🔒 Security
71+
72+
- User authentication required for all data access
73+
- Row Level Security ensures data isolation
74+
- Environment variables for sensitive configuration
75+
- No user data stored locally
76+
77+
## 📱 Mobile Optimization
78+
79+
- Responsive Material Design interface
80+
- Touch-friendly interactions
81+
- Optimized for iPhone 12 mini and similar devices
82+
- Bottom navigation for easy thumb access
83+
84+
## 📄 License
85+
86+
MIT License - see LICENSE file for details

SUPABASE_SETUP.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Supabase Setup Instructions
2+
3+
## 1. Create Supabase Project
4+
5+
1. Go to [https://supabase.com](https://supabase.com)
6+
2. Sign up/Login and create a new project
7+
3. Wait for the project to be provisioned
8+
9+
## 2. Configure Database
10+
11+
1. Go to your Supabase dashboard
12+
2. Navigate to SQL Editor
13+
3. Copy and paste the contents of `supabase-schema.sql`
14+
4. Run the SQL to create the expenses table and policies
15+
16+
## 3. Configure Environment Variables
17+
18+
1. Copy `.env.example` to `.env`
19+
2. Go to Settings > API in your Supabase dashboard
20+
3. Copy the Project URL and anon/public key
21+
4. Update the values in `.env`
22+
23+
```
24+
VITE_SUPABASE_URL=https://your-project-id.supabase.co
25+
VITE_SUPABASE_ANON_KEY=your-anon-key-here
26+
```
27+
28+
## 4. Authentication Setup
29+
30+
The app is configured to use email/password authentication. Users will need to:
31+
- Sign up with email and password
32+
- Confirm their email (check Supabase email settings if needed)
33+
- Sign in to access the expense tracking features
34+
35+
## 5. Row Level Security
36+
37+
The database is configured with Row Level Security (RLS) to ensure:
38+
- Users can only see their own expenses
39+
- Users can only modify their own data
40+
- Data is properly isolated between users
41+
42+
## Features Included
43+
44+
- ✅ User registration and login
45+
- ✅ Secure expense storage per user
46+
- ✅ Real-time data sync with Supabase
47+
- ✅ Logout functionality
48+
- ✅ User profile display in header
49+
50+
## Database Schema
51+
52+
```sql
53+
expenses:
54+
- id (UUID, Primary Key)
55+
- user_id (UUID, Foreign Key to auth.users)
56+
- amount (Decimal)
57+
- category (Text)
58+
- note (Text)
59+
- date (Date)
60+
- created_at (Timestamp)
61+
```

package-lock.json

Lines changed: 150 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@github/spark": "^0.0.1",
1616
"@mdi/font": "^7.4.47",
1717
"@phosphor-icons/vue": "^2.2.1",
18+
"@supabase/supabase-js": "^2.52.1",
1819
"@tailwindcss/vite": "^4.0.17",
1920
"@vitejs/plugin-vue": "^6.0.0",
2021
"@vue/typescript": "^1.8.20",

0 commit comments

Comments
 (0)