Built from scratch

Mandar Bhide
3 min readMar 6, 2024

HomeCloud: Local file cloud

With rise and reach of next generations of networks, cloud file storage solutions have become an integral part of our lives. May it be Google drive or OneDrive or Dropbox. But the thing with these is that we cannot completely control the storage and use of our data. Secondly, the PAYWALLS. But what if, you had a solution running on local network? That’s how I began working on HomeCloud.

Now, the solution has three main components: Server-side application, database and the client application. Let’s take a look at them one by one.

Server-side application

As of now, it is a simple python server written in flask that handles HTTP requests and performs read/write operations in the local file system. It also features an HTML page that displays a QR code which can be scanned from the client application to connect. It is also responsible for maintaining data such as last accessed date and time for a file or calculating thumbnails for image files etc.

The Database

Let’s start with WHY! For very basic file structure and volume, its okay to go to the file system every time you get a request. But the task becomes growingly infeasible when volume and complexity increases. A PostgreSQL database keeps track of all files/folders as the user creates/accesses/deletes them. Thus, the server turns to the file system only when it has to actually read/write a file. Also, using the field ‘parent_id’ the server application can easily build the entire hierarchy without turning towards the file system at all.

Client application

Client application is mobile application written in Dart using Flutter framework. Flutter is obvious choice given its support to virtually all platforms and its performance. The application allows user to connect to the server either by entering the URL or by scanning the QR code displayed on web application’s home. Further, user can access all the files and folders, create new folders, upload files, rename or delete them. Basically, everything that one can do on Google Drive (Just not ‘Make available offline’)

As of now, the server application is complete. The client application development is in progress with following design as reference. Currently, it assumes just one user. But in later versions, the application can be easily adapted for multiple users, thereby adding access control functionality for the owner of the file. ‘Make available offline’ is another feature that can be implemented in no time. At that stage, it will be just a few steps away from being a ‘Google Drive’ on its own!

I hope you found this experience interesting. Don’t forget to give it a clap and feel free to give feedbacks. Visit this repository for the code.

Cheers!

--

--

Mandar Bhide

Computer Engineering student | Web and app developer| Love to learn technologies :)