Skip to content

Commit d43e731

Browse files
authored
Attach documents to expenses (#64)
* Upload documents to receipts * Improve documents * Make the feature opt-in * Fix file name issue
1 parent 11d2e29 commit d43e731

File tree

15 files changed

+2064
-148
lines changed

15 files changed

+2064
-148
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Spliit is a free and open source alternative to Splitwise. You can either use th
1717
- [x] Tell the application who you are when opening a group [(#7)](https://github.com/spliit-app/spliit/issues/7)
1818
- [x] Assign a category to expenses [(#35)](https://github.com/spliit-app/spliit/issues/35)
1919
- [x] Search for expenses in a group [(#51)](https://github.com/spliit-app/spliit/issues/51)
20+
- [x] Upload and attach images to expenses [(#63)](https://github.com/spliit-app/spliit/issues/63)
2021

2122
### Possible incoming features
2223

@@ -37,8 +38,8 @@ The project is open to contributions. Feel free to open an issue or even a pull-
3738

3839
If you want to contribute financially and help us keep the application free and without ads, you can also:
3940

40-
* 💜 [Sponsor me (Sebastien)](https://github.com/sponsors/scastiel), or
41-
* 💙 [Make a small one-time donation](https://donate.stripe.com/28o3eh96G7hH8k89Ba).
41+
- 💜 [Sponsor me (Sebastien)](https://github.com/sponsors/scastiel), or
42+
- 💙 [Make a small one-time donation](https://donate.stripe.com/28o3eh96G7hH8k89Ba).
4243

4344
## Run locally
4445

@@ -55,6 +56,23 @@ If you want to contribute financially and help us keep the application free and
5556
3. Run `npm run start-container` to start the postgres and the spliit2 containers
5657
4. You can access the app by browsing to http://localhost:3000
5758

59+
## Opt-in features
60+
61+
### Expense documents
62+
63+
Spliit offers users to upload images (to an AWS S3 bucket) and attach them to expenses. To enable this feature:
64+
65+
- Follow the instructions in the _S3 bucket_ and _IAM user_ sections of [next-s3-upload](https://next-s3-upload.codingvalue.com/setup#s3-bucket) to create and set up an S3 bucket where images will be stored.
66+
- Update your environments variables with appropriate values:
67+
68+
```.env
69+
NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS=true
70+
S3_UPLOAD_KEY=AAAAAAAAAAAAAAAAAAAA
71+
S3_UPLOAD_SECRET=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
72+
S3_UPLOAD_BUCKET=name-of-s3-bucket
73+
S3_UPLOAD_REGION=us-east-1
74+
```
75+
5876
## License
5977

6078
MIT, see [LICENSE](./LICENSE).

next.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {}
2+
const nextConfig = {
3+
images: {
4+
remotePatterns:
5+
process.env.S3_UPLOAD_BUCKET && process.env.S3_UPLOAD_REGION
6+
? [
7+
{
8+
hostname: `${process.env.S3_UPLOAD_BUCKET}.s3.${process.env.S3_UPLOAD_REGION}.amazonaws.com`,
9+
},
10+
]
11+
: [],
12+
},
13+
}
314

415
module.exports = nextConfig

0 commit comments

Comments
 (0)