DEV Community

Cover image for I built a sharing files webapp with Nextjs / Firebase / tailwindcss
ablil
ablil

Posted on

I built a sharing files webapp with Nextjs / Firebase / tailwindcss

Webapp : ephemere-clud
Repository: github

why ?

Ther are soo many tools or websites that allows to share files over the internet with people, however I didn't find one simpler and intuitive to use, not filled with ads or pricing plans ...

So I thought, why not build one myself, a one that suits my style and liking, and I think this is it

What's so special about it ?
It's easy to use, simple and intuitive. You upload a file or multiple files, set a password if you want to protect it, set a timer before the file get removed by default and set a description for the reciever.

After that you simply click on upload and share the generated link with your friends.

how it's working ?
This webapp is built with Nextjs and Firebase, It's my first time building something with Nextjs, so it was an opporutunity to discover this Framework and it was awesome.

The webapp is hosted on vercel since it goes well with Nextjs, and use Firebase for storage.

Challenges
One of the main challenges I had is, how to organize the data in the backend, how to keep track of files (and sometimes there are group of files), and how to keep track of the metadata (public url, password, descrption ...); so I came up with the following simple strategy:
The user upload one or multiple files, I'll generate a unique identifier that act a directory to group all these files,I store them on firebase storage, after that I'll upload a metadata object to firebase database which keep a record of the identifier, password, public url of files ... and since we have the identifier we can access directly the file on firebase storage.

Another challenge I had is, how to remove files automatically, I know there are firebase function, but I'm sticking right now with the free plan of firebase, so I had to think of another solution.
Well I have created a small python script that run every 15 minutes through a cronjob, and check if there is some experied files to be removed

What to come next ?

  1. Since this is just a side project, I thinking about integrating aws S3 as well and being able to switch between S3 and firebase storage easily whenever I want.
  2. Creating a Telegram bot, you send a file and get a response with a link you can share with your friends.
  3. Create a react native app ( I've never built something with react native so this is the opportunity)

please feel free to contribute

Top comments (0)