You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-52Lines changed: 43 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
2
1
<imgwidth="1596"alt="Screenshot 2024-11-12 at 1 42 58 PM"src="https://github.com/user-attachments/assets/964b5154-ae4e-4216-a060-37e0a5eda965">
3
2
4
3
## Important
@@ -13,7 +12,6 @@ I started this open-source project because I found that most existing solutions,
13
12
14
13
I realized that leveraging AI to read and extract text from credit card PDF statements is a more efficient way to store and categorize expenses. By storing this data in a database, we can streamline the entire process. My goal is to create a self-hosted, local-first solution—much like Firefly or ActualBudget—where users have more control over their data.
15
14
16
-
17
15
## Features
18
16
19
17
The main feature to upload credit card PDFs or zip files containing credit card PDFs will work as follows:
@@ -45,21 +43,18 @@ The main feature to upload credit card PDFs or zip files containing credit card
45
43
1.**Background Job Processing**
46
44
PDF statements are sent to the background job server for processing.
47
45
48
-
2.**Parsing Workflow**
46
+
1.**Parsing Workflow**
47
+
49
48
-**Convert PDFs to Images**: The PDF files are converted into images.
50
49
-**OCR (Optical Character Recognition)**: OCR is run on the images to extract text from the statement.
51
50
-**OpenAI API**: The extracted text is sent to the OpenAI API, which returns parsed expenses, categorized according to custom rules.
52
51
53
-
3.**Temporary Storage in Redis**
54
-
The parsed expenses are temporarily stored in Redis.
55
-
56
-
4.**Frontend Options**
52
+
1.**Frontend Options**
57
53
On the frontend, users can:
58
54
- Store the parsed data in the database
59
55
- Download it as a CSV file
60
56
- Edit the data before taking any further action
61
57
62
-
63
58
## Database and OpenAI key
64
59
65
60
### Open AI Key
@@ -76,51 +71,52 @@ This [medium](https://medium.com/@lorenzozar/how-to-get-your-own-openai-api-key-
76
71
77
72
Make sure you have sufficient credit in your OpenAI account for billing purposes. It costs approximately $0.03 USD per credit card statement. Detailed cost calculations will be provided here.
78
73
79
-
80
74
### Postgresql DB Connection
81
75
82
76
You can setup postgresql locally, but here is the guide on setting up in supabase
83
77
84
78
1. Create a Supabase Account
85
-
- Go to the [Supabase website](https://supabase.com/) and sign up for an account.
86
-
- If you already have an account, simply log in.
79
+
80
+
- Go to the [Supabase website](https://supabase.com/) and sign up for an account.
81
+
- If you already have an account, simply log in.
87
82
88
83
1. Create a New Project
89
-
- After logging in, click the **New Project** button on your dashboard.
90
-
- Enter your project details:
91
-
-**Name**: Choose a unique name for your project.
92
-
-**Organization**: Select your organization or create a new one if necessary.
93
-
-**Database Password**: Create a secure password for your database. Keep this password safe since you'll need it to connect to your database later.
94
-
-**Region**: Choose the closest server location to optimize performance.
95
84
96
-
Once done, click **Create new project**.
85
+
- After logging in, click the **New Project** button on your dashboard.
86
+
- Enter your project details:
87
+
-**Name**: Choose a unique name for your project.
88
+
-**Organization**: Select your organization or create a new one if necessary.
89
+
-**Database Password**: Create a secure password for your database. Keep this password safe since you'll need it to connect to your database later.
90
+
-**Region**: Choose the closest server location to optimize performance.
97
91
98
-
3. Wait for the Database to be Set Up
99
-
- It may take a few minutes for Supabase to set up your PostgreSQL database. Once ready, you’ll be taken to your project dashboard.
92
+
Once done, click **Create new project**.
100
93
101
-
4. Retrieve Your Database Connection String
102
-
- From your project dashboard, navigate to the **Settings** tab.
103
-
- Under **Database**, you’ll see details for connecting to your database.
104
-
- Look for **Connection String** or **Database URL**. It will look something like this:
94
+
1. Wait for the Database to be Set Up
105
95
106
-
```plaintext
107
-
postgres://username:password@host:port/database
108
-
```
96
+
- It may take a few minutes for Supabase to set up your PostgreSQL database. Once ready, you’ll be taken to your project dashboard.
109
97
110
-
You will need this connection string to connect your application to the Supabase database.
98
+
1. Retrieve Your Database Connection String
111
99
112
-
5. Save Your Connection String
113
-
- Make sure to copy and securely store the connection string. You will need it to set up the database in your app.
100
+
- From your project dashboard, navigate to the **Settings** tab.
101
+
- Under **Database**, you’ll see details for connecting to your database.
102
+
- Look for **Connection String** or **Database URL**. It will look something like this:
114
103
104
+
```plaintext
105
+
postgres://username:password@host:port/database
106
+
```
115
107
108
+
You will need this connection string to connect your application to the Supabase database.
109
+
110
+
5. Save Your Connection String
111
+
- Make sure to copy and securely store the connection string. You will need it to set up the database in your app.
116
112
117
113
## Docker Setup
118
114
119
115
### Prerequisite
120
116
121
117
1.**Docker**
122
-
- Install docker
123
-
- Run Docker
118
+
- Install docker
119
+
- Run Docker
124
120
125
121
### Installation
126
122
@@ -135,8 +131,8 @@ You will need this connection string to connect your application to the Supabase
135
131
```sh
136
132
cd self-hosted-expense-tracker
137
133
```
138
-
139
-
1. Run npm install
134
+
135
+
1. Run npm install
140
136
141
137
```sh
142
138
npm install
@@ -151,7 +147,7 @@ You will need this connection string to connect your application to the Supabase
151
147
1. Run prisma migrate for the first time to migrate database.
0 commit comments