Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add attachment (pictures, receipts, etc) to expenses #63

Closed
ZeWaren opened this issue Jan 26, 2024 · 3 comments · Fixed by #64
Closed

Ability to add attachment (pictures, receipts, etc) to expenses #63

ZeWaren opened this issue Jan 26, 2024 · 3 comments · Fixed by #64
Labels
enhancement New feature or request

Comments

@ZeWaren
Copy link

ZeWaren commented Jan 26, 2024

As a user, I would like to be able to attach files to expenses.

Typical use cases:

  • Someone pays the bill at a restaurant, and immediately adds the picture of the receipt.
  • Someone books something online (accommodation, entertainment, etc) and adds a PDF to the expense.

On a mobile device, receipts can be added from the gallery, or from the camera directly (I believe the mobile operating systems can handle that case directly).

As I user, I want to:

  • be able to add an attachment when creating a new expense or when editing an existing one.
  • see existing attachments on an expense.
  • replace or delete existing attachments.

The first version would simply store the files directly on the same host the server is running.
On a technical level, ideally the directory/folder where the attachments are stored should be configurable (with an env variable).
Later, we could implement more storage mechanisms (FTP, SFTP, S3, etc.)

@scastiel scastiel added the enhancement New feature or request label Jan 26, 2024
@scastiel
Copy link
Member

Thanks @ZeWaren for such a well-qualified issue 😊

That’d be a very cool feature. It would mean we have a choice to make about how to store the images. Here are some solutions I can think of:

Use an S3 bucket

Probably the most generic option, the cheapest one, and the one that will satisfy most users. It’s not too much work in the app, but it means dealing with the AWS console, and updating the documentation to explain how to create an S3 bucket.

Use Vercel Blob

The easiest solution to set up. It might make sense as the app is built with Next.js and so the most common use case is to deploy it on Vercel. But I’d prefer avoiding adding another dependency to Vercel. (Even though I use the Vercel’s database, it’s a plain PostgreSQL database and I can switch to another one anytime. It doesn’t work that way with Blob.)

Other hosting services

Cloudinary, Bytescale and others provided a nice solution for hosting images, including widgets for upload. They are also more expensive. I don’t know if they support uploading something else than an image (like a PDF document).

Other solutions?

Storing files on the same host as the app is not really an option as the app runs on a read-only filesystem (on Vercel, and I suspect it’s the same on many hosting services).


The ideal solution would be to offer several photo-hosting solutions, and an easy way for anyone to add their own.

For now, my preference would go to using an S3 bucket (providing the credentials as an environment variable). It would be an opt-in feature, i.e. if you deploy your own instance but don’t want to provide S3 credentials, you simply won’t have access to the uploading feature.

@ZeWaren
Copy link
Author

ZeWaren commented Jan 26, 2024

No issue with all the solutions you provided. However, some people who self-host the project on some simple architectures (VPS, Raspberry Pi) would be perfectly happy with using the next directory somewhere on their filesystem.
I'd say the application should support all types and allow each sysadmin to configure it according to their hardware/cloud-provider.

@scastiel
Copy link
Member

I just implemented image upload, storing them to S3 (#64). I think it covers most of the needs, but I created two other issues to continue on this path (not too urgent though):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants